From f090cfe75ca3978c08d22b77bb478fb22638b3d9 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Fri, 7 Oct 2022 23:36:38 +0100 Subject: Relocate US ANSI shifted keycode aliases (#18634) --- quantum/sequencer/tests/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/sequencer') diff --git a/quantum/sequencer/tests/rules.mk b/quantum/sequencer/tests/rules.mk index a3bbd80513..611459e060 100644 --- a/quantum/sequencer/tests/rules.mk +++ b/quantum/sequencer/tests/rules.mk @@ -2,7 +2,7 @@ # - it is consistent with the example that is used as a reference in the Unit Testing article (https://docs.qmk.fm/#/unit_testing?id=adding-tests-for-new-or-existing-features) # - Neither `make test:sequencer` or `make test:SEQUENCER` work when using SCREAMING_SNAKE_CASE -sequencer_DEFS := -DNO_DEBUG -DMIDI_MOCKED +sequencer_DEFS := -DMATRIX_ROWS=1 -DMATRIX_COLS=1 -DNO_DEBUG -DMIDI_MOCKED sequencer_SRC := \ $(QUANTUM_PATH)/sequencer/tests/midi_mock.c \ -- cgit v1.2.3 From f11a247127c82bc207f20e0b1be2cf6efea3a129 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 3 Nov 2022 20:44:36 +0000 Subject: Reduce includes for sequencer header (#18946) --- quantum/sequencer/sequencer.c | 2 ++ quantum/sequencer/sequencer.h | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'quantum/sequencer') diff --git a/quantum/sequencer/sequencer.c b/quantum/sequencer/sequencer.c index 2e92f7b3eb..ff243c870b 100644 --- a/quantum/sequencer/sequencer.c +++ b/quantum/sequencer/sequencer.c @@ -15,6 +15,8 @@ */ #include "sequencer.h" +#include "debug.h" +#include "timer.h" #ifdef MIDI_ENABLE # include "process_midi.h" diff --git a/quantum/sequencer/sequencer.h b/quantum/sequencer/sequencer.h index a8ea16eece..a6498ed413 100644 --- a/quantum/sequencer/sequencer.h +++ b/quantum/sequencer/sequencer.h @@ -17,8 +17,7 @@ #pragma once #include -#include "debug.h" -#include "timer.h" +#include // Maximum number of steps: 256 #ifndef SEQUENCER_STEPS @@ -42,7 +41,18 @@ * Make sure that the items of this enumeration follow the powers of 2, separated by a ternary variant. * Check the implementation of `get_step_duration` for further explanation. */ -typedef enum { SQ_RES_2, SQ_RES_2T, SQ_RES_4, SQ_RES_4T, SQ_RES_8, SQ_RES_8T, SQ_RES_16, SQ_RES_16T, SQ_RES_32, SEQUENCER_RESOLUTIONS } sequencer_resolution_t; +typedef enum { + SQ_RES_2, // + SQ_RES_2T, + SQ_RES_4, + SQ_RES_4T, + SQ_RES_8, + SQ_RES_8T, + SQ_RES_16, + SQ_RES_16T, + SQ_RES_32, + SEQUENCER_RESOLUTIONS +} sequencer_resolution_t; typedef struct { bool enabled; -- cgit v1.2.3 From 8b658dcc9a826b03fedb1ef2bfcc692f3e25da1b Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 7 Nov 2022 13:26:15 +1100 Subject: Normalise MIDI keycodes (#18972) * `MI_ON`, `MI_OFF`, `MI_TOG` -> `MI_TOGG` * `MI_CH*`, `MI_CHU` -> `MI_CHNU`, `MI_CHD` -> `MI_CHND` * `MI_VEL_*` -> `MI_VL*`, `MI_VELU`, `MI_VELD` * `MI_TRNS_*` -> `MI_TR*`, `MI_TRNSU` -> `MI_TRSU`, `MI_TRNSD` -> `MI_TRSD` * `MI_OCT_*` -> `MI_OC*`, `MI_OCTU`, `MI_OCTD` * Misc controls * Note keycodes * Add legacy keycodes * Regenerate keycodes * Typo --- quantum/sequencer/tests/sequencer_tests.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'quantum/sequencer') diff --git a/quantum/sequencer/tests/sequencer_tests.cpp b/quantum/sequencer/tests/sequencer_tests.cpp index 05e58e4111..79ec10cabf 100644 --- a/quantum/sequencer/tests/sequencer_tests.cpp +++ b/quantum/sequencer/tests/sequencer_tests.cpp @@ -371,14 +371,14 @@ void setUpMatrixScanSequencerTest(void) { sequencer_config.resolution = SQ_RES_16; // Configure the notes for each track - sequencer_config.track_notes[0] = MI_C; - sequencer_config.track_notes[1] = MI_D; - sequencer_config.track_notes[2] = MI_E; - sequencer_config.track_notes[3] = MI_F; - sequencer_config.track_notes[4] = MI_G; - sequencer_config.track_notes[5] = MI_A; - sequencer_config.track_notes[6] = MI_B; - sequencer_config.track_notes[7] = MI_C; + sequencer_config.track_notes[0] = QK_MIDI_NOTE_C_0; + sequencer_config.track_notes[1] = QK_MIDI_NOTE_D_0; + sequencer_config.track_notes[2] = QK_MIDI_NOTE_E_0; + sequencer_config.track_notes[3] = QK_MIDI_NOTE_F_0; + sequencer_config.track_notes[4] = QK_MIDI_NOTE_G_0; + sequencer_config.track_notes[5] = QK_MIDI_NOTE_A_0; + sequencer_config.track_notes[6] = QK_MIDI_NOTE_B_0; + sequencer_config.track_notes[7] = QK_MIDI_NOTE_C_0; // Turn on some steps sequencer_config.steps[0] = (1 << 0); @@ -389,7 +389,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldAttackFirstTrackOfFirstStep) setUpMatrixScanSequencerTest(); sequencer_task(); - EXPECT_EQ(last_noteon, MI_C); + EXPECT_EQ(last_noteon, QK_MIDI_NOTE_C_0); EXPECT_EQ(last_noteoff, 0); } @@ -499,7 +499,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldReleaseFirstTrackFirstStep) { sequencer_task(); EXPECT_EQ(last_noteon, 0); - EXPECT_EQ(last_noteoff, MI_C); + EXPECT_EQ(last_noteoff, QK_MIDI_NOTE_C_0); } TEST_F(SequencerTest, TestMatrixScanSequencerShouldEnterPausePhaseAfterRelease) { @@ -565,7 +565,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldProcessSecondTrackOnTime) { advance_time(SEQUENCER_TRACK_THROTTLE); sequencer_task(); - EXPECT_EQ(last_noteon, MI_D); + EXPECT_EQ(last_noteon, QK_MIDI_NOTE_D_0); EXPECT_EQ(last_noteoff, 0); } -- cgit v1.2.3