Flip: Difference between revisions
Appearance
Import snippet from LSR |
m New category |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<code>\scale #'(-1 . 1)</code> workaround. | <code>\scale #'(-1 . 1)</code> workaround. | ||
<lilypond version="2.24 | <lilypond version="2.24" full> | ||
%% http://lsr.di.unimi.it/LSR/Item?id=905 | %% http://lsr.di.unimi.it/LSR/Item?id=905 | ||
| Line 122: | Line 122: | ||
[[Category:Scheme]] | [[Category:Scheme]] | ||
[[Category:Workaround]] | [[Category:Workaround]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:18, 21 November 2025
\scale #'(-1 . 1) workaround.
\version "2.24"
%% http://lsr.di.unimi.it/LSR/Item?id=905
% by P.P.Schneider on March 2014.
\paper { tagline = ##f }
%here starts the snippet:
%%%% \flip:
#(define-markup-command (flip layout props arg) (markup?)
(interpret-markup layout props
(markup
#:concat (
#:null
#:scale (cons -1 1)
#:line (arg)))))
%%%% end \flip.
myScr= { c'1 }
\markuplist {
\italic\concat {
"This markup uses "
\typewriter "\scale #'(-1 . 1)"
" to flip a score"
\hspace #0.3 ":"
}
\vspace #0.2
\line {
\concat {
"This flipped score"
\hspace#.3
":"
}
\raise #1
\scale #'(-1 . 1)
\score {
\myScr
\layout {
indent = 0
}
}
" is mine."
}
\vspace#1
\concat\italic {
"Here's the side-effect when starting a markup with "
\typewriter "\scale #'(-1 . 1)"
\hspace #0.3
":"
}
\vspace#.2
\line {
\scale #'(-1 . 1)
\score {
\myScr
\layout {
indent = 0
}
}
\lower #1
\concat {
" My beloved score is leaving"
\hspace #0.3
"!"
}
}
\vspace#1
\concat\italic {
"Here's a possible workaround using "
\typewriter "\left-align"
\hspace #0.3
":"
}
\vspace#.2
\left-align
\line {
\scale #'(-1 . 1)
\score {
\myScr
\layout {
indent = 0
}
}
\lower #1
\concat {
" It's coming back"
\hspace #0.3
"!"
}
}
\vspace#1
\concat\italic {
"And this one uses a simple "
\typewriter "\flip"
" command that avoids using "
\typewriter "\left-align"
\hspace #0.3
":"
}
\vspace#.2
\line {
\flip
\score {
\myScr
\layout {
indent = 0
}
}
\lower #1
\concat {
" Now it's home."
}
}
}