[jmsl] External Midi Device Time Stamp

jmsl at music.columbia.edu jmsl at music.columbia.edu
Wed Apr 15 15:08:46 EDT 2009


It seems like time stamp of midi message for JavaSound is bit different. It 
sounds like it works only if you send it very close to the right time. Like 
you said, Sequencer seems to be the right way to go. Anyways, it says:
As mentioned in Chapter 10, the program can include a time stamp with each 
MIDI message it sends to the device's receiver. However, such time stamps 
are used only for fine-tuning the timing, to correct for processing latency. 
The caller can't generally set arbitrary time stamps; the time value passed 
to Receiver.send must be close to the present time, or the receiving device 
might not be able to schedule the message correctly. This means that if an 
application program wanted to create a queue of MIDI messages for an entire 
piece of music ahead of time (instead of creating each message in response 
to a real-time event), it would have to be very careful to schedule each 
invocation of Receiver.send for nearly the right time.

Fortunately, most application programs don't have to be concerned with such 
scheduling. Instead of invoking Receiver.send itself, a program can use a 
Sequencer object to manage the queue of MIDI messages for it. The sequencer 
takes care of scheduling and sending the messages-in other words, playing 
the music with the correct timing. Generally, it's advantageous to use a 
sequencer whenever you need to convert a non-real-time series of MIDI 
messages to a real-time series (as in playback), or vice versa (as in 
recording). Sequencers are most commonly used for playing data from MIDI 
files and for recording data from a MIDI input port.



Chi



More information about the jmsl mailing list