here eventtime is sequence.getEventTime(index) and the timestamp is event->message.getTimestamp()
what is the best way to reorder the timing of a single MIDI message in a MidiMessageSequence? and to ensure the event times in the sequence match the individual message timestamps?
sure, that's of course what I'd expect. maybe I'll try and be more specific here:
how do MidiMessageSequence::getEventTime(int index) and MidiMessage::getTimeStamp() differ?
I would have thought if I change the timestamp of an event in a MidiMessageSequence that would:
first alter the timestamp of the message
second, somehow change the pointer system of the sequence - not quite sure how this would work...
maybe a simpler example, how would you go about even moving a single note on event to happen earlier in a sequence? would you call setTimeStamp() on the eventHolder->message and then do some reordering call for the sequence?
I can see from the documentation that when inserting an event into a sequence, the index will depend on the timestamp, so it sounds like by getting the timestamp right and inserting the message, it shoudl be okay.
for some reason, if I do something simple like
MidiMessageSequence emptySequence;
MidiMessage newNoteOnMessage(144,60,100,250);
emptySequence.addEvent(newNoteOnMessage);
I get a sequence with incorrect data, it has 1 event (correct) but is:
Why are you trying to modify all these events in-place in the sequence? I'd have thought it'd make a lot more sense to just build a new sequence and swap them over when you're finished..
yes, I've started looking at building a new sequence instead. hence the above question about the empty sequence.
MidiBuffer on the other hand works fine. If I create an empty MidiBuffer and an empty MidiMessageSequence then add a simple message MidiMessage(144,60,100,250) to both then buffer will display that fine i.e. note on pitch 60 etc.
but in the emptySequence I still find metadata instead (i.e. the oxFF2001 or 255,32,1) at the beginning and not the note on as added using addEvent(). Feel there's something I might be missing about initialising a message sequence in terms of MIDI metadata?