Created
March 2, 2015 20:23
-
-
Save pichenettes/44cfbdc3433425322ad8 to your computer and use it in GitHub Desktop.
Anushri code modification for Volca clock sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void VoiceController::Clock(bool midi_generated) { | |
voice_.set_lfo_pll_target_phase(lfo_sync_counter_); | |
if (!clock_counter_) { | |
if (!clock_out_counter_) { | |
clock_pulse_ = 8; | |
} | |
clock_out_counter_ = (clock_out_counter_ + 1) & 1; // Divide by 2. | |
ClockArpeggiator(); | |
ClockSequencer(); | |
ClockDrumMachine(); | |
} | |
midi_dispatcher.OnClock(midi_generated); | |
++clock_counter_; | |
uint8_t clock_pulses_per_step = midi_generated ? 6 : clock_divisions[system_settings.clock_ppqn()]; | |
if (clock_counter_ >= clock_pulses_per_step) { | |
clock_counter_ = 0; | |
} | |
++lfo_sync_counter_; | |
if (lfo_sync_counter_ == 24) { | |
lfo_sync_counter_ = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment