From a42c9ef4bf9a5ad6534e85c4a7e1b34c5ac643ba Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sun, 17 Feb 2019 22:32:55 +1100 Subject: [PATCH 01/12] Update SwitchPreset.ino --- examples/SwitchPreset/SwitchPreset.ino | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/examples/SwitchPreset/SwitchPreset.ino b/examples/SwitchPreset/SwitchPreset.ino index 1f14a82..fa8099b 100644 --- a/examples/SwitchPreset/SwitchPreset.ino +++ b/examples/SwitchPreset/SwitchPreset.ino @@ -2,10 +2,14 @@ AxeSystem Axe; +unsigned long time; + void setup() { Serial.begin(9600); Axe.registerPresetChangingCallback(onPresetChanging); + Axe.registerPresetNameCallback(onPresetName); Axe.begin(Serial1, 4); + time = millis(); //Go to Axe, Setup->MIDI/Remote->Midi Channel=4 to see channel filter in action //Otherwise, just remove the channel param above and it will default to OMIN } @@ -16,14 +20,22 @@ void loop() { if (preset >= AxeSystem::MAX_PRESETS) { preset = 0; } - - Axe.sendPresetChange(preset); - delay(1000); - - preset += 11; + + if (millis() - time > 1000) { + Axe.sendPresetChange(preset); + preset += 11; + time = millis(); + } + + Axe.update(); } void onPresetChanging(PresetNumber preset) { - Serial.println(preset); + Serial.print(preset); + Serial.print(": "); +} + +void onPresetName(PresetNumber number, const char *name, const byte length) { + Serial.println(name); } \ No newline at end of file From a71bd22f46ef0ee941117ac3cd8065ff022d3bf0 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sun, 17 Feb 2019 22:33:18 +1100 Subject: [PATCH 02/12] Added effectsChanged --- src/interface/AxePreset.h | 4 ++++ src/interface/private/AxePreset.cpp | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/interface/AxePreset.h b/src/interface/AxePreset.h index 3c57a98..b7654cd 100644 --- a/src/interface/AxePreset.h +++ b/src/interface/AxePreset.h @@ -30,6 +30,10 @@ class AxePreset { unsigned getEffectCount() { return _effectCount; } AxeEffect getEffectAt(const EffectIndex index) { return _effects[index]; } + // Use to determine if the effect list has changed compared to + // another preset. Useful if deciding whether to reprint etc. + bool effectsChanged(AxePreset& preset); + // Defaults to 50. If you are running short on ram, lower this to // truncate the number of effects that will be read from the Axe. // Don't increase it without changing MAX_EFFECTS as well. diff --git a/src/interface/private/AxePreset.cpp b/src/interface/private/AxePreset.cpp index a9e16c0..8394a06 100644 --- a/src/interface/private/AxePreset.cpp +++ b/src/interface/private/AxePreset.cpp @@ -31,6 +31,26 @@ void AxePreset::setEffects(const AxeEffect effects[], const unsigned count) { } } +bool AxePreset::effectsChanged(AxePreset& compare) { + + if (_preset != compare._preset || _scene != compare._scene) + return true; + + if (_effectCount != compare._effectCount) + return true; + + for (byte i=0; i<_effectCount; i++) { + if (_effects[i]._effectId != compare._effects[i]._effectId) { + return true; + } else if (_effects[i]._bypassed != compare._effects[i]._bypassed) { + return true; + } + } + + return false; + +} + void AxePreset::copyPresetName(char *buffer, size_t max) { snprintf(buffer, max, _presetName); } From 3bf375efe02cd0360ceb8ef10d108dbbc4dc0f97 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sun, 17 Feb 2019 22:34:14 +1100 Subject: [PATCH 03/12] Make constructor public It doesn't make much sense to construct out of context, but is useful when storing for later comparisons --- src/interface/private/AxeEffect_Private.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/interface/private/AxeEffect_Private.h b/src/interface/private/AxeEffect_Private.h index 60c79a6..9f5dba7 100644 --- a/src/interface/private/AxeEffect_Private.h +++ b/src/interface/private/AxeEffect_Private.h @@ -6,8 +6,6 @@ const static char ASCII_ZERO = 0x30; friend class AxePreset; friend class AxeSystem; -AxeEffect() {} - void setAxeSystem(AxeSystem *axe) { _axe = axe; } void setBypassed(bool bypassed) { _bypassed = bypassed; } void setChannelCount(byte count) { _numChannels = count; } From 1283699065636a7fc69af793a2833362acbbc7f8 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sun, 17 Feb 2019 22:34:58 +1100 Subject: [PATCH 04/12] Make constructor public Useful when storing a preset object (ie previous preset) for comparison --- src/interface/private/AxePreset_Private.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/interface/private/AxePreset_Private.h b/src/interface/private/AxePreset_Private.h index ed9e3f6..ea0b25f 100644 --- a/src/interface/private/AxePreset_Private.h +++ b/src/interface/private/AxePreset_Private.h @@ -2,8 +2,6 @@ friend class AxeSystem; -AxePreset() {} - // These methods are used by AxeSystem to build the preset. // You don't need to call them, and you can't. void setPresetNumber(int number) { _preset = number; } From 263de7c672a7a520fe3b11fd0e188b48d98e82e5 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sun, 17 Feb 2019 23:23:08 +1100 Subject: [PATCH 05/12] Added comparison methods --- src/interface/AxePreset.h | 3 +++ src/interface/private/AxePreset.cpp | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/interface/AxePreset.h b/src/interface/AxePreset.h index b7654cd..6184fc0 100644 --- a/src/interface/AxePreset.h +++ b/src/interface/AxePreset.h @@ -34,6 +34,9 @@ class AxePreset { // another preset. Useful if deciding whether to reprint etc. bool effectsChanged(AxePreset& preset); + // Determine whether these presets have the same data + bool equals(AxePreset& compare); + // Defaults to 50. If you are running short on ram, lower this to // truncate the number of effects that will be read from the Axe. // Don't increase it without changing MAX_EFFECTS as well. diff --git a/src/interface/private/AxePreset.cpp b/src/interface/private/AxePreset.cpp index 8394a06..59569f3 100644 --- a/src/interface/private/AxePreset.cpp +++ b/src/interface/private/AxePreset.cpp @@ -31,18 +31,26 @@ void AxePreset::setEffects(const AxeEffect effects[], const unsigned count) { } } -bool AxePreset::effectsChanged(AxePreset& compare) { +bool AxePreset::equals(AxePreset& p) { + return + _preset == p._preset && + _scene == p._scene && + 0 == strcmp(_presetName, p._presetName) && + 0 == strcmp(_sceneName, p._sceneName) && + !effectsChanged(p); +} - if (_preset != compare._preset || _scene != compare._scene) - return true; +bool AxePreset::effectsChanged(AxePreset& p) { - if (_effectCount != compare._effectCount) + if (_preset != p._preset || + _scene != p._scene || + _effectCount != p._effectCount) { return true; + } for (byte i=0; i<_effectCount; i++) { - if (_effects[i]._effectId != compare._effects[i]._effectId) { - return true; - } else if (_effects[i]._bypassed != compare._effects[i]._bypassed) { + if (_effects[i]._effectId != p._effects[i]._effectId || + _effects[i]._bypassed != p._effects[i]._bypassed) { return true; } } From 42aeabef2ecca1aa284868973a684cf26490fb11 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sun, 17 Feb 2019 23:25:47 +1100 Subject: [PATCH 06/12] Remove the preset changing guard I don't think it's necessary, because if a refresh fires in the middle of a preset change, the extra packets will be filtered out. I'd rather remove a moving part. --- src/interface/AxeSystem.h | 22 +++++----------------- src/interface/private/AxeSystem.cpp | 9 ++++----- src/interface/private/AxeSystem_Private.h | 1 - 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/interface/AxeSystem.h b/src/interface/AxeSystem.h index a4c2104..54a28e0 100644 --- a/src/interface/AxeSystem.h +++ b/src/interface/AxeSystem.h @@ -21,12 +21,9 @@ class AxeSystem { public: - // Declare an instance of this class above your setup() function. - // Optionally register a notification callback, optionally turn on auto-refresh, - // and then just call Axe.update() in the main loop and you are ready to roll. - AxeSystem() { - _looper.setAxeSystem(this); - } + AxeSystem() { + _looper.setAxeSystem(this); + } // You must call begin with a hardware serial such as Serial1. Optionally set the // MIDI channel, defaults to OMNI. @@ -58,9 +55,8 @@ class AxeSystem { // To get the results back, you should register a callback. // Call registerPresetChangeCallback() to be notified of preset changes. // - // Alternatively, you can call getPreset() any time you want, but it will - // not reflect the next preset until isPresetReady() returns true. This - // is not the best way to go. You should register a callback instead. + // Alternatively, you can call getPreset() any time you want, but it is + // not guaranteed to be current. You should register a callback instead. void requestPresetDetails() { requestPresetName(); } void requestFirmwareVersion(); void requestTempo(); @@ -100,14 +96,6 @@ class AxeSystem { void sendProgramChange(byte value, byte channel); void sendSysEx(const byte *sysex, const byte length); - // These two methods tell you whether the preset is in the middle of - // changing. (They are just the inverse of each other.) During this time, - // sysex data is being read from the Axe, so the result will still reflect - // the old preset until isPresetReady() returns true, or isPresetChanging() - // returns false. You are better off registering a preset change callback! - bool isPresetReady() { return !_presetChanging; } - bool isPresetChanging() { return _presetChanging; } - // Well is it, or isn't it? As far as we know! This is pretty accurate // even if you enable/disable the tuner from the front panel. bool isTunerEngaged() { return _tunerEngaged; } diff --git a/src/interface/private/AxeSystem.cpp b/src/interface/private/AxeSystem.cpp index 9175b1c..9642ef3 100644 --- a/src/interface/private/AxeSystem.cpp +++ b/src/interface/private/AxeSystem.cpp @@ -2,13 +2,12 @@ void AxeSystem::update() { - if (!_presetChanging && _refreshRate > 0) { - unsigned long now = millis(); - if (now - _lastRefresh > _refreshRate) { + if (_refreshRate > 0) { + if (millis() - _lastRefresh > _refreshRate) { refresh(); } - } - + } + readMidi(); } diff --git a/src/interface/private/AxeSystem_Private.h b/src/interface/private/AxeSystem_Private.h index 1d8c0de..df37cbf 100644 --- a/src/interface/private/AxeSystem_Private.h +++ b/src/interface/private/AxeSystem_Private.h @@ -89,7 +89,6 @@ byte _midiChannel; bool _firmwareRequested = false; bool _tunerEngaged = false; bool _systemConnected = false; -bool _presetChanging = false; bool _midiReady = false; byte _sysexBuffer[MAX_SYSEX]; byte _sysexCount; From 10df13fbf7f8887198d61f35ef22a5b87ed5c8a8 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sun, 17 Feb 2019 23:26:01 +1100 Subject: [PATCH 07/12] Only fire preset change callback if anything actually changed --- src/interface/private/AxeSystem_Handlers.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/interface/private/AxeSystem_Handlers.cpp b/src/interface/private/AxeSystem_Handlers.cpp index 5b129f3..df3741f 100644 --- a/src/interface/private/AxeSystem_Handlers.cpp +++ b/src/interface/private/AxeSystem_Handlers.cpp @@ -1,7 +1,6 @@ #include "interface/AxeSystem.h" void AxeSystem::onPresetChange(const PresetNumber number) { - _presetChanging = true; _incomingPreset.reset(); _incomingPreset.setPresetNumber(number); requestPresetName(number); @@ -175,14 +174,14 @@ bool AxeSystem::isRequestedPreset(const PresetNumber number) { } void AxeSystem::checkIncomingPreset() { - if (_incomingPreset.isComplete()) { - _presetChanging = false; - _preset = _incomingPreset; - callPresetChangeCallback(&_preset); + if (_incomingPreset.isComplete() && !_preset.equals(_incomingPreset)) { + _preset = _incomingPreset; + callPresetChangeCallback(&_preset); } } // TODO: need to prioritise which effects are shown in order +// TODO: sometimes first message is wrong, corrected on refresh (ie change tempo wheel and fx list goes whacky) // If assuming naked amps pack it gets a lot easier :) void AxeSystem::processEffectDump(const byte *sysex, const byte length) { From 8e3d1ea1d9dc7c5c19dd5a25b1cc90c5346ccf38 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sat, 23 Feb 2019 18:55:43 +1100 Subject: [PATCH 08/12] Update Refresh.ino --- examples/Refresh/Refresh.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Refresh/Refresh.ino b/examples/Refresh/Refresh.ino index 69cd343..5ec474f 100644 --- a/examples/Refresh/Refresh.ino +++ b/examples/Refresh/Refresh.ino @@ -15,7 +15,7 @@ void setup() { Axe.registerPresetChangeCallback(onPresetChange); //ask for details to be refreshed every 3 seconds - Axe.enableRefresh(3000); + Axe.enableRefresh(); //request current preset Axe.requestPresetDetails(); From 1977ffbd8a4d7b05719a3f89857adce085be89a8 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sat, 23 Feb 2019 18:56:00 +1100 Subject: [PATCH 09/12] Changed default refresh to 500 --- src/interface/AxeSystem.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/interface/AxeSystem.h b/src/interface/AxeSystem.h index 54a28e0..fe18a75 100644 --- a/src/interface/AxeSystem.h +++ b/src/interface/AxeSystem.h @@ -1,6 +1,7 @@ #pragma once #include +#include "AxeFxControl.h" #include "private/AxeTypes.h" #include "AxeLooper.h" #include "AxeEffect.h" @@ -35,7 +36,7 @@ class AxeSystem { // Update preset details every millis. Don't refresh if another preset request // was received within throttle interval. - void enableRefresh(const millis_t millis = 3000, const millis_t throttle = 500); + void enableRefresh(const millis_t millis = 500, const millis_t throttle = 100); // Remember to call this from loop(). Avoid using delay() anywhere in your code // for best results. From 5c43ed475adc9f7297fe32d00a774cac366389d2 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sat, 23 Feb 2019 18:56:41 +1100 Subject: [PATCH 10/12] Stagger preset data requests to avoid filling RX buffer --- src/interface/private/AxeSystem_Handlers.cpp | 32 +++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/interface/private/AxeSystem_Handlers.cpp b/src/interface/private/AxeSystem_Handlers.cpp index df3741f..5a597bf 100644 --- a/src/interface/private/AxeSystem_Handlers.cpp +++ b/src/interface/private/AxeSystem_Handlers.cpp @@ -8,7 +8,7 @@ void AxeSystem::onPresetChange(const PresetNumber number) { } void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { - + if (callSysexPluginCallback(sysex, length)) { return; } @@ -31,6 +31,10 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { } case SYSEX_REQUEST_PRESET_INFO: { + #ifdef AXE_DEBUG + DEBUGGER.println("SYSEX_REQUEST_PRESET_INFO"); + #endif + _lastRefresh = millis(); const byte max = AxePreset::MAX_PRESET_NAME + 1; const PresetNumber number = midiBytesToInt(sysex[6], sysex[7]); @@ -41,8 +45,7 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { _incomingPreset.setPresetName(buffer); _incomingPreset.copyPresetName(buffer, max); //copy back out in case preset changed it callPresetNameCallback(number, (const char*) buffer, max); - requestSceneName(); - requestEffectDetails(); + requestSceneName(); //next item in chain checkIncomingPreset(); } else { #ifdef AXE_DEBUG @@ -56,6 +59,10 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { } case SYSEX_REQUEST_SCENE_INFO: { + #ifdef AXE_DEBUG + DEBUGGER.println("SYSEX_REQUEST_SCENE_INFO"); + #endif + //TODO during fast changes, can we guarantee this is for current preset? if (!_incomingPreset.isComplete()) { //TODO is this necessary given guard in preset name case? const SceneNumber number = sysex[6] + 1; @@ -65,6 +72,7 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { _incomingPreset.setSceneName(buffer); _incomingPreset.copySceneName(buffer, max); //copy back out in case preset changed it callSceneNameCallback(number, (const char*) buffer, max); + requestEffectDetails(); //ask here instead of in preset name to avoid filling rx buffer checkIncomingPreset(); } else { #ifdef AXE_DEBUG @@ -75,6 +83,10 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { } case SYSEX_REQUEST_SCENE_NUMBER: { + #ifdef AXE_DEBUG + DEBUGGER.println("SYSEX_REQUEST_SCENE_NUMBER"); + #endif + //TODO during fast changes, can we guarantee this is for current preset? if (!_incomingPreset.isComplete()) { //TODO is this necessary given guard in preset name case? _incomingPreset.setSceneNumber(sysex[6] + 1); @@ -88,6 +100,10 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { } case SYSEX_EFFECT_DUMP: { + #ifdef AXE_DEBUG + DEBUGGER.println("SYSEX_EFFECT_DUMP"); + #endif + //TODO during fast changes, can we guarantee this is for current preset? if (!_incomingPreset.isComplete()) { //TODO is this necessary given guard in preset name case? processEffectDump(sysex, length); @@ -102,6 +118,10 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { } case SYSEX_REQUEST_FIRMWARE: { + #ifdef AXE_DEBUG + DEBUGGER.println("SYSEX_REQUEST_FIRMWARE"); + #endif + _firmwareVersion.major = sysex[6]; _firmwareVersion.minor = sysex[7]; _usbVersion.major = sysex[9]; @@ -111,6 +131,10 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { } case SYSEX_REQUEST_TEMPO: { + #ifdef AXE_DEBUG + DEBUGGER.println("SYSEX_REQUEST_TEMPO"); + #endif + byte newTempo = (byte) midiBytesToInt(sysex[6], sysex[7]); if (newTempo != _tempo) { _tempo = newTempo; @@ -177,7 +201,7 @@ void AxeSystem::checkIncomingPreset() { if (_incomingPreset.isComplete() && !_preset.equals(_incomingPreset)) { _preset = _incomingPreset; callPresetChangeCallback(&_preset); - } + } } // TODO: need to prioritise which effects are shown in order From d7dcc6e607870a1d862caa146071c06c1ffbcfda Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sat, 23 Feb 2019 19:05:16 +1100 Subject: [PATCH 11/12] Removed Nano warning --- examples/EffectList/EffectList.ino | 1 - examples/FineGrainedCallbacks/FineGrainedCallbacks.ino | 2 +- examples/LooperStatus/LooperStatus.ino | 1 - examples/PresetDetails/PresetDetails.ino | 3 +-- examples/Refresh/Refresh.ino | 3 +-- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/EffectList/EffectList.ino b/examples/EffectList/EffectList.ino index f710e83..e424906 100644 --- a/examples/EffectList/EffectList.ino +++ b/examples/EffectList/EffectList.ino @@ -5,7 +5,6 @@ bool presetRequested = false; void setup() { - //note that this won't work on a Nano, it uses Serial for MIDI Serial.begin(9600); while (!Serial); diff --git a/examples/FineGrainedCallbacks/FineGrainedCallbacks.ino b/examples/FineGrainedCallbacks/FineGrainedCallbacks.ino index 288c0f0..959987d 100644 --- a/examples/FineGrainedCallbacks/FineGrainedCallbacks.ino +++ b/examples/FineGrainedCallbacks/FineGrainedCallbacks.ino @@ -30,7 +30,7 @@ void onSceneName(SceneNumber number, const char *name, const byte length) { Serial.println(name); } -//NOTE: only rely on the effects, the reset of the preset is not guaranteed to be complete. +//only rely on the effects, the reset of the preset is not guaranteed to be complete. void onEffectsReceived(PresetNumber number, AxePreset preset) { const size_t sz = 25; diff --git a/examples/LooperStatus/LooperStatus.ino b/examples/LooperStatus/LooperStatus.ino index 078b5d2..9fdf35d 100644 --- a/examples/LooperStatus/LooperStatus.ino +++ b/examples/LooperStatus/LooperStatus.ino @@ -4,7 +4,6 @@ AxeSystem Axe; void setup() { - //note that this won't work on a Nano, it uses Serial for MIDI Serial.begin(9600); Axe.begin(Serial1); diff --git a/examples/PresetDetails/PresetDetails.ino b/examples/PresetDetails/PresetDetails.ino index d435a77..ba0c899 100644 --- a/examples/PresetDetails/PresetDetails.ino +++ b/examples/PresetDetails/PresetDetails.ino @@ -4,7 +4,6 @@ AxeSystem Axe; void setup() { - //note that this won't work on a Nano, it uses Serial for MIDI Serial.begin(9600); while (!Serial); @@ -28,7 +27,7 @@ void onPresetChange(AxePreset preset) { const size_t sz = 150; char buf[sz]; - //NOTE! Preset/scene names with % in them will not print to debug properly + //Preset/scene names with % in them will not print to debug properly //AxeSystem has notified that all requested information has arrived! Serial.println(); diff --git a/examples/Refresh/Refresh.ino b/examples/Refresh/Refresh.ino index 5ec474f..8403068 100644 --- a/examples/Refresh/Refresh.ino +++ b/examples/Refresh/Refresh.ino @@ -4,7 +4,6 @@ AxeSystem Axe; void setup() { - //note that this won't work on a Nano, it uses Serial for MIDI Serial.begin(9600); // while (!Serial); @@ -31,7 +30,7 @@ void onPresetChange(AxePreset preset) { const size_t sz = 150; char buf[sz]; - //NOTE! Preset/scene names with % in them will not print to debug properly + //Preset/scene names with % in them will not print to debug properly //AxeSystem has notified that all requested information has arrived! Serial.print("Preset number: "); From 26d21eef52a0540d31e7ffe566e414208321e871 Mon Sep 17 00:00:00 2001 From: Tyson Lloyd Thwaites Date: Sat, 23 Feb 2019 19:05:52 +1100 Subject: [PATCH 12/12] Fixed #7 effect list bug --- src/interface/private/AxeSystem_Handlers.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/interface/private/AxeSystem_Handlers.cpp b/src/interface/private/AxeSystem_Handlers.cpp index 5a597bf..147c78c 100644 --- a/src/interface/private/AxeSystem_Handlers.cpp +++ b/src/interface/private/AxeSystem_Handlers.cpp @@ -63,8 +63,7 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { DEBUGGER.println("SYSEX_REQUEST_SCENE_INFO"); #endif - //TODO during fast changes, can we guarantee this is for current preset? - if (!_incomingPreset.isComplete()) { //TODO is this necessary given guard in preset name case? + if (!_incomingPreset.isComplete()) { const SceneNumber number = sysex[6] + 1; const byte max = AxePreset::MAX_SCENE_NAME + 1; parseName(sysex, length, 7, buffer, max); @@ -87,8 +86,7 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { DEBUGGER.println("SYSEX_REQUEST_SCENE_NUMBER"); #endif - //TODO during fast changes, can we guarantee this is for current preset? - if (!_incomingPreset.isComplete()) { //TODO is this necessary given guard in preset name case? + if (!_incomingPreset.isComplete()) { _incomingPreset.setSceneNumber(sysex[6] + 1); checkIncomingPreset(); } else { @@ -104,8 +102,7 @@ void AxeSystem::onSystemExclusive(const byte *sysex, const byte length) { DEBUGGER.println("SYSEX_EFFECT_DUMP"); #endif - //TODO during fast changes, can we guarantee this is for current preset? - if (!_incomingPreset.isComplete()) { //TODO is this necessary given guard in preset name case? + if (!_incomingPreset.isComplete()) { processEffectDump(sysex, length); callEffectsReceivedCallback(&_incomingPreset); checkIncomingPreset(); @@ -205,7 +202,6 @@ void AxeSystem::checkIncomingPreset() { } // TODO: need to prioritise which effects are shown in order -// TODO: sometimes first message is wrong, corrected on refresh (ie change tempo wheel and fx list goes whacky) // If assuming naked amps pack it gets a lot easier :) void AxeSystem::processEffectDump(const byte *sysex, const byte length) { @@ -229,7 +225,7 @@ void AxeSystem::processEffectDump(const byte *sysex, const byte length) { effect.setChannel(channel); effect.setChannelCount(numChannels); - //NOTE assumes preset number has already been received + //assumes preset number has already been received if (callEffectFilterCallback(_incomingPreset.getPresetNumber(), effect)) { effects[count++] = effect; }