lilypond-user
[Top][All Lists]
Advanced

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

Transpose up or down conditionally


From: Steve Cummings
Subject: Transpose up or down conditionally
Date: Tue, 27 Aug 2019 22:09:47 -0700
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

(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



reply via email to

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