aboutsummaryrefslogtreecommitdiffstats
path: root/src/sequencer.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-04-09 13:07:25 +0200
committerBad Diode <bd@badd10de.dev>2023-04-09 13:07:25 +0200
commit94a112cbb3d7afd398ec32c5b1149352144f71b7 (patch)
treea0b7286f2ec036623d0bca4d605445bd1f633327 /src/sequencer.c
parent4198973c29b4c91c2a40c5c637d00881ceb4511e (diff)
downloadstepper-94a112cbb3d7afd398ec32c5b1149352144f71b7.tar.gz
stepper-94a112cbb3d7afd398ec32c5b1149352144f71b7.zip
Fix a bug with noise channel envelope
Diffstat (limited to 'src/sequencer.c')
-rw-r--r--src/sequencer.c6
1 files changed, 3 insertions, 3 deletions
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) {
1832 if (pat->ch4.active) { 1832 if (pat->ch4.active) {
1833 TriggerNote *trig = &pat->ch4.notes[step_counter]; 1833 TriggerNote *trig = &pat->ch4.notes[step_counter];
1834 ChannelNoiseParams *params = &pat->ch4.params[step_counter]; 1834 ChannelNoiseParams *params = &pat->ch4.params[step_counter];
1835 SOUND_NOISE_CTRL = SOUND_NOISE_ENV_VOL(params->env_volume)
1836 | SOUND_NOISE_ENV_TIME(params->env_time)
1837 | SOUND_NOISE_ENV_DIR(params->env_direction);
1838 if (trig->active) { 1835 if (trig->active) {
1839 static const u8 div_freq[] = { 1836 static const u8 div_freq[] = {
1840 7, 6, 5, 4, 7, 6, 5, 4, 7, 6, 5, 4, 1837 7, 6, 5, 4, 7, 6, 5, 4, 7, 6, 5, 4,
@@ -1852,6 +1849,9 @@ irq_timer(void) {
1852 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1849 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1853 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1850 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1854 }; 1851 };
1852 SOUND_NOISE_CTRL = SOUND_NOISE_ENV_VOL(params->env_volume)
1853 | SOUND_NOISE_ENV_TIME(params->env_time)
1854 | SOUND_NOISE_ENV_DIR(params->env_direction);
1855 SOUND_NOISE_FREQ = SOUND_FREQ_RESET 1855 SOUND_NOISE_FREQ = SOUND_FREQ_RESET
1856 | SOUND_NOISE_PRESTEP_FREQ(pre_freq[trig->note]) 1856 | SOUND_NOISE_PRESTEP_FREQ(pre_freq[trig->note])
1857 | SOUND_NOISE_DIV_FREQ(div_freq[trig->note]) 1857 | SOUND_NOISE_DIV_FREQ(div_freq[trig->note])