[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MIDI, rests and end-of-track
From: |
Cam |
Subject: |
MIDI, rests and end-of-track |
Date: |
Tue, 22 Oct 2019 12:06:59 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
I'm a new lilypond user. The following, hopefully small enough, lilypond source:
\version "2.18.2"
\header { }
\language "english"
\score {
{
\clef "treble"
\time 4/4
\relative c' {
c2 d8 e8 r4
}
}
\layout { }
\midi { }
}
generates MIDI as follows. In this midi dump, numbers preceded by a
reverse-quote are decimal, all other numbers are hexadecimal.
Midi file object
Chunk `0:
MThd Midi Header Chunk
Format=`1
Ntrks=`2
Division=`384
Chunk `1:
MTrk Midi Track Chunk
Tick= `0, Status=FF, Meta. Sequence/track name. Text="control track"
Tick= `0, Status=FF, Meta. Text event. Text="creator: "
Tick= `0, Status=FF, Meta. Text event. Text="GNU LilyPond 2.18.2 "
Tick= `0, Status=FF, Meta. Time signature. Values=`4 `2 `18 `8
Tick= `0, Status=FF, Meta. Set tempo. Value=`1000000
Tick= `0, Status=FF, Meta. End of track.
Chunk `2:
MTrk Midi Track Chunk
Tick= `0, Status=B0, Control change. Controller=07, Value=64
Tick= `0, Status=90, Note-on. Key=3C, Velocity=5A
Tick= `768, Status=90, Note-on. Key=3C, Velocity=00
Tick= `0, Status=90, Note-on. Key=3E, Velocity=5A
Tick= `192, Status=90, Note-on. Key=3E, Velocity=00
Tick= `0, Status=90, Note-on. Key=40, Velocity=5A
Tick= `192, Status=90, Note-on. Key=40, Velocity=00
Tick= `0, Status=FF, Meta. End of track.
My concern is that the track chunk which contains the actual notes is shown as
ending immediately after the e8 note. You can tell it ends there because the
end-of-track meta-event has a MIDI tick of zero, showing that it happens as
soon as the e8 is over. To my mind the end-of-track event should have had a
tick of 384 indicating that it ended after the r4 quarter note rest.
This isn't a problem if you just want to play this one bar, but if you later
want to loop or concatenate then it is a problem.
I've look at all the lilypond MIDI documentation I could find without seeing
anything relevant.
Is this a bug, a feature or just me not understanding something?
Thanks
Cam Farnell
Halifax, Canada