[PD] MIDI Recorder?

Piotr Majdak piotr at majdak.com
Fri Oct 14 08:43:23 CEST 2005


Hi Ryan,

Ryan Supak wrote:

> Hi PeeDee List, here's what I'm trying to accomplish:
> 
> 1) Record a MIDI stream of a non-predetermined length
> 2) 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
> 
> 1) 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.

> 2) 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


-- 
Piotr Majdak
Institut für Schallforschung
Österreichische Akademie der Wissenschaften
Reichsratsstr. 17
A-1010 Wien
Tel.: +43-1-4277-29511
Fax: +43-1-4277-9296
E-Mail: piotr at majdak.com
WWW: http://www.kfs.oeaw.ac.at






More information about the Pd-list mailing list