diff options
author | Bad Diode <bd@badd10de.dev> | 2023-08-22 17:44:01 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2023-08-22 17:44:01 +0200 |
commit | 5d86238b8cc3c6dba95e90eed9fb444bb276f02e (patch) | |
tree | d3b1d4c4509631a3dace28486b6887445298af1f /src/sequencer.c | |
parent | 9c0c004b78a12861ed03ce851d0885d68a25cb02 (diff) | |
download | stepper-5d86238b8cc3c6dba95e90eed9fb444bb276f02e.tar.gz stepper-5d86238b8cc3c6dba95e90eed9fb444bb276f02e.zip |
Added initial implementation of scale mode
Diffstat (limited to 'src/sequencer.c')
-rw-r--r-- | src/sequencer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sequencer.c b/src/sequencer.c index ce09658..609ccee 100644 --- a/src/sequencer.c +++ b/src/sequencer.c | |||
@@ -406,7 +406,7 @@ handle_channel_selection(void) { | |||
406 | case 3: { trig = &pat->ch4.notes[i]; } break; | 406 | case 3: { trig = &pat->ch4.notes[i]; } break; |
407 | default: {trig = &pat->ch1.notes[i]; } break; | 407 | default: {trig = &pat->ch1.notes[i]; } break; |
408 | } | 408 | } |
409 | trig->note = MAX((s32)trig->note + inc, (s32)NOTE_C_2); | 409 | trig->note = scale_note(trig->note, inc); |
410 | } | 410 | } |
411 | redraw_trigs = true; | 411 | redraw_trigs = true; |
412 | } else if (key_tap(KEY_R)) { | 412 | } else if (key_tap(KEY_R)) { |
@@ -423,7 +423,7 @@ handle_channel_selection(void) { | |||
423 | case 3: { trig = &pat->ch4.notes[i]; } break; | 423 | case 3: { trig = &pat->ch4.notes[i]; } break; |
424 | default: {trig = &pat->ch1.notes[i]; } break; | 424 | default: {trig = &pat->ch1.notes[i]; } break; |
425 | } | 425 | } |
426 | trig->note = MIN((s32)trig->note + inc, (s32)NOTE_C_8 - 1); | 426 | trig->note = scale_note(trig->note, inc); |
427 | } | 427 | } |
428 | redraw_trigs = true; | 428 | redraw_trigs = true; |
429 | } | 429 | } |
@@ -1292,7 +1292,7 @@ handle_trigger_selection(void) { | |||
1292 | } | 1292 | } |
1293 | // Decrease note. | 1293 | // Decrease note. |
1294 | if (trig->active && !empty) { | 1294 | if (trig->active && !empty) { |
1295 | trig->note = MAX((s32)trig->note + inc, (s32)NOTE_C_2); | 1295 | trig->note = scale_note(trig->note, inc); |
1296 | } | 1296 | } |
1297 | redraw_trigs = true; | 1297 | redraw_trigs = true; |
1298 | redraw_piano_note = true; | 1298 | redraw_piano_note = true; |
@@ -1303,7 +1303,7 @@ handle_trigger_selection(void) { | |||
1303 | } | 1303 | } |
1304 | // Increase note. | 1304 | // Increase note. |
1305 | if (trig->active && !empty) { | 1305 | if (trig->active && !empty) { |
1306 | trig->note = MIN((s32)trig->note + inc, (s32)NOTE_C_8 - 1); | 1306 | trig->note = scale_note(trig->note, inc); |
1307 | } | 1307 | } |
1308 | redraw_trigs = true; | 1308 | redraw_trigs = true; |
1309 | redraw_piano_note = true; | 1309 | redraw_piano_note = true; |