Hi! pd is cool. I'm having some trouble implementing my first patch taking as input the name of a musical scale as a message, i.e.
[wholetone(
|
[scalegen]
|
[print]
I take a message as input and look up the name in a [s-map] external i found on the mailing list.
The s-map stores step patterns such as
... set diatonic 2 2 1 2 2 2 1, ...
Using this step pattern and an offset, I want to calculate the distance from a tonic pitch "0" of each scale note, i.e. for C Ionian:
C D E F G A B C ...
-2-2-1-2-2-2-1-...
should result in the final output:
0 2 4 5 7 9 13 14
The reason I am doing things this way is because based on the mode of a scale, the addition steps may result in different patterns, i.e. for C Dorian:
0 1 3 5 7 9 10 12
To this end, my strategy is:
(0) Begin with a temporary integer 0,
(1) Get the first element of the list,
(2) add this to the temporary integer, and
the result,
(3) Get the second element of the list,
(4) Go to (2) unless we reach the end of the list. Then, output the resulting list.
I want to be able to do this for arbitrary step patterns and scale sizes, but right now, I can't wrap my head around using "until" as what is basically a for loop.
Additionally, I think my triggering order is incorrect, and I don't understand how I can continually append to list without resetting it with each iteration.
An advice would be hugely appreciated! Thanks!