Varying MIDI playback speed?

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.

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?

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. 

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

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

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.

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