On Thu, Dec 12, 2013 at 4:26 PM, Tom van der Hoeven <t...@vanderhoeven.biz>wrote:
> Suppose I have > music = \relative c'{c b a g f e e f g a b c} > my instrument is limited so it cannot play the pitch f end below > I have to raise f e e f by a terts of an octave > Is there a function shift or can it be made such that > > music = \relative c'{c b a g \terts{f e e f} g a b c} > > is equivalent to > > \relative c'{c b a g a g g a g a b c} > > if you use : > terts = #(define-music-function (parser location ploep) (ly:music?) > #{ \transpose c e \relative c' $ploep #}) > > the c' after \relative should actualy be the last-pitch (in the example g) > Help will be appreciated > > Tom > > A couple of things: I don't think you can do what you're wanting to do in relative mode. I think you need to use music = { c' b a g \terts{f e e f} g a b c' } and keep everything in absolute, at least, if you're going to embed a Scheme function like this. I can foresee possible combinations of this that are going to make your music go all over the place. Secondly, as a musical point, what you're wanting is not what you're going to get. Your function looks like it should produce c' b a g a gis gis a g a b c What you ideally need is a function that takes a musical expression and a cutoff note, then inspects each note and translates the note (raises it) if it falls outside the range. I'm not versed enough in Scheme to produce this function, but it would provide the flexibility of allowing you to use relative mode if so desired, and would not require you to explicitly define the notes to transpose ahead of time. Cheers, Carl P.
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user