Metronome marks with more options: Difference between revisions

m New category
Tags: Mobile edit Mobile web edit
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
This snippet also changes the size of metronome marks:
This snippet also changes the size of metronome marks:


* the text (e.g., '''Allegro''') is a bit larger than the default of Lilypond.
* the text (e.g., '''Allegro''') is a bit larger than the default of LilyPond.
* the note (e.g., ♪) is a bit smaller than the default of Lilypond.
* the note (e.g., ♪) is a bit smaller than the default of LilyPond.


'''IMPORTANT:'''
'''IMPORTANT:'''


This snippet is based on a snippet by Arnold Theresius. The original snippet create a formatter called <code>format-metronome-markup-approx</code>, and the default value to <code>tempoEquationText</code> in that snippet is &quot;≈&quot;. I changed back this default to Lilypond default, and added the <code>tempoBetweenText</code> property. Also, I changed the sizing of some elements, as described above.
This snippet is based on a snippet by Arnold Theresius. The original snippet create a formatter called <code>format-metronome-markup-approx</code>, and the default value to <code>tempoEquationText</code> in that snippet is &quot;≈&quot;. I changed back this default to LilyPond default, and added the <code>tempoBetweenText</code> property. Also, I changed the sizing of some elements, as described above.


'''[http://lsr.di.unimi.it/LSR/Item?id=869 Original snippet by Arnold Theresius]'''
Arnold's original code is available in snippet [[Tempo (metronome) marks with approximation sign]].


<lilypond version="2.24" full>
<lilypond version="2.24">
%%
%%
%  Metronome markup formatter, with more options than the Lilypond
%  Metronome markup formatter, with more options than the LilyPond
%  default formatter, and changes in sizing (see below).
%  default formatter, and changes in sizing (see below).
%  Properties read:
%  Properties read:
Line 32: Line 32:
%                          to this color.
%                          to this color.
%                          Default: not set.
%                          Default: not set.
%  The size of the text ("Allegro" etc) is a bit larger than Lilypond default.
%  The size of the text ("Allegro" etc) is a bit larger than LilyPond default.
%  Similarly, the size of the note is smaller than Lilypond default.
%  Similarly, the size of the note is smaller than LilyPond default.
%
%
%  To use this snippet, just \include this file. To revert default
%  To use this snippet, just \include this file. To revert default
Lilypond formatter inside the score:
LilyPond formatter inside the score:
%  \set Score.metronomeMarkFormatter = #format-metronome-markup
%  \set Score.metronomeMarkFormatter = #format-metronome-markup
%
%
Line 44: Line 44:
%  snippet create a formatter called  "format-metronome-markup-approx",
%  snippet create a formatter called  "format-metronome-markup-approx",
%  and the default value to tempoEquationText in that snippet is "≈".
%  and the default value to tempoEquationText in that snippet is "≈".
%  I changed back this default to Lilypond default, and added the
%  I changed back this default to LilyPond default, and added the
%  tempoBetweenText property.
%  tempoBetweenText property.
%
%
Line 75: Line 75:
#(define-public (metronome-markup-custom text dur count hide-note eq-sym-def bet-sym-def hide-paren col)
#(define-public (metronome-markup-custom text dur count hide-note eq-sym-def bet-sym-def hide-paren col)
   (let* ((note-mark (if (and (not hide-note) (ly:duration? dur))
   (let* ((note-mark (if (and (not hide-note) (ly:duration? dur))
                         (make-teeny-markup                            ; note smaller than Lilypond default
                         (make-teeny-markup                            ; note smaller than LilyPond default
                         (make-note-by-number-markup (ly:duration-log dur)
                         (make-note-by-number-markup (ly:duration-log dur)
                                                     (ly:duration-dot-count dur)
                                                     (ly:duration-dot-count dur)
Line 210: Line 210:
     c'^" "_\markup \column {
     c'^" "_\markup \column {
       "\\set Score.metronomeMarkFormatter = #format-metronome-markup"
       "\\set Score.metronomeMarkFormatter = #format-metronome-markup"
       "(which is LILYPOND's default Metronome Mark Formatter)"
       "(which is LilyPond's default Metronome Mark Formatter)"
     }
     }