[music-dsp] Best eval board package for audio? [quite OT]

Eddy Robinson eddy at soundart-hot.com
Wed Nov 21 05:15:02 EST 2001


Guiseppi Mendoza asked...

> Hello Anig.
>
> I hope you feel inclined to answer this one.

Sure*.

> It regards how programmable the midi IO portion of the chamelion is.
> All I need to know is can the unit be programmed to 'alter' midi in,
> and pass that to the midi out, either in real time (well, minimal
> delay),, or programmed to send streams of sequenced midi out created
> by calc's in code ?? (hope that made sense ;)

Absolutely. You have total control over the MIDI. There's a system on the
ucontroller called MIDIShare which parses MIDI input and serves it up as a
system event whenever something comes in. I've posted a small extract of
relevant code from the MIDI monitor example below, which will give you a
good idea of how things are handled (it references a few arrays etc. defined
elsewhere but should be largely self-explanatory in this context).

> I'm more interested in the midi side of it..

I am into this also, as I'm not that highly skilled in the DSP department
and I'm still at the stage of moding existing code rather than writing
stunning new algorithms. Also I have a hardware sequencer thang goin'on in
my studio and I plan on doing a lot of 'strange'things with the Chameleon
like modulating MIDI clock for strange Aphex-Twin style FX. Incidentally,
there's a sequencer built into the OS as well.

> Cheers.. I would ask to DL the Dev. Kit and see, but only have 56k.

Mail me your address privately (to mailto://eddy@soundart-hot.com) and I'll
send it to you on CD. If you can't wait, then you could use a download
manager like GetRight, which will allow you to do the transfer in chunks -
this is what I did as I only had a 56k modem when I first downloaded the
Motorola dev tools last summer.

* Stranglely when i unsubscribed Anig Browl from this list last night, the
server went ahead and removed this address at the same time and I had to
resubscribe (Douglas, do you want me to send you the Majordomo messages
about this, because I think there's a little bug in there somewhere?).
Anyway I missed messages posted between 7pm and Midnight GMT on 20/11/01. If
anyone asked me a question, you can mail it to me at the same address and
I''ll post the answer here.

Eddy

Eddy Robinson
Soundart: Talking Head
eddy at soundart-hot.com
(31) 20 468 6435

------
Code Extract

static const char* gEvNames_0_19[] =
{
		"Note","KeyOn","KeyOff","KeyPress","CtrlChange","ProgChange",
		"ChanPress","PitchWheel","SongPos","SongSel","Clock","Start",
		"Continue","Stop","Tune","ActiveSens","Reset","SysEx","Stream", "Private"
};

static const char* gEvNames_128_150[] =
{
		"Process", "DProcess", "QuarterFrame", "Ctrl14b",
		"NonRegParam", "RegParam", "SeqNum", "Text", "Copyright", "SeqName",
		"InstrName", "Lyric", "Marker", "CuePoint", "ChanPrefix", "EndTrack",
		"Tempo", "SMPTEOffset", "TimeSign", "KeySign", "Specific", "RcvAlarm",
		"ApplAlarm"
};

static Ev2StreamRec xmt;

static const char* EvName(MidiEvPtr e)
{
	if (EvType(e) < typePrivate)
		return gEvNames_0_19[EvType(e)];

	if (EvType(e) < typeProcess)
		return "Private";

	if (EvType(e) < typeReserved)
		return gEvNames_128_150[EvType(e) - typeProcess];

	return "Undefined";
}

static void display_1_event(MidiEvPtr ev)
{
	long t, hh, mn, ss, nnn;
	MidiEvPtr tmp;
	int i;
	BYTE c;

	t = Date(ev);
	nnn = t%1000; t /= 1000;
	ss = t%60; t /= 60;
	mn = t%60; t /= 60;
	hh = t%60;

	TRACE("%02ld:%02ld:%02ld.%03ld ", hh,mn,ss,nnn);
	TRACE("  %d   ", Port(ev));

	MidiStreamReset(&xmt);
	tmp = MidiStreamPutEvent(&xmt, ev);
	if (tmp)
		MidiFreeCell(tmp);

	for (i=0; i<3 ;i++)
	{
		if (MidiStreamGetByte(&xmt, &c))
			TRACE("  %02X  ", c);
		else
			TRACE("  --  ");
	}

	TRACE(" %2d  ", Chan(ev) + 1);

	if ((EvType(ev) == typeKeyOn) || (EvType(ev) == typeKeyOff))
	{
		long Note = MidiGetField(ev, 0);
		TRACE("%s%ld", gNoteNames[Note%12], (Note/12) - 1);
		if (strlen(gNoteNames[Note%12]) == 1)
			TRACE(" ");
	}
	else
		TRACE("---");

	TRACE("  %s", EvName(ev));
	TRACE("\n");
}

static void receive_alarm(short ref)
{
	rtems_event_send((rtems_id) MidiGetInfo(ref), EVENT_MIDI);
}

static rtems_task console_task(rtems_task_argument argument)
{
	MidiEvPtr		ev;
	rtems_event_set		pending;
	rtems_status_code	status;
	rtems_id		task_id;
	short			refMidi;

	TRACE("Starting console_task...\n");

	MidiStreamInit(&xmt, lTbl);

	refMidi = MidiOpen("Midi Monitor (console)");
	if (refMidi < 0)
	{
		TRACE("ERROR: cannot open MidiShare.\n");
		rtems_task_delete(RTEMS_SELF);
	}

	rtems_task_ident(RTEMS_SELF, 0, &task_id);

	MidiSetInfo(refMidi, (void *) task_id);
	MidiSetRcvAlarm(refMidi, receive_alarm);

	MidiConnect(0, refMidi, TRUE);

	TRACE("\n");
	TRACE("TIMESTAMP    PORT STATUS DATA1 DATA2 CHAN NOTE EVENT\n");

TRACE("------------------------------------------------------------------\n"
);

	while (TRUE)
	{
		status = rtems_event_receive(
			EVENT_MIDI,
			RTEMS_WAIT | RTEMS_EVENT_ANY,
			RTEMS_NO_TIMEOUT,
			&pending
		);
		if (status != RTEMS_SUCCESSFUL)
			break;

		while ((ev = MidiGetEv(refMidi)))
			display_1_event(ev);
	}

	MidiConnect(0, refMidi, FALSE);

	MidiClose(refMidi);

	TRACE("Ending console_task...\n");

	rtems_task_delete(RTEMS_SELF);
}


dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/




More information about the music-dsp mailing list