Varying MIDI playback speed?


#1

Any ideas here? Is the simplest thing to adjust the timing of each and every message in the sequence? I'm after a 'slow-down' effect so the note durations get shortened/lengthened as the tempo speeds/slows. 

 

Thanks.


#2

Well yes, slowing things down is just a case of changing the timings of the events. Not sure what other info you're looking for?


#3

https://github.com/julianstorer/JUCE/blob/master/modules/juce_audio_basics/midi/juce_MidiMessage.h

look for Meta Tempo events to insert into the MidiSequence object. 


#4

I was also looking at MidiMessageSequence.addTimeToMessages(). Slightly unclear as to the meaning of deltaTime argument. Does addTimeToMessages(2.0) effectively halve the tempo?


#5

No, it doesn't. As the documentation for MidiMessageSequence.addTimeToMessages() says, it just adds an offset to the messages' timestamp.


#6

No.. like the name suggests, that would add 2.0, not multiply it by 2.0!

But you can iterate all the message objects and perform whatever operation you want directly on their timestamp values.


#7

Yes, of course. I will have to take some more modinafil before proceeding! Thanks again.