lilypond-user
[Top][All Lists]
Advanced

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

define-music-function to generate chord tones/roots?


From: Rick Hansen (aka RickH)
Subject: define-music-function to generate chord tones/roots?
Date: Sun, 9 Apr 2006 12:58:05 -0700 (PDT)

How can I write a music function to generate a specific chord, transposed to
the named root and played for the named duration?

It would have 3 parameters:

string = the chord root transposition target, values like ("e", "ef", "b",
"IV", "V", "2", etc) relative to c, these are my own made up codes.

string = the name of the chord I want, values like ("M7", "m7b5", "aug7",
"twilightzone", "mysterychord", etc) these names would be my own made up
names too.

number = number of beats expression values like ("4." for dotted quarter)


Ultimately I want to make a chord library so that I dont have to keep
entering chord notes individually and I can name chords and transposition by
note or diatonic/chromatic interval using my own library names.

Here is what I might enter manually, I want my new function to generate the
innermost transpose statements...


\New ChordNames {  \transpose c' f' {

\transpose c' d' { <c e g b>2 }
\transpose c' e' { <c e g bf> }
\transpose c' f' { <c e g bf>1 }
\transpose c' g' { <c ef g bf df'> }
\transpose c' a' { <c ef gf bf df'> }
\transpose c' b' { <c e g b df'> }

} }

In the above example the transpose target, chord tones and duration would be
replaced by the function logic, see below.

I'd prefer to have my source code look like this, and my \mychd function to
be useable in staffs other than ChordNames also:


\New ChordNames {  \transpose c' f' {

\mychd {"d", "M7", 2 }
\mychd {"3", "7", 1 }
\mychd {"f", "7", 1 }
\mychd {"V", "m7b9", 1 }
\mychd {"a", "m7b5b9", 1 }
\mychd {"b", "mysterychord", 1 }

} }

The compiled output would be the manually entered code above.

Ultimatly I want to have the flexibility to make up my own names for both
sequences of chord tones and root position.  My goal is to ultimately extend
my \mychd function later on to recognize numeric transposition (nashville
style) of the chords.

Trying to learn how to make a music-function from the manual is next to
impossible for a non-programmer.

I guess it's just a big "case" statement mapping my own names to note
sequences and root transpositions, then outputting the correct code.  I
realize that in my example the chord names will be printed by ly and that is
ok.  My goal is to just organize my chord library and I'm ok with the
default Klaus Ignatzek notation on the paper.

Can someone help me get this define-music-function started, then I'll finish
it?

Thanks
Rick


--
View this message in context: 
http://www.nabble.com/define-music-function-to-generate-chord-tones-roots--t1421552.html#a3831891
Sent from the Gnu - Lilypond - User forum at Nabble.com.





reply via email to

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