Skip to content

Commit

Permalink
v0.1.5 Increased Preset/Library size to 512 max
Browse files Browse the repository at this point in the history
  • Loading branch information
neroroxxx committed Sep 14, 2020
1 parent 2529c18 commit ea16c04
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=BMC
version=0.1.4
version=0.1.5
author=Nero Rox
maintainer=Nero Rox <info@roxxxtar.com>
sentence=Fully featured MIDI Controller Library with a Companion Editor App. For Teensy
Expand Down
2 changes: 1 addition & 1 deletion src/BMC-Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// BMC Version stored in EEPROM (for editor usage)
#define BMC_VERSION_MAJ 0
#define BMC_VERSION_MIN 1
#define BMC_VERSION_PATCH 4
#define BMC_VERSION_PATCH 5

//16 bits unsigned, LSB byte is minor, MSB byte is major
#define BMC_VERSION ((BMC_VERSION_MAJ<<8) | BMC_VERSION_MIN)
Expand Down
2 changes: 1 addition & 1 deletion src/editor/BMC-Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class BMCEditor {
return 0;
}

uint8_t checkIfHardwareAvailable(uint8_t t_type){
uint16_t checkIfHardwareAvailable(uint8_t t_type){
switch(t_type){
case BMC_ITEM_ID_BUTTON: return BMC_MAX_BUTTONS;
case BMC_ITEM_ID_LED: return BMC_MAX_LEDS;
Expand Down
2 changes: 1 addition & 1 deletion src/editor/BMC-Editor.midi.global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ void BMCEditor::globalLibrary(bool write){//BMC_GLOBALF_LIBRARY
BMC_GLOBALF_LIBRARY, 0,
index
);
buff.appendToSysEx8Bits(BMC_MAX_LIBRARY);
buff.appendToSysEx14Bits(BMC_MAX_LIBRARY);
#if BMC_MAX_LIBRARY > 0
bmcStoreGlobalLibrary& item = store.global.library[index];
buff.appendToSysEx32Bits(item.event);
Expand Down
6 changes: 4 additions & 2 deletions src/editor/BMC-Editor.midi.page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ void BMCEditor::pageHardwareCopySwapMessage(bool write){
}
// must be a page message and must be a write message
uint8_t hardwareType = incoming.get7Bits(9);
uint8_t hardwareLength = checkIfHardwareAvailable(hardwareType);
uint16_t hardwareLength = checkIfHardwareAvailable(hardwareType);
// check if the hardware type is vailable otherwise send an error message
if(hardwareLength==0 && hardwareType!=BMC_ITEM_ID_PAGE){
sendNotification(BMC_NOTIFY_INVALID_INDEX, hardwareLength | (__LINE__<<16), true);
Expand Down Expand Up @@ -1190,7 +1190,9 @@ void BMCEditor::pageHardwareCopySwapMessage(bool write){
}
if(success){
BMCMidiMessage buff;
buff.prepareEditorMessage(port, deviceId, mode, 0, 0);
BMCEditorMidiFlags flag;
flag.setPage(true);
buff.prepareEditorMessage(port, deviceId, mode, flag, 0);
buff.appendToSysEx7Bits(1);
sendToEditor(buff);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/utility/BMC-ConfigCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// 8-bit unsigned integers, specially when sending these values out thru midi

#define BMC_LIMIT_MIN_LIBRARY 0
#define BMC_LIMIT_MAX_LIBRARY 255
#define BMC_LIMIT_MAX_LIBRARY 512

#define BMC_LIMIT_MIN_PRESETS 0
#define BMC_LIMIT_MAX_PRESETS 255
#define BMC_LIMIT_MAX_PRESETS 512

#define BMC_LIMIT_MIN_PRESET_ITEMS 1
#define BMC_LIMIT_MAX_PRESET_ITEMS 16
Expand Down
2 changes: 1 addition & 1 deletion src/utility/BMC-MidiMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ struct BMCMidiMessage {
appendToSysEx7Bits(BMC_GET_BYTE(0,BMC_EDITOR_SYSEX_ID));
appendToSysEx7Bits(deviceId);
appendToSysEx7Bits(flags);
appendToSysEx8Bits(page); // 2 bytes
appendToSysEx14Bits(page); // 2 bytes
appendToSysEx7Bits(functionId);
}
// append a 7-bit midi word to the sysex array
Expand Down

0 comments on commit ea16c04

Please sign in to comment.