Skip to content

Commit

Permalink
Adds global quantize rate to keyboard menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quixotic7 committed Feb 29, 2024
1 parent 61f88aa commit 0008d79
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OMX-27-firmware/OMX-27-firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ void saveHeader()

storage->write(EEPROM_HEADER_ADDRESS + 35, midiSettings.defaultVelocity);

// 36 bytes
storage->write(EEPROM_HEADER_ADDRESS + 36, clockConfig.globalQuantizeStepIndex);

// 37 bytes
}

// returns true if the header contained initialized data
Expand Down Expand Up @@ -436,6 +438,8 @@ bool loadHeader(void)

midiSettings.defaultVelocity = storage->read(EEPROM_HEADER_ADDRESS + 35);

clockConfig.globalQuantizeStepIndex = constrain(storage->read(EEPROM_HEADER_ADDRESS + 36), 0, kNumArpRates - 1);

return true;
}

Expand Down
1 change: 1 addition & 0 deletions OMX-27-firmware/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const uint8_t EEPROM_VERSION = 34;
// v32 - adds mfx chord saves
// v33 - adds mfx selector saves
// v34 - adds mfx repeat saves
// - added global quant rate to header, keeping version, but value will be random

// DEFINE CC NUMBERS FOR POTS // CCS mapped to Organelle Defaults
const int CC1 = 21;
Expand Down
13 changes: 13 additions & 0 deletions OMX-27-firmware/src/midifx/midifx_repeat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ namespace midifx
rateStartHz_ = 100;
rateEndHz_ = 100;

fadeVel_ = false;
fadeRate_ = false;

quantizeSync_ = true;

recalcVariables();
Expand Down Expand Up @@ -431,6 +434,8 @@ namespace midifx
activeNoteQueue.shrink_to_fit();
}



// if(!noteAdded)
// {
// Serial.println("Could not add note");
Expand All @@ -439,6 +444,14 @@ namespace midifx
// Room up to 16 in playedNoteQueue, can add to pending or active
if (noteAdded)
{
// In these modes the note will be on
// Remove the note and readd to avoid weird overlapping repeats
if (mode_ == MFXREPEATMODE_1SHOT || mode_ == MFXREPEATMODE_HOLD)
{
removeFromQueue(&activeNoteQueue, note);
removeFromQueue(&pendingNoteQueue, note);
}

if (activeNoteQueue.size() + pendingNoteQueue.size() < queueSize)
{
// Add to pending queue, note will be added to active queue on clock
Expand Down
11 changes: 11 additions & 0 deletions OMX-27-firmware/src/modes/omx_mode_midi_keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,13 @@ void OmxModeMidiKeyboard::onEncoderChanged(Encoder::Update enc)
scaleConfig.group16 = constrain(scaleConfig.group16 + amt, 0, 1);
}
}
else if(selPage == MIPAGE_CFG)
{
if (selParam == 3)
{
clockConfig.globalQuantizeStepIndex = constrain(clockConfig.globalQuantizeStepIndex + amt, 0, kNumArpRates - 1);
}
}

omxDisp.setDirty();
}
Expand Down Expand Up @@ -1181,6 +1188,10 @@ void OmxModeMidiKeyboard::onDisplayUpdate()
omxDisp.legends[1] = "CLR";
omxDisp.legendText[0] = "CFG";
omxDisp.legendText[1] = "STOR";

omxDisp.legends[2] = "QUANT";
omxDisp.useLegendString[2] = true;
omxDisp.legendString[2] = "1/" + String(kArpRates[clockConfig.globalQuantizeStepIndex]);
}

omxDisp.dispGenericMode2(params.getNumPages(), params.getSelPage(), params.getSelParam(), encoderSelect && !midiSettings.midiAUX);
Expand Down

0 comments on commit 0008d79

Please sign in to comment.