Hallo everybody,
I try to stream a Midifile via Yun-Bridge. I used the following code for test purpose:
boolean readData() {
char dat[]="/mnt/sd/test01.mid";
File myfile = FileSystem.open(dat, FILE_READ);
byte data=myfile.read();
if (data !='M'){ //Test ob Mididatei
return false;
}
myfile.seek(12);//Dateizeiger auf Wert für Deltawert 4tel Note
delta4= myfile.read();
delta4=(delta4 << 8)+myfile.read();
myfile.seek(23); //Dateizeiger auf erstes Midikomando
if (myfile){
while (myfile.available()>0){
byte data=myfile.read();
Serial.write(data);
}
myfile.close(); // close the file
}
return true;
}
The problem is, that sometimes bytes are getting lost. I attached two pictures, the first one shows the original Hex-dump of the midi-file and the second one the data I received on the 32U4 side. I marked the lost byte (0x96).
If I use other files I have the same problem. Random bytes getting lost.
Yun is updated on 1.4.
Thank you for ideas...