Back in 2023 or so I asked for some code from Jean Abou Samra. He
provided Scheme code that collapsed chords in chordmode to single
notes that can be ptich squashed to create improvisation style rhythms
from chord parts with maximim ease.
I really like it and have been using it, but it seems to eat accents
on chords that are accepted by Lilypond as valid markup. I'd love to
be able to preserve accents on the chords written in chordmode, and
add them to the single notes extracted from the chords, and for
ptich-squash to respect that.
The code in question is:
\version "2.25.1"
% firstNoteOfChord collapses chord objects inside a music object into
% single notes. Useful for pitch squashing /chordmode objects into nice
% printable \improvisatoinOn rhythm notation for guitarists.
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)
Assuming that I'd have to extract and add items based on what's in the
variable mus. I'm still not understanding quite well enough to see
what to access to fetch any accents/articulations added to them.
Working on a quick example:
The example is in here:
https://files.cellowizard.info/s/kzBMmkkL2Npg9sj
I have included a copy of the includes I'm using, including one in the
includes/ folder for "FirstNoteOfChord.ly".
Actually my question might be even simpler, in that it might be "HOw
does one specify an accent on a chord in chordmode, if it has a
quality like e16:9 ? I'm having trouble deducing from documentation
how to do it. Maybe if I get that syntax correct I can get this
working.