Skip to content

Commit 2b0231e

Browse files
committed
synthio: re-striking a note should re-enter attack
.. without changing the current note amplitude
1 parent 021aaa4 commit 2b0231e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

shared-module/synthio/__init__.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,8 @@ STATIC int find_channel_with_note(synthio_synth_t *synth, mp_obj_t note) {
372372
bool synthio_span_change_note(synthio_synth_t *synth, mp_obj_t old_note, mp_obj_t new_note) {
373373
int channel;
374374
if (new_note != SYNTHIO_SILENCE && (channel = find_channel_with_note(synth, new_note)) != -1) {
375-
// note already playing, re-strike
376-
synthio_envelope_state_init(&synth->envelope_state[channel], &synth->envelope_definition);
377-
synth->accum[channel] = 0;
375+
// note already playing, re-enter attack phase
376+
synth->envelope_state[channel].state = SYNTHIO_ENVELOPE_STATE_ATTACK;
378377
return true;
379378
}
380379
channel = find_channel_with_note(synth, old_note);

0 commit comments

Comments
 (0)