I have this code to arpeggiate a simple C-sharp minor chord each time with a different number of notes - in this case could be 6, 7 or 8.
do
let n = "<cs'min'6 cs'min'7 cs'min'8>"
d1
$ arpeggiate
$ note (n |- 14)
# s "juno_perc"
# begin 0.2
# legato 1.5
# room 0.8 # size 0.4
I am trying to make the code a bit more flexible and concise, e.g. cs'min
gets repeated three times and it is only the number of note that changes. So ideally I think of
"cs'min'<6 7 8>"
Unfortunately, when I try to do it for real I don't quite get what I am looking for.
When writing
fast 2 $ arpeggiate $ note "cs'min'<6 7>" # s "superpiano"
the result is
(0>1/12)|note: 1.0f, s: "superpiano"
(1/12>⅙)|note: 4.0f, s: "superpiano"
(⅙>¼)|note: 8.0f, s: "superpiano"
(¼>½)|note: 6.0f, s: "superpiano"
(½>7/12)|note: 1.0f, s: "superpiano"
(7/12>⅔)|note: 4.0f, s: "superpiano"
(⅔>¾)|note: 8.0f, s: "superpiano"
(¾>1)|note: 7.0f, s: "superpiano"
where it seems that 6 and 7 are just added after the chord.
(I used fast 2
and only <'6 '7>
so I could see all the events printed.)
I also thought that perhaps I have to make the string before passing it to note
:
arpeggiate $ note (parseBP_E ("cs'min" ++ "'6 '7")) # s "superpiano"
but this outputs to
(0>1/12)|note: 1.0f, s: "superpiano"
(1/12>⅙)|note: 4.0f, s: "superpiano"
(⅙>¼)|note: 8.0f, s: "superpiano"
(¼>⅓)|note: 13.0f, s: "superpiano"
(⅓>5/12)|note: 16.0f, s: "superpiano"
(5/12>½)|note: 20.0f, s: "superpiano"
(½>1)|note: 0.0f, s: "superpiano"
The first chord is correct, but the second is completely off - it isn't.
Is there a neater way to achieve this?