lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIDI tick resolution


From: karl
Subject: Re: MIDI tick resolution
Date: Wed, 21 Mar 2018 15:06:04 +0100 (CET)

David:
> Malte Meyn <address@hidden> writes:
> 
> > Am 19.03.2018 um 14:47 schrieb address@hidden:
> >> You could try the attached rudimentary patch and recompile your
> >> lilypond source, see if that solves your problem, and report back.
> > Would it be possible to make a patch that reads this from a context
> > property so that the user could input something like
> >
> >     \set Score.midiTickResolution = 960

(The word resolution is not suitable since the resolution of the
midi tick is 1, it is a 15 bit int.)

Yes, if someone points to directions to go from \set to variable.

The second question is in what namespace or class to have the variable.
One possibility is to have it globally, another is to have it in the
Midi_header class.

> I think it belongs in the \midi block since you cannot change it in
> mid-file.  Well, you probably can, but LilyPond is even less prepared to
> do that.

The tick value can only be set once in the midi file, in the
last 16bits of the header chunk (the first so called "chunk"
of the file). See e.g. lily/midi-chunk.cc:Midi_header::Midi_header()

My current awful patch looks like in the attachment.

BTW, it is called "division" in the midi docs, and the word tick is
about the duration of one delta-time, or to cite the std:

 If bit 15 of <division> is zero, the bits 14 thru 0 represent the number
 of delta time "ticks" which make up a quarter-note. For instance, if
 division is 96, then a time interval of an eighth-note between two
 events in the file would be 48.

Perhaps we should call the value Midi_division or something similar.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57

Attachment: tick.patch
Description: tick.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]