Importing a MIDI file and its endpoint

Hi all,

a midi file (120 BPM) corresponds to these notes:
a

When I import this into Ardour, I would expect to see the midi region end right after the eighth rest. Instead the region is extended to the entire bar:
b

Is it inevitable?

[Ardour 8.1 on Linux]
Thank you,
a.

MIDI files have an end-marker, and older versions of Ardour use that as-is.
You can check with a midi-to-text tool e.g. GitHub - markc/midicomp: A MIDI Compiler - convert SMF MIDI files to and from plain text

How did you create that .mid file? perhaps due to 4/4 the TrkEnd was placed at the end of the bar?

Only very recently (Ardour/git, upcoming Ardour 9) Ardour expands MIDI files up to the next bar by popular request (loop patterns). I don’t know the details about that though. ben and @paul were in charge of that part.

0, 0, Header, 1, 1, 480
1, 0, Start_track
1, 0, Tempo, 500000
1, 0, Note_on_c, 0, 65, 64
1, 240, Note_off_c, 0, 65, 64
1, 240, Note_on_c, 0, 67, 64
1, 480, Note_off_c, 0, 67, 64
1, 720, Note_off_c, 0, 0, 0
1, 720, End_track
0, 0, End_of_file

Interesting… so here the “rest” is notated as single note-off event, and yeah it correct ends at 2 and after the 1/8 note rest.

The Header says 480 ticks per quarter note: and the track ends at 720.

As for why Ardour extends it, you’ll have to wait for the resident Ardour MIDI expert. I would have to read the relevant source code to answer it.

PS. Is this really Ardour 8.1 (and not 8.12)?

Ardour 8.1.0
“The Drop”
(rev 8.1)
Intel 64-bit - debug