Question

I'm use BASS_MIDI in iPhone development. I create midiStream from file like this

midiStream = BASS_MIDI_StreamCreateFile(false, filePath, 0, 0, 0, 44100);

Then i play/position/pause it, changing volume and tempo. I change tempo(for playback speed control) before playing like this

BASS_MIDI_StreamEvent(midiStream, 0, MIDI_EVENT_TEMPO, currentTempo);//microseconds per quarter note
BASS_ChannelPlay(midiStream, false);

It works good, but i have one problem. If position of midistream is 0, then tempo not changed(volume, and another BASS_MIDI_StreamEvent's don't works too). If change call order like this

BASS_ChannelPlay(midiStream, false);
BASS_MIDI_StreamEvent(midiStream, 0, MIDI_EVENT_TEMPO, currentTempo);//microseconds per quarter note

then i have some lag(playback starts with incorrect speed and it change after a half of second, or less. How can i fix it? Is there a way to call events before playing in zero position?

P.S. Sorry for bad English.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top