third byte in MIDI message (sometimes) not correct
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ttyMIDI |
Fix Released
|
High
|
Jari Suominen |
Bug Description
I encountered a problem when playing around with a simple arduino sketch that just turns notes on and off. Sometimes the third byte of the message was not read correctly and the value of the last message was used or ttymidi just read zeros (seems to depend on baud rate).
Then I saw that when using the -p option (nothing else changed), suddenly the output was correct.
So I looked into the read_midi_
My naive conclusion would be that the Computer just can't read two bytes at once because it's to fast for the arduino, but I just started today with microcontrollers :) Is this a real bug or did I just mess it up?
If it is of any interest, I'm using:
Linux 2.6.39-1-amd64 on Debian testing
AMD Phenom II X4 920 Processor
DFRobot Arduino Clone Mega 2560
Arduino 0022 from unstable
Changed in ttymidi: | |
importance: | Undecided → High |
status: | New → Fix Committed |
assignee: | nobody → Jari Suominen (jari-tasankokaiku) |
Changed in ttymidi: | |
status: | Fix Committed → Fix Released |
Hello, I bumped to this bug four days ago and figured out same solution. Although I think your reasoning is probably not a correct one, read-function will just probably check if there is something to be read, but doesn't check if there is more than 1 in cases where you want to read more bytes.
Anyways we are releasing new version of ttymidi next week which has more changes than this, and we are still testing it out. But if you are brave, just fetch new version from the repo. But remember to update your ardumidi-library as well as the data between Arduino and ttymidi is now 'real MIDI'.