lilypond-devel
[Top][All Lists]
Advanced

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

Re: [GLISS] non-timed or non-musical events "z" "y"


From: Jay Anderson
Subject: Re: [GLISS] non-timed or non-musical events "z" "y"
Date: Sat, 22 Sep 2012 16:58:36 -0700

On Sat, Sep 22, 2012 at 3:07 PM, Graham Percival
<address@hidden> wrote:
> I have no problem with splitting \tempo into a \tempo_bpm and
> \tempoMark command.  Or perhaps it would be better to just use
> \mark, and add markup functions which mimic the "text" parts of
> the existing \tempo command (if they don't already exist, which
> they probably do).

Please keep \mark and \tempo separate. They serve different purposes,
align differently with the music, and it's a pain to put multiple
marks in one place. I think having multiple tempo commands would be
fine if it simplified the parser (with whatever capitalization you
like):
- \tempoText "Allegro"
- \tempoBpm 4=100
- \tempoTextBpm "Allegro" 4=100
- \tempoEquation 4=2 %%% print quarter note = half note
- \tempoTextEquation "Lo stesso tempo" 4=2

Even easier: \tempoBpm can take a string instead (e.g. \tempoBpm
"4=100") which it internally parses and throws an error if it doesn't
like what it sees. At that point it could be 100% scheme instead of at
the parser level. The possible downside is we'd have a mini language
for this function, but I don't think that's too bad.

tempoBpm =
#(define-music-function (parser location text) (string?)
  (let* ((eq-index (string-contains text "="))
         (parsed (log2 (string->number (string-trim (substring text 0
eq-index)))))
         (base (make-note-by-number-markup parsed 0 1))
         (bpm (string-trim (substring text (+ 1 eq-index))))
         (markup #{ \markup { \normal-text { \smaller $base "=" $bpm } } #}))
    #{ \tempo $markup #}))

Obviously this would need to be expanded to handle errors, parse what
we currently support, and generate the midi tempo change. Would this
help clean things up with the tempo command?

-----Jay



reply via email to

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