Commit 5c4d9285 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Reset pitch envelopes after program change

parent f7cb65f2
......@@ -86,6 +86,7 @@ program_change(uint8_t pgm)
vibrato_init();
gate_init();
pitch_init();
(*pgm_init[current_program])();
}
......
......@@ -8,6 +8,14 @@ static uint8_t _decay;
enum { DECAY_SCALE = 10000 };
void
pitch_init(void)
{
for_each_voice(v) {
_decay_counter[v] = 0;
}
}
void
pitch_set_note(uint8_t voice, uint8_t note, int16_t detune, uint16_t bend)
{
......
......@@ -8,6 +8,7 @@ uint16_t pitch_delta(uint8_t semitones);
void pitch_update_clock(uint8_t delta);
void pitch_envelope_set_decay(uint8_t decay);
void pitch_envelope_trigger(uint8_t voice);
void pitch_init(void);
enum {
BEND_CENTER = 8192,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment