Re: MIDI, rests and end-of-track

2019-10-22 Thread David Wright
On Tue 22 Oct 2019 at 18:08:02 (+0200), Malte Meyn wrote:
> Am 22.10.19 um 17:06 schrieb Cam:
> > \version "2.18.2"
> > 
> > […]
> > 
> > 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.
> > 
> > […]
> > 
> > Is this a bug, a feature or just me not understanding something?
> 
> It is a bug that was fixed in more recent versions. Although it is
> called “unstable” it is safe to install 2.19.83; it’s a pretty stable
> pre-release for the next stable 2.20.0.

That fixes things for software that honours the end-of-track
indication (eg audacious), but not for software which doesn't
(eg timidity). In the case of timidity, it's only since 2.14.0
that it even honours *opening* silence rather than seeking to
the first note, which would compromise playing files simultaneously.
Is there a quick and easy fix for adding closing silence that
has to be "played"?

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: MIDI, rests and end-of-track

2019-10-22 Thread Malte Meyn

Hi Cam,

please start a new thread for a new topic. (You replied to a thread 
about double clefs. You changed the subject but the information that 
it’s a reply to that thread is still there so it will be shown as part 
of that thread.)


Am 22.10.19 um 17:06 schrieb Cam:

\version "2.18.2"

[…]

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.


[…]

Is this a bug, a feature or just me not understanding something?


It is a bug that was fixed in more recent versions. Although it is 
called “unstable” it is safe to install 2.19.83; it’s a pretty stable 
pre-release for the next stable 2.20.0.


HTH,
Malte

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


MIDI, rests and end-of-track

2019-10-22 Thread Cam

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=`100
  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

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user