Midiplay???
Moderators: altitude, adafruit_support_bill, adafruit, phono, hamburgers
Please be positive and constructive with your questions and comments.
- altitude
- Posts: 995
- Joined: Wed May 11, 2005 5:17 pm
- altitude
- Posts: 995
- Joined: Wed May 11, 2005 5:17 pm
There is a midi continue command
Midi start/stop are usually applied to start at step 1, the midi continue does what the x0x does now and just picks up where it left off.
Midi start/stop are usually applied to start at step 1, the midi continue does what the x0x does now and just picks up where it left off.
Last edited by altitude on Fri Jan 13, 2006 5:45 pm, edited 1 time in total.
- the big ear
- Posts: 4
- Joined: Thu Jan 05, 2006 3:22 pm
- chairman meow
- Posts: 56
- Joined: Sat Jul 30, 2005 8:48 pm
I apologize, but my "fix" wasn't enough. I'm putting the new one through a bit more testing than previously, please try:
http://gl1tch.com/~lukewarm/x0xb0x/firm ... .beta1.hex
The problem is that in some cases, x0xb0x was chewing up running status data bytes for other channels as MIDI commands (ouch). If I find no other issues with this implementation, I'll bless it as meow19 and post a better patch here.
http://gl1tch.com/~lukewarm/x0xb0x/firm ... .beta1.hex
The problem is that in some cases, x0xb0x was chewing up running status data bytes for other channels as MIDI commands (ouch). If I find no other issues with this implementation, I'll bless it as meow19 and post a better patch here.
- chairman meow
- Posts: 56
- Joined: Sat Jul 30, 2005 8:48 pm
OK, here's a patch that I like a lot better, which I believe makes MIDI behave like it should. This patch defines a new MIDI running status, MIDI_IGNORE, to keep state and ensure we don't accidentally service data bytes for another channel or interpret the data bytes of MIDI status messages as messages of their own (which was happening previously).
Since SourceForge's anonymous CVS sucks, this is diffed againsed my own source. The only notable code is defining the new running status, setting our running_status state to it when applicable, handling it (noop) in the case statement, and removing the continue statement from the previous patch.
This is already incorporated into meow19.
Since SourceForge's anonymous CVS sucks, this is diffed againsed my own source. The only notable code is defining the new running status, setting our running_status state to it when applicable, handling it (noop) in the case statement, and removing the continue statement from the previous patch.
Code: Select all
Index: midi.c
===================================================================
--- midi.c (revision 18)
+++ midi.c (working copy)
@@ -165,19 +165,26 @@
// if its a command & either for our address or 0xF,
// set the midi_running_status
c = midi_getchar();
+
if (c >> 7) { // if the top bit is high, this is a command
if ((c >> 4 == 0xF) || // universal cmd, no addressing
((c & 0xF) == midi_in_addr)) { // matches our addr
midi_running_status = c >> 4;
} else {
// not for us, continue!
+ //putstring("MIDI ignored 0x"); putnum_uh(c); putstring("\n\r");
+ midi_running_status = MIDI_IGNORE;
continue;
}
- } else {
- continue; // no MIDI data waiting
}
-
+
switch (midi_running_status) {
+ case MIDI_IGNORE:
+ {
+ // somebody else's data, ignore
+ //putstring("Ignoring MIDI data 0x"); putnum_uh(c); putstring("\n\r");
+ break;
+ }
case MIDI_NOTE_ON:
{
if (c >> 7) // if the last byte was a command then we have to get the note
Index: midi.h
===================================================================
--- midi.h (revision 18)
+++ midi.h (working copy)
@@ -34,6 +34,7 @@
#define _MIDI_H_
// midi channel messages
+#define MIDI_IGNORE 0x0 // ignore running status
#define MIDI_NOTE_ON 0x9
#define MIDI_NOTE_OFF 0x8
#define MIDI_PITCHBEND 0xE
- chairman meow
- Posts: 56
- Joined: Sat Jul 30, 2005 8:48 pm
Please see Official Meow Firmware Thread, now with bonus user manual.Altitude wrote:So how do you copy/paste?
-
- Posts: 18
- Joined: Tue Jul 19, 2005 1:14 pm
Re: Midiplay???
The Big Ear wrote:Howdi,
Just finished nr 136;-)
Hey, that can't be right, I'VE got X0X136 !
Please be positive and constructive with your questions and comments.