lilypond-user
[Top][All Lists]
Advanced

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

Re: My first define-music-function, I'm trying, need help


From: Rick Hansen (aka RickH)
Subject: Re: My first define-music-function, I'm trying, need help
Date: Fri, 22 Dec 2006 09:11:04 -0800 (PST)



seb-g wrote:
> 
> On Thu, Dec 21, 2006 at 02:48:24PM -0800, address@hidden
> wrote:
>> 
>> The simple substitution example below should be pretty easy, but I'm "in
>> a
>> pickle", can someone show me how to replace the note name in the
>> transpose
>> statement with the note specified on the function call (parameter called
>> "root")?
>> 
>> But it gets the following error:
>> 
>> <string>:2:13: error: syntax error, unexpected MUSIC_IDENTIFIER,
>> expecting
>> NOTENAME_PITCH or TONICNAME_PITCH
>> \transpose c 
>>              \lilyvartmpb { \relative { <c e g> } }
>> 
> 
> 
> Well I am not a lily schemer expert neither.
> 
> I found a function to transpose in the lily sources:
> 
> (set! root (ly:pitch-transpose root (ly:make-pitch 1 0 0)))
> 
> this makes note "root" one octave higher.
> 
> What you have to do:
>       - get wanted pitch:
>               (ly:music-property (first
>                       (ly:music-property root 'elements)) 'pitch)
>       - apply "ly:pitch-transpose" for each note of the chord:
> 
>       (map do-transpose (ly:music-property chords 'elements))
> 
> you have to write "do-transpose" an a function that do the job :-)
> 
> For example, have a look at the "removeTies" function here:
> http://lilypond.chezwam.org/darcs/lilypond/utils/chezwam-functions.ly
> 
> This was my first scheme function I hope this will help you.
> 
> 
> I will have a look on your's after my  vacations.
> 
> 
> Merry Xmas & happy new year.
> 
> 
> -- 
> Sebastien Gross
> 
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 


Thanks Sebastien,

I was afraid of this kind of answer, if define-music-function cant do
something as simple as replace one note on a \transpose without writing a
whole bunch of code... I'm not going to bother with it myself.  Too much
complexity, I'd rather look for something that will let me stay on a
user-level, I just dont have time for programming.  

Lilypond desperately needs some king of built-in text pre-process (that
installs with lilypond) to take care of these things, instead of everybody
having to constantly re-write the core lilypond code to do such simple
things.

Rick


-- 
View this message in context: 
http://www.nabble.com/My-first-define-music-function%2C-I%27m-trying%2C-need-help-tf2868174.html#a8026036
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.





reply via email to

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