lilypond-user
[Top][All Lists]
Advanced

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

Re: Chord library


From: Rick Hansen (aka RickH)
Subject: Re: Chord library
Date: Thu, 21 Dec 2006 15:41:19 -0800 (PST)



seb-g wrote:
> 
> On Thu, Dec 21, 2006 at 03:05:25PM -0800, address@hidden
> wrote:
>> A define-music-function would be better than tags, then the whole library
>> would be inside a function where you just specify the chord name as a
>> string
>> parameter then have a giant IF statement to generate the named chord,
>> (root
>> and duration would also be function parameters).
> 
> Indeed
> 
>> 
>> Like this:
>> 
>> \myChordLibrary c, "Maj7_2", 4
>> 
>> The above would generate a chord with a transpose root of c, with the
>> inversion of "Maj7_2" (version 2 of a maj7 chord), for a quarter note
>> duration.
>> 
>> Do you know how to use define-music-function (I dont)?  Would this be a
>> hard
>> function to write?
> 
> 
> an unchecked stuf may be:
> 
> 
> myChord = #(define-music-function (parser location root chord
> duration) (ly:music? string integer)
>   #{
>       \transpose c $root  \keepWithTag $chord \varMyChordLibrary
> $duration
>   #})
> 
> 
> But obviously it won't work ;-)
> 
> I tried to play with \displayMusic and (display-scheme-music ...)
> functions. It helps a lot.
> 
> Just let me some time and I will have a look ater new year's day.
> 
> -- 
> Sebastien Gross
> 
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 


Yes, I was thinking \varMyChordLibrary would not be needed in this case, all
the chords would simply come out of the function each embraced by an IF
statement to match the input parameter (like a giant CASE selection). 
Because I know from past experience that a duration number cannot follow a
variable name to be recognized.  The duration would have to be generated
along with the music.



-- 
View this message in context: 
http://www.nabble.com/Chord-library-tf2866120.html#a8017012
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.





reply via email to

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