Skip trailing silence in MIDI files
|Status:||Closed||Start date:||September 09, 2014|
using 3.4.3 on 14.04. if i need to upgrade, i'm happy to do so.
but the length of some midi songs are simply wrong. i cross-checked the time reported by Winamp, QMMP on the same Linux box.. even qtractor.. There are simply a number of songs in my midi collection that are not calculated correctly.
what to do? otherwise LOVE audacious/Fluidsynth/jack. things sound really good again.
#1 Updated by John Lindgren over 1 year ago
Please attach an example file. Does the file play correctly (tempo changes handled correctly and all that), and only the length shown in the playlist is wrong?
#2 Updated by mark ma over 1 year ago
- File cars_just_wha.mid added
file plays fine. tempo is fine. just length is 10 min, and song is 2 min long on the same machine using qmmp, on a Win machine using Win Media Player or Winamp etc..
#4 Updated by John Lindgren over 1 year ago
Rosegarden has this to say:
I'm no MIDI expert, so I wonder what the technical difference between the "formal duration" and "playing duration" is.
#5 Updated by John Lindgren over 1 year ago
- Tracker changed from Bug to Feature
- Subject changed from midi song lengths to Skip trailing silence in MIDI files
- Category set to plugins/amidi-plug
- Status changed from New to Closed
- Target version set to 3.6
- % Done changed from 0 to 100
- Affects version 3.5.1 added
Well, "playing duration" is apparently calculated based on the time of the last MIDI event in the file, and the "end marker" is the 0xff 0x2f sequence at the end of a track. By design, that end marker has a time of its own, so that MIDI playlists can have a little bit of silence between the last note of one song and the first note of the next. Your test file just happens to have a lot of silence before its end marker.
It seems wrong that the other players are ignoring that silence, but whatever is the "correct" behavior, I've added options to our MIDI plugin to skip leading and trailing silence if desired.