Some midi messages are not recorded on a MIDI track?

Hello,
i am using Ardour 8 on MacOs.
I have created a MIDI track. connected on input to a virtual IAC Bus 1 et on output on a virtual IAC Bus 2:
Virtual IAC Bus 1 → Ardour MIDI track → Virtual IAC Bus 2
On input i send the List 1 of MIDI messages below. Then they appear on output as expected.
The problem i have is when i record the MIDI track and play the track after. Then on output i observe the List 2 of MIDI messages below where some messages are missing.
To help the reading, i put below (:number) on the right column related to the missing messages, where the two lists are different.

I tried many times, and this problem always appeared. How to understand it or avoid it?
Thanks,
Frédéric.

List 1 (obtained by Ardour Midi Tracer) of MIDI messages on input virtual IAC Bus 1:

803237188      Controller chn  1 0e 03
   803237316      Controller chn  1 15 00
   803237316      Controller chn  1 16 00
   803237316      Controller chn  1 17 00
   803237316      Controller chn  1 18 00
   803237316      Controller chn  1 35 00
   803237316      Controller chn  1 36 00
   803237316      Controller chn  1 37 00
   803237316      Controller chn  1 38 00
   803237316      Controller chn  1 0f 00
   803237316      Controller chn  1 23 3c
   803237316      Controller chn  1 29 01
   803237316      Controller chn  1 02 39
   803237316      Pitch Bend chn  1 00 40
   803237444          NoteOn chn  1 3c 39
   803273798      Controller chn  2 0e 03
   803273924      Controller chn  2 15 7f
   803273924      Controller chn  2 16 01
   803273924      Controller chn  2 17 00
   803273924      Controller chn  2 18 00
   803273924      Controller chn  2 35 00
   803273924      Controller chn  2 36 00
   803273924      Controller chn  2 37 00
   803273924      Controller chn  2 38 00
   803273924      Controller chn  2 0f 00
   803273924      Controller chn  2 23 43
   803273924      Controller chn  2 29 01
   803273924      Controller chn  2 02 2f
   803273924      Pitch Bend chn  2 50 40
   803274051          NoteOn chn  2 43 2f
   803313860      Controller chn  2 0e 03           :1
   803313987      Controller chn  2 0f 00           :2
   803313987      Controller chn  2 23 43
   803313987      Controller chn  2 02 00
   803314115         NoteOff chn  2 43 7f
   803334214      Controller chn  2 0e 03          :3
   803334340      Controller chn  2 15 01
   803334340      Controller chn  2 16 01
   803334340      Controller chn  2 17 7f
   803334340      Controller chn  2 18 00           :4
   803334340      Controller chn  2 35 00           :5
   803334340      Controller chn  2 36 00           :6
   803334340      Controller chn  2 37 00           :7
   803334340      Controller chn  2 38 00           :8
   803334340      Controller chn  2 0f 00            :9
   803334340      Controller chn  2 23 3f
   803334340      Controller chn  2 29 01           :10
   803334340      Controller chn  2 02 2f               
   803334340      Pitch Bend chn  2 00 45
   803334468          NoteOn chn  2 3f 2f
   803367620      Controller chn  2 0e 03         :11
   803367747      Controller chn  2 0f 00          :12
   803367747      Controller chn  2 23 3f
   803367747      Controller chn  2 02 00
   803367875         NoteOff chn  2 3f 7f
   803395780      Controller chn  2 0e 03        : 13
   803395907      Controller chn  2 15 00
   803395908      Controller chn  2 16 7f
   803395908      Controller chn  2 17 01
   803395908      Controller chn  2 18 00
   803395908      Controller chn  2 35 00
   803395908      Controller chn  2 36 00
   803395908      Controller chn  2 37 00
   803395908      Controller chn  2 38 00
   803395908      Controller chn  2 0f 00        :14
   803395908      Controller chn  2 23 45
   803395908      Controller chn  2 29 01
   803395908      Controller chn  2 02 36
   803395908      Pitch Bend chn  2 00 3b
   803396034          NoteOn chn  2 45 36
   803424965      Controller chn  2 0e 03
   803425091      Controller chn  2 0f 00
   803425091      Controller chn  2 23 45
   803425091      Controller chn  2 02 00
   803425219         NoteOff chn  2 45 7f
   803459524      Controller chn  1 0e 03
   803459651      Controller chn  1 0f 00
   803459652      Controller chn  1 23 3c
   803459652      Controller chn  1 02 00
   803459779         NoteOff chn  1 3c 7f

List 2 (obtained by Ardour Midi Tracer) of MIDI messages on output virtual IAC Bus 2 , after reading the MIDI file:

   809800898      Controller chn  1 0e 03
   809801023      Controller chn  1 02 39
   809801023      Controller chn  1 0f 00
   809801023      Controller chn  1 15 00
   809801023      Controller chn  1 16 00
   809801023      Controller chn  1 17 00
   809801023      Controller chn  1 18 00
   809801023      Controller chn  1 23 3c
   809801023      Controller chn  1 29 01
   809801023      Controller chn  1 35 00
   809801023      Controller chn  1 36 00
   809801023      Controller chn  1 37 00
   809801023      Controller chn  1 38 00
   809801023      Pitch Bend chn  1 00 40
   809801159          NoteOn chn  1 3c 39
   809837510      Controller chn  2 0e 03
   809837635      Controller chn  2 02 2f
   809837635      Controller chn  2 0f 00
   809837635      Controller chn  2 15 7f
   809837635      Controller chn  2 16 01
   809837635      Controller chn  2 17 00
   809837635      Controller chn  2 18 00
   809837635      Controller chn  2 23 43
   809837635      Controller chn  2 29 01
   809837635      Controller chn  2 35 00
   809837635      Controller chn  2 36 00
   809837635      Controller chn  2 37 00
   809837635      Controller chn  2 38 00
   809837635      Pitch Bend chn  2 50 40
   809837759          NoteOn chn  2 43 2f
   809877697      Controller chn  2 02 00
   809877697      Controller chn  2 23 43            : 1, 2 are missing
   809877823         NoteOff chn  2 43 7f
   809898048      Controller chn  2 02 2f
   809898048      Controller chn  2 15 01
   809898048      Controller chn  2 16 01
   809898048      Controller chn  2 17 7f
   809898048      Controller chn  2 23 3f
   809898048      Pitch Bend chn  2 00 45        : 3,4,5,6,7,8,9,10 are missing
   809898185          NoteOn chn  2 3f 2f
   809931460      Controller chn  2 02 00
   809931460      Controller chn  2 23 3f         : 11,12 are missing
   809931585         NoteOff chn  2 3f 7f
   809959623      Controller chn  2 02 36       : 13,14 are missing
   809959623      Controller chn  2 15 00
   809959623      Controller chn  2 16 7f
   809959623      Controller chn  2 17 01
   809959623      Controller chn  2 18 00
   809959623      Controller chn  2 23 45
   809959623      Controller chn  2 29 01
   809959623      Controller chn  2 35 00
   809959623      Controller chn  2 36 00
   809959623      Controller chn  2 37 00
   809959623      Controller chn  2 38 00
   809959623      Pitch Bend chn  2 00 3b
   809959747          NoteOn chn  2 45 36
   809988673      Controller chn  2 0e 03
   809988797      Controller chn  2 02 00
   809988797      Controller chn  2 0f 00
   809988797      Controller chn  2 23 45
   809988935         NoteOff chn  2 45 7f
   810023235      Controller chn  1 0e 03
   810023359      Controller chn  1 02 00
   810023359      Controller chn  1 0f 00
   810023359      Controller chn  1 23 3c
   810023485         NoteOff chn  1 3c 7f

Perhaps check if in the recorded MIDI file are the messages there also missing?
(GitHub - markc/midicomp: A MIDI Compiler - convert SMF MIDI files to and from plain text)

You also seem to be sending A LOT of MIDI messages with the same timestamp [1].
And run Ardour apparently at 128 samples / cycle. Perhaps there are dropouts at this low buffersize?

[1] PS. Keep in mind that physical MIDI is only 32kbaud. So a single CC messages take about 1ms to transmit. It should not directly matter inside virtual busses, but will matter if you plan to send those messages elsewhere.

Thanks for your reply and comments.

Here is the file.mid of the track translated by midicomp that shows that this midi file coincides with the List 2 above where few midi messages are missing.
There are additional “Sequencer Specific midi messages” like:
23500 SeqSpec 99 01 95 dc 24

I also tried to use Ardour with 512 samples / cycle (10.7 ms buffer), but the problem is the same.

Rem: I am using these few additional CC messages prior to ‘note On’ and ‘Note off’ to put informations related to the musical system that i am using. They should be ignored by a standard synthetizer.

Do you have some idea or advice how i can resolve my problem of missing messages please? (i would like to record and re-play all the midi messages).

I could put more time distance dt between messages? dt > 5ms ? it seems long if i have many CC messages associated to one ‘note on’. Also this may be not the origin of the problem here, since i am using virtual busses internal to a performant Mac Pro.

Using Sysex instead? but then i am afraid that they could be not recorded.

Put less messages with the same timestamp?

Frederic.

Midi file


MFile 0 1 19200
MTrk
23400 Par ch=1 c=14 v=3
23500 Par ch=1 c=2 v=57
23500 Par ch=1 c=15 v=0
23500 Par ch=1 c=21 v=0
23500 Par ch=1 c=22 v=0
23500 Par ch=1 c=23 v=0
23500 Par ch=1 c=24 v=0
23500 Par ch=1 c=35 v=60
23500 Par ch=1 c=41 v=1
23500 Par ch=1 c=53 v=0
23500 Par ch=1 c=54 v=0
23500 Par ch=1 c=55 v=0
23500 Par ch=1 c=56 v=0
23500 Pb ch=1 v=8192
23500 SeqSpec 99 01 95 dc 24
23610 On ch=1 n=60 v=57
52690 Par ch=2 c=14 v=3
52790 Par ch=2 c=2 v=47
52790 Par ch=2 c=15 v=0
52790 Par ch=2 c=21 v=127
52790 Par ch=2 c=22 v=1
52790 Par ch=2 c=23 v=0
52790 Par ch=2 c=24 v=0
52790 Par ch=2 c=35 v=67
52790 Par ch=2 c=41 v=1
52790 Par ch=2 c=53 v=0
52790 Par ch=2 c=54 v=0
52790 Par ch=2 c=55 v=0
52790 Par ch=2 c=56 v=0
52790 Pb ch=2 v=8272
52790 SeqSpec 99 01 95 dc 33
52890 On ch=2 n=67 v=47
84840 Par ch=2 c=2 v=0
84840 Par ch=2 c=35 v=67				:1,2, missing
84840 SeqSpec 99 01 95 dc 36
84940 Off ch=2 n=67 v=127
101120 Par ch=2 c=2 v=47
101120 Par ch=2 c=21 v=1
101120 Par ch=2 c=22 v=1
101120 Par ch=2 c=23 v=127
101120 Par ch=2 c=35 v=63
101120 Pb ch=2 v=8832			: 3,4,5,6,7,8,9,10 are missing
101120 SeqSpec 99 01 95 dc 3d
101230 On ch=2 n=63 v=47
127850 Par ch=2 c=2 v=0
127850 Par ch=2 c=35 v=63		: 11,12 are missing
127850 SeqSpec 99 01 95 dc 40
127950 Off ch=2 n=63 v=127
150380 Par ch=2 c=2 v=54		: 13,14 are missing
150380 Par ch=2 c=21 v=0
150380 Par ch=2 c=22 v=127
150380 Par ch=2 c=23 v=1
150380 Par ch=2 c=24 v=0
150380 Par ch=2 c=35 v=69
150380 Par ch=2 c=41 v=1
150380 Par ch=2 c=53 v=0
150380 Par ch=2 c=54 v=0
150380 Par ch=2 c=55 v=0
150380 Par ch=2 c=56 v=0
150380 Pb ch=2 v=7552
150380 SeqSpec 99 01 95 dc 4d
150480 On ch=2 n=69 v=54
173620 Par ch=2 c=14 v=3
173720 Par ch=2 c=2 v=0
173720 Par ch=2 c=15 v=0
173720 Par ch=2 c=35 v=69
173720 SeqSpec 99 01 95 dc 52
173830 Off ch=2 n=69 v=127
201270 Par ch=1 c=14 v=3
201370 Par ch=1 c=2 v=0
201370 Par ch=1 c=15 v=0
201370 Par ch=1 c=35 v=60
201370 SeqSpec 99 01 95 dc 57
201470 Off ch=1 n=60 v=127
201470 Meta TrkEnd
TrkEnd

Looking at the lists above, I have realized that Ardour does not record a new CC message if the value is unchanged, it ignore the message instead. Is it correct?
I didn’t expected this, and this is not compatible with the use i have of the midi messages in my project. But i will adapt my strategy to this situation.