Teensy 3.2 MIDI SysEx size over 255 bytes

Status
Not open for further replies.
Hello everybody,

I connected my Teensy 3.2 with a Blofeld Synthesizer to recieve and send MIDI messages.

I can send and recieve ControlChange data and I'm able to recieve small SysEx data from the synth. But I want to recieve a sound dump from my synthesizer which is 256 bytes long, so the SysEx-Array has to be that log as well and I changed
Code:
#define MIDI_SYSEX_ARRAY_SIZE 255   // Maximum size is 65535 bytes.
to 256 in the MIDI.h library.

But now the Teensy stops operating, as soon as my synth sends any kind of SysEx data.
I don't even have to implement any actions on recieving SysEx data to make this error appear.

Is there something else that I have to chance besides the adjustment of the MIDI_SYSEX_ARRAY_SIZE?

My code:
Code:
#include <MIDI.h>

const int channel = 1;
int cc;
int val;

void setup()
{                
  Serial.begin(38400);
  Serial1.begin(31250);
  MIDI.begin();
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);
}

void loop()                     
{
  if (MIDI.read()) {
  byte type = MIDI.getType();
  switch (type) {
     case ControlChange:
        cc = MIDI.getData1();
        val = MIDI.getData2();
        Serial.print("CC: ");
        Serial.print(cc);
        Serial.print(" Value: ");
        Serial.println(val);
        break;
        }
  }
}

Sorry for my english, I'm not a native speaker..
 
In midi.cpp this piece of code:
Code:
					case 0xF7:
						if (getTypeFromStatusByte(mPendingMessage[0]) == SystemExclusive) {
							
							// Store System Exclusive array in midimsg structure
							for (byte i=0;i<MIDI_SYSEX_ARRAY_SIZE;i++) {
won't handle more than 255 bytes correctly. Change the for statement to:
Code:
							for (unsigned int i=0;i<MIDI_SYSEX_ARRAY_SIZE;i++) {
and give it another try.

Pete
 
Status
Not open for further replies.
Back
Top