Midiplay???

Discuss x0x construction and related issues

Moderators: altitude, adafruit_support_bill, adafruit, phono, hamburgers

Please be positive and constructive with your questions and comments.
User avatar
altitude
 
Posts: 995
Joined: Wed May 11, 2005 5:17 pm

Post by altitude »

Here another thing I noticed. This is in Midi Sync mode (probably relavent here) the sequencer does not reset when toggled on the master, it just continues down the steps so when you stop/start instead of going back to step one, it just continues on from where it stopped

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Post by adafruit »

thats on purpose. it seemed like the right thing to do.

User avatar
altitude
 
Posts: 995
Joined: Wed May 11, 2005 5:17 pm

Post by altitude »

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.
Last edited by altitude on Fri Jan 13, 2006 5:45 pm, edited 1 time in total.

User avatar
the big ear
 
Posts: 4
Joined: Thu Jan 05, 2006 3:22 pm

Post by the big ear »

Excelent. I've no clue what that piece of code means, but the problem seems to be resolved ;-)

Thanks a lot!

User avatar
chairman meow
 
Posts: 56
Joined: Sat Jul 30, 2005 8:48 pm

Post by chairman meow »

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.

User avatar
chairman meow
 
Posts: 56
Joined: Sat Jul 30, 2005 8:48 pm

Post by chairman meow »

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.

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
This is already incorporated into meow19.

User avatar
altitude
 
Posts: 995
Joined: Wed May 11, 2005 5:17 pm

Post by altitude »

So how do you copy/paste?

User avatar
chairman meow
 
Posts: 56
Joined: Sat Jul 30, 2005 8:48 pm

Post by chairman meow »

Altitude wrote:So how do you copy/paste?
Please see Official Meow Firmware Thread, now with bonus user manual.

memology
 
Posts: 18
Joined: Tue Jul 19, 2005 1:14 pm

Re: Midiplay???

Post by memology »

The Big Ear wrote:Howdi,

Just finished nr 136;-)
:shock:
Hey, that can't be right, I'VE got X0X136 !

Locked
Please be positive and constructive with your questions and comments.

Return to “Making x0x”