lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wondering if there's a way to not just hide N.C symbols, but have th


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:

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
    }
>>

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]