Jump to content

Tempo mark Scheme function: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m New category
Tags: Mobile edit Mobile web edit
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is a Scheme function which prints a tempo mark such as Fast (♩ = 222)
This is a Scheme function which prints a tempo mark such as Fast (♩ = 222)


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=234
%% http://lsr.di.unimi.it/LSR/Item?id=234


Line 26: Line 26:
[[Category:Preparing parts]]
[[Category:Preparing parts]]
[[Category:Scheme]]
[[Category:Scheme]]
[[Category:Snippet]]

Latest revision as of 23:18, 21 November 2025

This is a Scheme function which prints a tempo mark such as Fast (♩ = 222)

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=234

tempoMark =
  #(define-music-function (prependText notevalue appendText) (string? ly:duration? string?)
    #{
      \mark \markup
    { 	\line { $prependText " (" \fontsize #-2 \general-align #Y #DOWN \note #notevalue #1 $appendText ) } }
    #})

theMusic = {
  \once \override Score.RehearsalMark.self-alignment-X = #-1
  \time 4/4 \tempoMark "Fast" 4 "= 220-222" s1    
}

\score {
  \theMusic
}