|
From: | Jean Abou Samra |
Subject: | Re: Wondering if there's a way to not just hide N.C symbols, but have them not erase "current" chord. |
Date: | Sat, 18 Feb 2023 00:06:13 +0100 |
User-agent: | Evolution 3.46.3 (3.46.3-1.fc37) |
Le vendredi 17 février 2023 à 16:58 -0600, Matthew Probst a écrit :
One last question regarding this:
- Given that now I have a way to not have to set the N.C. symbol to the empty string, is there a way to preserve a method of using the N.C symbol when I want it? In other words, can you escape a rest so that it doesn't get converted to a skip, say by using a variable or function to wrap it?
That would be nice to know, but not absolutely necessary.
Thanks yet again.
Sure. Something like this should do:
\version "2.24.1"
firstNoteOfChord =
#(define-music-function (music) (ly:music?)
(define (iter mus)
(let ((elt (ly:music-property mus 'element))
(elts (ly:music-property mus 'elements)))
(map iter elts)
(if (not (null? elt)) (iter elt))
(if (and (music-is-of-type? mus 'event-chord) (not (null? elts)))
(ly:music-set-property! mus 'elements (list (car elts))))))
(iter music)
music)
restsToSkips =
#(define-music-function (music) (ly:music?)
(music-map (lambda (m)
(if (and (music-is-of-type? m 'general-rest-event)
(not (ly:music-property m 'keep-as-rest #f)))
(make-music 'SkipEvent m)
m))
music))
keepAsRest = \withMusicProperty keep-as-rest ##t \etc
VerseRhythmChords = {
\chordmode {
e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
e16:9 r8 q16 r8 q16 r16 r16 q16 r8 q16 q16 r8
bes16 q16 r16 q16 q4 g16 q16 \keepAsRest r16 q16 q4
}
}
<<
\new ChordNames {
\set chordChanges = ##t
\restsToSkips \VerseRhythmChords
}
\new Voice \with {
\consists "Pitch_squash_engraver"
} {
\improvisationOn
\firstNoteOfChord \VerseRhythmChords
\improvisationOff
}
>>
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] | Current Thread | [Next in Thread] |