Does Ardour respect timestamp ordering?

Hello,
i am using Ardour8 on MacOs.
On a Midi Track, the input is a Virtual Midi port IAC Bus 1 and the output is an other Virtual Midi port IAC Bus 2.
In summary:
Port IAC Bus 1 —> Midi Track of Ardour —> port IAC Bus 2.

I am using Midi Monitor to look at the midi messages on each port.
What i observe and this is a problem for my project is that the ordering of midi messages has been changed: here is below some messages from Midi Monitor, where the first column is the time. Timestamp is different on IAC Bus1 for each message in order to impose some time ordering, but curiously, these timestamps have been put the same on output IAC Bus 2.
In particular, the problem i would like to solve is that the message Pitch Wheel has been put at a different place, i would like to keep “Note On” at the end.

List:

1741953358522 From Gestionnaire IAC Bus 1 Control 1 Controller 35 60
1741953358523 From Gestionnaire IAC Bus 1 Control 1 Controller 41 1
1741953358525 From Gestionnaire IAC Bus 1 Pitch Wheel 1 0
1741953358527 From Gestionnaire IAC Bus 1 Control 1 Breath Control (coarse) 57
1741953358528 From Gestionnaire IAC Bus 1 Note On 1 C3 57

1741953422233 From Gestionnaire IAC Bus 2 Control 1 Controller 35 60
1741953422233 From Gestionnaire IAC Bus 2 Control 1 Controller 41 1
1741953422233 From Gestionnaire IAC Bus 2 Control 1 Breath Control (coarse) 57
1741953422233 From Gestionnaire IAC Bus 2 Note On 1 C3 57
1741953422233 From Gestionnaire IAC Bus 2 Pitch Wheel 1 0

Do you understand ? is there a way to ask ardour to respect the ordering? May be by increasing the delay between messages in IAC Bus 1?
Thanks,
Frederic.

The issue here is that for some reason the different events all get scheduled to be at the same time on output. We have our own internal rules for how to order events that are at the same time, based on the type. The ordering is:

Controller messages
Program Change
Note Off
Note On
Note Pressure
Channel Pressure
Pitch Bend

So the issue is not this ordering, but the question of why for output they are all scheduled at the same time. I currently don’t have an answer for that.

Can you compare this to timestamps in Ardour’s Window > MIDI Tracer?

PS. Apple CoreMIDI default timestamps are nanoseconds. In Arodur internally MIDI events are timestamped using sample-time e.g. using a sample-rate of 48kHz, the granularity is 20833 ns per sample. That may explain what you’re seeing.

Hello,
thanks for your answers.
Now, I understand that the problem does not come with Ardour (that works well as you explain), but with the software i wrote in C++ using JUCE to generate this list of MIDI messages at the input.
I was thinking that the messages are time-shifted with different TimeStamps , but the log messages above show that they are time-shifted by only few nanoseconds that is not related to TimeStamps i tried to impose.
So i need now to understand how to resolve this problem with my program and JUCE, why the TimeStamps have not been effective?

Thanks again!
best wishes,
Frédéric.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.