(also posted on Stack Exchange)
version 2.19...
How can I make Lilypond decide whether to transpose up or down depending
on a target octave/range for one of the transposed notes?
I want to make a set of chord voicings, each in multiple transpositions,
with the lowest note of each transposed voicing always within a
specified octave, say between "c" and "b" (the octave below middle C in
Lilypond notation). This would require some sort of conditional (in
concept, something like: "try transposing the chord down; if the lowest
note of the downward transposition is too low, transpose up").
I can't find any relevant snippets in the Lilypond snippet library. I
found one discussion of conditional transposing here:
http://lilypond.1069038.n5.nabble.com/problems-trying-to-write-a-conditional-transpose-td148815.html
but the Scheme code is opaque to me--with the sparse comments I can't
even understand what the original poster was trying to accomplish, much
less the proposed solution. And when I tried to test that code using the
short sample "input" quoted in the above link I got errors, as follows:
|Parsing...C:...tmpdocument.ly:7:3: In procedure ly:music-set-property!
in expression ((setter ly:music-property) (quote from-to) music ...):
C:...tmpdocument.ly:7:3: Wrong type argument in position 1 (expecting
Prob): from-to |
A fancy-ish implementation might take any specified note in a series as
the reference point for the up/down decision, or even calculate an
"average" reference pitch, but for my purposes the reference note will
always be the first one in the chord, for example the 'c' in the C major
'< c e g >' triad.
Thank you,
Steve
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user