Skip to content

Commit

Permalink
Set per-string MIDI channel from configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
KohlJary committed Sep 14, 2023
1 parent c26473b commit b3ffd3f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
24 changes: 24 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,30 @@ const int TPOSE_UP_INDEX = num_keys - 1;
/// @details This is intended to be the bottom second key from the right.
const int TPOSE_DN_INDEX = num_keys - 3;

/// @brief The MIDI channel of the "Hi Melody" string.
/// @details Default is MIDI channel 1.
const int MIDI_HI_CHANNEL = 1;

/// @brief The MIDI channel of the "Low Melody" string.
/// @details Default is MIDI channel 2.
const int MIDI_LO_CHANNEL = 2;

/// @brief The MIDI channel of the "Trompette" string.
/// @details Default is MIDI channel 3.
const int MIDI_TR_CHANNEL = 3;

/// @brief The MIDI channel of the "Drone" string.
/// @details Default is MIDI channel 4.
const int MIDI_DR_CHANNEL = 4;

/// @brief The MIDI channel of the "Buzz" string.
/// @details Default is MIDI channel 5.
const int MIDI_BZ_CHANNEL = 5;

/// @brief The MIDI channel of the "Key Click" string.
/// @details Default is MIDI channel 6.
const int MIDI_KC_CHANNEL = 6;


// These are less-commonly-changed options:

Expand Down
12 changes: 6 additions & 6 deletions digigurdy-baz.ino
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,12 @@ void setup() {
};
#endif

mystring = new GurdyString(1, Note(g4), "Hi Melody", EEPROM.read(EEPROM_SEC_OUT));
mylowstring = new GurdyString(2, Note(g3), "Low Melody", EEPROM.read(EEPROM_SEC_OUT));
mytromp = new GurdyString(3, Note(c3), "Trompette", EEPROM.read(EEPROM_SEC_OUT));
mydrone = new GurdyString(4, Note(c2), "Drone", EEPROM.read(EEPROM_SEC_OUT));
mybuzz = new GurdyString(5,Note(c3), "Buzz", EEPROM.read(EEPROM_SEC_OUT));
mykeyclick = new GurdyString(6, Note(b5), "Key Click", EEPROM.read(EEPROM_SEC_OUT));
mystring = new GurdyString(MIDI_HI_CHANNEL, Note(g4), "Hi Melody", EEPROM.read(EEPROM_SEC_OUT));
mylowstring = new GurdyString(MIDI_LO_CHANNEL, Note(g3), "Low Melody", EEPROM.read(EEPROM_SEC_OUT));
mytromp = new GurdyString(MIDI_TR_CHANNEL, Note(c3), "Trompette", EEPROM.read(EEPROM_SEC_OUT));
mydrone = new GurdyString(MIDI_DR_CHANNEL, Note(c2), "Drone", EEPROM.read(EEPROM_SEC_OUT));
mybuzz = new GurdyString(MIDI_BZ_CHANNEL, Note(c3), "Buzz", EEPROM.read(EEPROM_SEC_OUT));
mykeyclick = new GurdyString(MIDI_KC_CHANNEL, Note(b5), "Key Click", EEPROM.read(EEPROM_SEC_OUT));

if (EEPROM.read(EEPROM_SEC_OUT) > 0) {
mystring->setTrackLoops();
Expand Down

0 comments on commit b3ffd3f

Please sign in to comment.