Thanks @tomto66 for the sample. If I understood it correctly, everything that effects the midi output has to happen in the processBlock() method. This method is called repeatedly by the framework.
What I do not understand is: Everything that happens in that method is let’s say executed 50 times per second. This also means that the midiMessage buffer is written 50 times a second, collecting the data from my data structure (a MidiMessageSequence that contains the file content). But how does it work to play the midi notes smoothly in time?
Is the calculated result of the first execution of processBlock() passed to another thread that takes care to “perform” the midi data and ignores new input from processBlock() while running?
If this is the case, why does it not take the data again from processBlock() that is produced 50 times a second once it has finished?