1 %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
2 %% This file is in the public domain.
6 lsrtags = "rhythms, text"
9 This function allows you to change the tempo and specify text
10 directions at the same time, using one single command.It takes three
11 arguments: the text to be printed (the string has to be introduced with
12 a # character), the duration (it has to be specified as a text string,
13 between double quotes and with a #), and the metronome tempo (as a
14 number). This way, the given tempo will be taken into account in MIDI
15 output, but the normal @code{\\tempo} command will remain unaffected.
18 doctitle = "Integrating text indications in metronome marks"
20 #(define ((make-format-movement-markup-function text) duration count context)
21 (markup #:huge #:bold text #:hspace 1
23 #:general-align Y DOWN #:smaller
24 #:note-by-number (ly:duration-log duration)
25 (ly:duration-dot-count duration)
28 (number->string count)
32 #(define (string->duration duration-string)
33 "Parse the `duration-string', e.g. ''4..'' or ''breve.'', and return a duration object."
34 (let* ((length (string-length duration-string))
35 (dot-index (or (string-index duration-string #\.) length))
36 (len (substring duration-string 0 dot-index))
37 (dots (- length dot-index)))
38 (ly:make-duration (cond ((string=? len "breve") -1)
39 ((string=? len "longa") -2)
40 ((string=? len "maxima") -3)
41 (else (log2 (string->number len))))
45 #(define-music-function (parser location text duration count music)
47 (string? string? integer? ly:music?)
49 \set Score.metronomeMarkFormatter = #(make-format-movement-markup-function $text)
50 \set Score.tempoWholesPerMinute = #$(ly:moment-mul (ly:make-moment count 1)
52 (string->duration duration)))
53 \set Score.tempoUnitDuration = #$(string->duration duration)
54 \set Score.tempoUnitCount = #$count
56 \set Score.metronomeMarkFormatter = #format-metronome-markup
59 \layout { ragged-right = ##f }
63 \movement "Allegro" "2." #96
66 \movement "Moderato" "4" #104