[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lilypond-auto] Issue 2249 in lilypond: ledger lines of pitched rest
From: |
lilypond |
Subject: |
Re: [Lilypond-auto] Issue 2249 in lilypond: ledger lines of pitched rests are verticaly misplaced |
Date: |
Sun, 01 Jun 2014 15:26:45 +0000 |
Comment #17 on issue 2249 by address@hidden: ledger lines of pitched
rests are verticaly misplaced
http://code.google.com/p/lilypond/issues/detail?id=2249
this is what I use currently to fix rest pitches.
to add some context: in ancient notation it is customary to place rests
near to the preceding or succeeding note - this actually helps
understanding the meter. that means that I must consider the duration of
the rest and the place of the aligning note (whether it's on a line or in a
space). care should be taken with whole rests as pitching a whole rest on
a line means the rest will hang from the next line!
------------------------------------------------------------->8
% move a rest half a space down if not on a line (needed when transposing)
#(define (round-pitch p)
(let* (
(o (ly:pitch-octave p))
(n (ly:pitch-notename p))
(m (* (floor (/ (+ (* 7 o) n) 2)) 2))
(a (remainder m 7))
(b (/ (- m a) 7))
)
(ly:make-pitch b a 0)))
#(define (fix-rests music)
(let (
(n (ly:music-property music 'name))
(p (ly:music-property music 'pitch))
)
(if (and (ly:pitch? p) (eqv? n 'RestEvent))
(ly:music-set-property! music 'pitch (round-pitch p)))
music))
fixRests =
#(define-music-function (parser location mus) (ly:music?)
(music-map (lambda (x) (fix-rests x)) mus))
% in this example all rests are aligned to the previous note
mus = { g'2 g'\rest f'1\rest g'\breve\rest a'2 a'\rest g'1\rest
a'\breve\rest }
\fixRests
{
\cadenzaOn
\mus \transpose g a \mus
}
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings