Stacking USB midi commands

Status
Not open for further replies.

emseedee

Member
Hi, all, I'm seeking a bit of clarification on the way that the USB MIDI library works, specifically the way that MIDI input messages are handled.

My application will receive one or more Note On or Note off messages and for each one, send a 100mS on or off pulse to a solenoid.

It's possible that up to 16 messages could be received in quick succession, but for reasons of power consumption, I want to pulse no more than 2 solenoids at a time, so I need to stack up the messages and then service the stack at a slower rate.

It seems to me that USB MIDI can transmit note on/off messages at a rate of about 1 per millisecond, so do I need to make sure that I do a usbMIDI.read() at least that frequently, or is there some built-in queuing process within the MIDI library?

The alternative would be to conjure some sort of interrupt routine to fire every time there is a MIDI message, but I'm guessing that's not at all easy.

Thanks

Mike
 
Status
Not open for further replies.
Back
Top