arduino_midi_library: Errors trying to override Max SysEx message length
Hi,
I’m trying to override the Sysex Max length locally in my sketch as advised ( https://github.com/FortySevenEffects/arduino_midi_library/wiki/Using-custom-Settings ) by adding the following code after #include <MIDI.h>:
Struct MySettings : public midi::DefaultSettings
{ static const unsigned SysExMaxSize = 1024; // Accept SysEx messages up to 1024 bytes long. };
// Create a 'MIDI' object using MySettings bound to Serial1.
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial1, MIDI, MySettings);
But I get the following errors:
**_C:\Users\Medion\Documents\Arduino_Sketches_TEENSY_36_MFC\Midi_to_AXEFX_Teensy-36_rev62\Midi_to_AXEFX_Teensy-36_rev62.ino:14:30: error: ‘midi’ has not been declared
struct MySettings : public midi::DefaultSettings
C:\Users\Medion\Documents\Arduino_Sketches_TEENSY_36_MFC\Midi_to_AXEFX_Teensy-36_rev62\Midi_to_AXEFX_Teensy-36_rev62.ino:14:36: error: expected ‘{’ before ‘DefaultSettings’
struct MySettings : public midi::DefaultSettings
C:\Users\Medion\Documents\Arduino_Sketches_TEENSY_36_MFC\Midi_to_AXEFX_Teensy-36_rev62\Midi_to_AXEFX_Teensy-36_rev62.ino:15:1: error: invalid type in declaration before ‘{’ token
{
C:\Users\Medion\Documents\Arduino_Sketches_TEENSY_36_MFC\Midi_to_AXEFX_Teensy-36_rev62\Midi_to_AXEFX_Teensy-36_rev62.ino:16:5: error: expected primary-expression before ‘static’
static const unsigned SysExMaxSize = 1024; // Accept SysEx messages up to 1024 bytes long.
C:\Users\Medion\Documents\Arduino_Sketches_TEENSY_36_MFC\Midi_to_AXEFX_Teensy-36_rev62\Midi_to_AXEFX_Teensy-36_rev62.ino:16:5: error: expected ‘}’ before ‘static’
C:\Users\Medion\Documents\Arduino_Sketches_TEENSY_36_MFC\Midi_to_AXEFX_Teensy-36_rev62\Midi_to_AXEFX_Teensy-36_rev62.ino:16:5: error: expected ‘,’ or ‘;’ before ‘static’
C:\Users\Medion\Documents\Arduino_Sketches_TEENSY_36_MFC\Midi_to_AXEFX_Teensy-36_rev62\Midi_to_AXEFX_Teensy-36_rev62.ino:18:1: error: expected declaration before ‘}’ token
};_**
Fairly new to this so would appreciate any help pls.
I should add - Im using a Teensy 3.6 & programming my sketch with the Arduino IDE.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 28 (12 by maintainers)
OK thanks very much - all is now working in my original sketch. (Midi_to_AXEFX_Teensy-36_rev62\Midi_to_AXEFX_Teensy-36_rev62.ino). Although I did have to make a further change to my code to accomodate the new Library (the type of arraySize):
From:
void HandleSystemExclusive(byte *SysExArray, byte arraySize)
To:void HandleSystemExclusive(byte *SysExArray, unsigned arraySize)
All complie errors are gone & I can now overide SysExMaxSize (my original issue).
Looks like it was down to having muliple versions of the Midi library on my PC and my sketch kept picking up the old one.
[and yes issue #67 is now also resolved]
Thanks for all you help on this one.