Hi Ryan,
Ryan Supak wrote:
Hi PeeDee List, here's what I'm trying to accomplish:
- Record a MIDI stream of a non-predetermined length
- Play said MIDI stream back on-the-fly
At first I thought I could do this with a few Tabwrites and Tabplays in parallel, but
- then I thought "What if, say, CC25 and CC35 are coming in at the same
time? Would it get confused, or does MIDI do some kind of "staggering" where exactly one MIDI message is coming in at a time?
I'm don't have much experience with MIDI-devices, but in theory, one MIDI stream is always a serial stream, which means that you receive one command after another one (with appr. 31kBaud). I don't think your commands can get staggered.
- to create a variable-sized buffer with Tabwrite, it seems like I
would basically have to increase the size of the table by 1 at the MIDI control rate (500 Hz or whatever it is). I was concerned that this might lead to glitches.
Can you estimate a maximal length you need? You can get max. 5000 commands per second per stream with MIDI. Thus, thinking in terms of audio it's rather low rate - it's not a problem to allocate a table with length of, say, 500,000 at the begin of recording - which gives you a range up to 100 seconds.
br,
Piotr