[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] MIDI sysex



Hi there,

I think the way to do this is to pass the MIDI packet from the MIDI
handler to the language, assemble complete packets and then pass them to the
appropriate handler using the OSCresponder style.

(You would probably use the manufacturer ID as the selector, but this is
either a single byte or three bytes.  That is part of the reason for using
a path responder approach.)  I'll try to hack something together over the
weekend and post it.

In the meantime, here is some C code that uses the (as far as I can tell
unused) default MIDI action to receive MIDI packets as Int8Array's.  The
MIDI command is replaced with two bytes providing the high and low nibbles
of the command byte, so the maximum size of the array is 257..
I do not have a ready source of sysex, so I am testing this by just
placing it after the case statement in the MIDI input handler (so it
receives all MIDI commands). It could just as easily be used for the 0xF0
case alone.


        PyrInt8Array* obj = newPyrInt8Array(g->gc, pkt->length + 1, 0, true);
        obj->b[0] = status;
        obj->b[1] = chan;
        memcpy(obj->b+ 2, pkt->data + 1, pkt->length - 1);
        obj->size = pkt->length + 1;
        ++g->sp; SetObject(g->sp, s_midiin->u.classobj); // Set the class MIDIIn
        ++g->sp; SetInt(g->sp,  uid); //src
        ++g->sp; SetObject(g->sp, (PyrObject*)obj);
        runInterpreter(g, s_domidiaction, 3 );


RJK

On Wed, 10 Dec 2003, James Harkins wrote:

> I'm interested in dumps. I'm not using external noisemakers at this
> point, just a silent midi controller.
>
> James
>
> On Wednesday, Dec 10, 2003, at 23:15 US/Eastern, Tim Kreger wrote:
>
> > Hi James
> >
> > What sort functionality were you thinking of  ? Do you want real-time
> > control of devices via sysex or just a basic dump, the former would be
> > a
> > little more difficult.
> >
> > Another issue is how and where should sysex dumps should be stored for
> > later use.
> >
> >
> > Cheers.
> >
> >
> > Tim
> >
> >
> >
> > -----Original Message-----
> > From: sc-dev-bounces@xxxxxxxxxxxxxxx
> > [mailto:sc-dev-bounces@xxxxxxxxxxxxxxx] On Behalf Of James Harkins
> > Sent: Thursday, December 11, 2003 2:31 PM
> > To: SuperCollider developers list
> > Subject: Re: [sc-dev] MIDI sysex
> >
> > On Wednesday, Dec 10, 2003, at 19:54 US/Eastern, Tim Kreger wrote:
> >
> >> All in all I think sysex implementation will be a reasobly major
> >> addition to SC3.
> >
> > That's a fair assessment. I was just expressing it as a wish-list kind
> > of thing.
> >
> > James
> > ____________________________________
> >
> > H. James Harkins /// dewdrop_world
> > http://www.duke.edu/~jharkins
> >
> > "If attacked by a lion, thrust your arm down his throat.
> > This takes some practice."  -- Cyril Connolly
> >
> > _______________________________________________
> > sc-dev mailing list
> > sc-dev@xxxxxxxxxxxxxxx
> > http://www.create.ucsb.edu/mailman/listinfo/sc-dev
> >
> >
> > _______________________________________________
> > sc-dev mailing list
> > sc-dev@xxxxxxxxxxxxxxx
> > http://www.create.ucsb.edu/mailman/listinfo/sc-dev
> >
> >
> ____________________________________
>
> H. James Harkins /// dewdrop_world
> http://www.duke.edu/~jharkins
>
> "If attacked by a lion, thrust your arm down his throat.
> This takes some practice."  -- Cyril Connolly
>
> _______________________________________________
> sc-dev mailing list
> sc-dev@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-dev
>