lilypond-user
[Top][All Lists]
Advanced

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

scheme - notes as variables


From: Rob Canning
Subject: scheme - notes as variables
Date: Wed, 28 Jan 2009 12:35:16 +0000
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

hello,

i am just starting looking at scheme and have been looking at the examples linked from here:
http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Overview-of-music-functions#Overview-of-music-functions

i have something specific in mind and cant see anything quite like it in the examples.

here is what i would like to do:

have a list of notes:

list = {a b c d a b c d a f cis d aes b c d g b c d a bes c dis c c c d a e c d a b c d}

then have a piece of code that unpacks this list into a score which has variable names instead of notenames. this score would contain information about rhythm, dynamics, articulations, register etc. but have variables instead of note names
like this:

{ [var1]''4\pp r16 [var2]'4\accent [var3]''1 [var4]'''4 r8 [var5]''4\mf \accent [var6]8 \staccato }

then the \list would get iterated into the variables in the score

so

list = {a b c d a b c d a f cis d aes b c d g b c d a bes c dis c c c d a e c d a b c d}

would be unpacked into the 6 variables of the score like this...
a b c d a b
c d a f cis d
aes b c d g b
c d a bes c dis
etc.

giving this:

{ a''4\pp r16 b'4\accent c''1 d'''4 r8 a''4\mf \accent b8 \staccato c''4\pp r16 d'4\accent a''1 f'''4 r8 cis''4\mf \accent d8 \staccato
etc.

i have been doing this kind of thing before using a combination of puredata and sed but that was really ugly and the regular expressions were getting out of control! i would really appreciate any help learning how to do this using scheme

many thanks

rob





reply via email to

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