Exemplo n.º 1
0
/* static */
void Arpeggiator::Start() {
  running_ = 1;
  bitmask_ = 1;
  tick_ = midi_clock_prescaler_ - 1;
  current_direction_ = (direction_ == ARPEGGIO_DIRECTION_DOWN ? -1 : 1);
  recording_ = 0;
  StartArpeggio();
}
Exemplo n.º 2
0
void Timbre::StepArpeggio() {

    if (current_octave_ == 127) {
        StartArpeggio();
        return;
    }

    int direction = params.engineArp1.direction;
    uint8_t num_notes = note_stack.size();
    if (direction == ARPEGGIO_DIRECTION_RANDOM) {
        uint8_t random_byte = *(uint8_t*)noise;
        current_octave_ = random_byte & 0xf;
        current_step_ = (random_byte & 0xf0) >> 4;
        while (current_octave_ >= params.engineArp1.octave) {
            current_octave_ -= params.engineArp1.octave;
        }
        while (current_step_ >= num_notes) {
            current_step_ -= num_notes;
        }
    } else {