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

Re: [sc-dev] Re: [sc-users] MIDI event handler threads

Actually, I'm wrong... evidently when a MIDI event comes in, the events in the MIDIIn list get popped out. This must be happening behind the scenes because I don't see .remove in MIDIIn or MIDIEvent anywhere.

In this example, if incoming events were not cleaning up the noteOnList, there would be many MIDIEvents in the list after you play a few notes.

r = Routine({
var event;
loop {
event = MIDIIn.waitNoteOn;
[event.status, event.b, event.c].postln;

// play a few notes

[ a MIDIEvent ] // still only one

r.stop; // stop responding

[ a MIDIEvent ] // the event is still there

// play a note

[ ] // it's gone, because the routine didn't recreate the MIDIEvent

<gilda>Never mind</gilda>... :)

On Saturday, Dec 11, 2004, at 15:46 US/Eastern, James McCartney wrote:

On Dec 11, 2004, at 12:31 PM, James Harkins wrote:

While working on the MIDI helpfile, I found an issue with this: there's no clearly defined way to stop a responder. You can stop the routine, of course, but you still have the MIDIEvent in the MIDIIn classvars, so its conditions still have to be evaluated even after the routine is gone. Very untidy.

H. James Harkins /// dewdrop_world

"If attacked by a lion, thrust your arm down his throat.
This takes some practice." -- Cyril Connolly