What is the current State of MIDI I/O?
Daniel V. Oppenheim
music at watson.ibm.com
Wed Dec 1 16:21:31 UTC 1999
--=====================_14947071==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
Following are some initial observations on MIDI I/O. I would appreciate a
pointer to more detailed information, future plans, etc. before I plunge in...
I have been looking at the MIDI I/O primitives in Squeak 2.5, on Windows
NT. It seems that there are two classes: SimpleMidiPort and MidiPrimTester.
Seems that SimpleMidiPort is intended for public use. However, it lacks
some of the primitives found in the MidiPrimTester.
For example, I copied the primMidiGetClock primitive from the
MidiPrimTester, hoping to be able to schedule events into the future.
However, the time argument in primMIDIWritePort:from:at: is relative to the
time the call is made. So at: 0 plays now, at: 500 in half a second. This
means that scheduling has to be handled entirely by Squeak (whereas I was
hoping I could get currentTime and then schedule events into the future
relative to it using a much more relaxed algorithm).
What is the buffer size for the MidiOut?
Will the output buffer sort MIDI events if they are given out of time
-sequence?
If so, will sorting be smart, so say schedule controls and note-off events
before note-on events with the same onset?
From what I could tell, Midi input seems to lack in several respects:
1. no time stamps on incoming events. This can really hinder serious
real-time interaction with Squeak. I'm not sure if one could make a MIDI
recording that maintains correct expressive timing, especially if squeak is
simultaneously working on other tasks and/or MIDI playback.
2. data comes in a byte stream, rather than already parsed into events.
Extra work on the Squeak side.
3. no notification of midi input from system into squeak (using a semaphore
for example). One must therefore implement a pooling loop when expecting input.
4. it would be nice to be able to flush the buffer. (this is picky, it can
easily be done from squeak).
Synchronized MIDI and Audio output. I'm pretty sure you can schedule wave
audio from Squeak. Can MIDI and Audio play simultaneously? Can they be
synchronized -- say if one has a score comprising both MIDI and SoundFiles
events? If so, is this ability platform specific or does it work cross
platform?
Has anyone given any thought to adopting something like MidiShare
(http://www.grame.fr/)? It is in the public domain, supported on most
platforms, and quite rich in nifty and useful features.
Thanks!
Danny Oppenheim
---
Dr. Daniel V.
Oppenheim
Computer Music Center
IBM T.J. Watson Research Center phone: (914) 945-1989
P. O. Box 218 (or Route 134) fax: (914) 945-3434
Yorktown Heights, NY 10598 www.research.ibm.com/music
--=====================_14947071==_.ALT
Content-Type: text/html; charset="us-ascii"
<html>
Following are some initial observations on MIDI I/O. I would appreciate a
pointer to more detailed information, future plans, etc. before I plunge
in...<br>
<br>
I have been looking at the MIDI I/O primitives in Squeak 2.5, on Windows
NT. It seems that there are two classes: SimpleMidiPort and
MidiPrimTester. Seems that SimpleMidiPort is intended for public use.
However, it lacks some of the primitives found in the
MidiPrimTester.<br>
<br>
For example, I copied the primMidiGetClock primitive from the
MidiPrimTester, hoping to be able to schedule events into the future.
However, the time argument in primMIDIWritePort:from:at: is relative to
the time the call is made. So at: 0 plays now, at: 500 in half a second.
This means that scheduling has to be handled entirely by Squeak (whereas
I was hoping I could get currentTime and then schedule events into the
future relative to it using a much more relaxed algorithm). <br>
<br>
What is the buffer size for the MidiOut?<br>
<br>
Will the output buffer sort MIDI events if they are given out of time
-sequence?<br>
<br>
If so, will sorting be smart, so say schedule controls and note-off
events before note-on events with the same onset?<br>
<br>
From what I could tell, Midi input seems to lack in several
respects:<br>
<br>
1. no time stamps on incoming events. This can really hinder serious
real-time interaction with Squeak. I'm not sure if one could make a MIDI
recording that maintains correct expressive timing, especially if squeak
is simultaneously working on other tasks and/or MIDI
playback.<br>
2. data comes in a byte stream, rather than already parsed into events.
Extra work on the Squeak side.<br>
3. no notification of midi input from system into squeak (using a
semaphore for example). One must therefore implement a pooling loop when
expecting input.<br>
4. it would be nice to be able to flush the buffer. (this is picky, it
can easily be done from squeak).<br>
<br>
Synchronized MIDI and Audio output. I'm pretty sure you can schedule wave
audio from Squeak. Can MIDI and Audio play simultaneously? Can they be
synchronized -- say if one has a score comprising both MIDI and
SoundFiles events? If so, is this ability platform specific or does it
work cross platform?<br>
<br>
Has anyone given any thought to adopting something like MidiShare
(<a href="http://www.grame.fr/" eudora="autourl"><font color="#0000FF"><u>http://www.grame.fr/</a></u>)</font>?
It is in the public domain, supported on most platforms, and quite rich
in nifty and useful features.<br>
<br>
Thanks!<br>
<br>
<x-tab> </x-tab>Danny
Oppenheim<br>
<br>
<br>
<br>
<div>---</div>
<br>
<div>Dr. Daniel V.
Oppenheim
</div>
<div><x-tab> </x-tab>Computer
Music Center</div>
<div><x-tab> </x-tab>IBM
T.J. Watson Research Center<x-tab> </x-tab>
phone: (914) 945-1989</div>
<div><x-tab> </x-tab>P. O.
Box 218 (or Route
134)<x-tab> </x-tab>
fax: (914) 945-3434 </div>
<div><x-tab> </x-tab>Yorktown
Heights, NY
10598<x-tab> </x-tab>
<a href="http://www.research.ibm.com/music" EUDORA=AUTOURL>www.research.ibm.com/music</a>
</div>
<br>
</html>
--=====================_14947071==_.ALT--
More information about the Squeak-dev
mailing list
|