[SDL] More MIDI woes

David Olofson david at olofson.net
Sun Feb 10 01:20:34 PST 2008


On Sunday 10 February 2008, Mason Wheeler wrote:
[...]
> The attached file, for example, takes approximately 1300
> milliseconds from the method call to when I start hearing music.
[...]

Well... That particular file simply doesn't have any note events until 
right before the end of the first bar. :-)

One often does that for various reasons. Some synths do stupid things 
for a moment after a program change (Roland JV-1080 springs to mind), 
and it's rather awkward to set up a "count in" shorter than one bar 
in some sequencers.


Simple fix: Adjust the MIDI files.

You should probably *not* attempt to "time shift" the whole song, 
unless you know your sequencer well, as you need to include any tempo 
changes and other "special" events in the shift. Safest way is to 
change the first bar to 1/4, 1/8 or something. Some sequencers are 
too stupid to move the events following the shortened bar, but it's 
usually doable one way or another. Another trick is to switch to 
maximum tempo for the part you want to "skip", but this is usually 
severely limited by the maximum tempo allowed by the sequencer.


Sophisticated fix: Hack the player to "fast forward" to the first 
audible event when started.

Note that this isn't totally safe when dealing with hardware synths. 
You may well find that any notes in the first few tens or hundreds of 
ms will be delayed or even dropped entirely.


//David Olofson - Programmer, Composer, Open Source Advocate

.-------  http://olofson.net - Games, SDL examples  -------.
|        http://zeespace.net - 2.5D rendering engine       |
|       http://audiality.org - Music/audio engine          |
|     http://eel.olofson.net - Real time scripting         |
'--  http://www.reologica.se - Rheology instrumentation  --'


More information about the SDL mailing list