From 94a112cbb3d7afd398ec32c5b1149352144f71b7 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 9 Apr 2023 13:07:25 +0200 Subject: Fix a bug with noise channel envelope --- src/sequencer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sequencer.c') diff --git a/src/sequencer.c b/src/sequencer.c index ff5847d..6baa565 100644 --- a/src/sequencer.c +++ b/src/sequencer.c @@ -1832,9 +1832,6 @@ irq_timer(void) { if (pat->ch4.active) { TriggerNote *trig = &pat->ch4.notes[step_counter]; ChannelNoiseParams *params = &pat->ch4.params[step_counter]; - SOUND_NOISE_CTRL = SOUND_NOISE_ENV_VOL(params->env_volume) - | SOUND_NOISE_ENV_TIME(params->env_time) - | SOUND_NOISE_ENV_DIR(params->env_direction); if (trig->active) { static const u8 div_freq[] = { 7, 6, 5, 4, 7, 6, 5, 4, 7, 6, 5, 4, @@ -1852,6 +1849,9 @@ irq_timer(void) { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + SOUND_NOISE_CTRL = SOUND_NOISE_ENV_VOL(params->env_volume) + | SOUND_NOISE_ENV_TIME(params->env_time) + | SOUND_NOISE_ENV_DIR(params->env_direction); SOUND_NOISE_FREQ = SOUND_FREQ_RESET | SOUND_NOISE_PRESTEP_FREQ(pre_freq[trig->note]) | SOUND_NOISE_DIV_FREQ(div_freq[trig->note]) -- cgit v1.2.1