Replies: 7 comments 11 replies
-
Hi @RobertoHE Arduino-BLE-MIDI/src/BLEMIDI_Transport.h Line 26 in 8dee1f7 it just lacks an example for the moment. I'll see if i can create one tonight |
Beta Was this translation helpful? Give feedback.
-
Here is how to override #include <BLEMIDI_Transport.h>
struct CustomBufferSizeSettings : public BLEMIDI_NAMESPACE::DefaultSettings {
static const size_t MaxBufferSize = 16; // was 64
};
#include <hardware/BLEMIDI_ESP32_NimBLE.h>
//#include <hardware/BLEMIDI_ESP32.h>
//#include <hardware/BLEMIDI_nRF52.h>
//#include <hardware/BLEMIDI_ArduinoBLE.h>
BLEMIDI_NAMESPACE::BLEMIDI_Transport<BLEMIDI_NAMESPACE::BLEMIDI_ESP32_NimBLE, CustomBufferSizeSettings> BLEMIDI("Esp32-NimBLE-MIDI"); \
MIDI_NAMESPACE::MidiInterface<BLEMIDI_NAMESPACE::BLEMIDI_Transport<BLEMIDI_NAMESPACE::BLEMIDI_ESP32_NimBLE>, BLEMIDI_NAMESPACE::MySettings> MIDI((BLEMIDI_NAMESPACE::BLEMIDI_Transport<BLEMIDI_NAMESPACE::BLEMIDI_ESP32_NimBLE> &)BLEMIDI); I'm considering adding a |
Beta Was this translation helpful? Give feedback.
-
Hi @lathoub I have tested your example with Client hardware abstract definition of the template, but it didn't work for my case, but it compiled well. I have seen the following behavior: If I create a new config struct: If I modify directly the struct of I am not sure, because working with templates is hard, but I think that hardware definitions of the template use the Arduino-BLE-MIDI/src/BLEMIDI_Transport.h Line 26 in 8dee1f7 The definition of any of those templates use always the default value of As I have said before, I am not sure, but it may be the cause that core 1 panic'ed because "default size ( Would you check if template definitions always use 'DefaultSettings' ? Any suggestion is wellcomed. Thank you |
Beta Was this translation helpful? Give feedback.
-
Ok, that indicates that the DefaultSetting are not overwritten (or related). Let see if I can get my hands on an ESP32
nah, just a fancy replacing at compile time :-) |
Beta Was this translation helpful? Give feedback.
-
Follow the work in this branch |
Beta Was this translation helpful? Give feedback.
-
The buffer size is hardcoded here, and should be taken from the template. Already marked as a TODO (I now remember that I struggled with the templates before) - and explains the panic |
Beta Was this translation helpful? Give feedback.
-
@RobertoHE Please try with this branch for the ESP32 (NimBLE) (I don't have a device here at hand, so no guarantees) |
Beta Was this translation helpful? Give feedback.
-
Hi everyone.
I have a Roland AX-Edge device that only alow receives SysEx messages split into 2 or more packets. Because of that, if I reduce the buffer size I can send multiple packets for each SysEx correctly. I have tested that and it works fine.
I want to reduce
MaxBufferSize
to 16 but a don't want to modify it inBLEMIDI_Settings.h
lib file, I prefer to create a local setting in my code and don't edit any source file from the library.#14 (comment)
Arduino-BLE-MIDI/src/BLEMIDI_Settings.h
Lines 7 to 10 in 8dee1f7
Midi lib has an example when it uses a
struc
for override default settings, but I have tried something similar for this lib but unsuccessfully.https://github.com/FortySevenEffects/arduino_midi_library/blob/2d64cc3c2ff85bbee654a7054e36c59694d8d8e4/examples/CustomBaudRate/CustomBaudRate.ino#L3-L7
https://github.com/FortySevenEffects/arduino_midi_library/blob/2d64cc3c2ff85bbee654a7054e36c59694d8d8e4/examples/CustomBaudRate/CustomBaudRate.ino#L14-L15
Does exist any "clean way" to create custom settings in local code without modifying source lib files?
Would you provide an example, please?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions