2022-08-29 21:45:17 +02:00
|
|
|
--------------------------------------------------------------
|
2022-08-29 21:38:15 +02:00
|
|
|
Inspired by Marc Evanstein video "The Rythm of The Primes"
|
|
|
|
Link: https://www.youtube.com/watch?v=8x374slJGuo
|
2022-08-29 21:45:17 +02:00
|
|
|
|
|
|
|
This program will iterate over natural numbers, playing chords
|
|
|
|
based on which prime divides given number. This results in
|
|
|
|
following execution:
|
|
|
|
|
|
|
|
step: 2 3 4 5 6 7 8 9 10
|
|
|
|
1 1 1 1 1
|
|
|
|
2 2 2
|
|
|
|
3 3
|
|
|
|
|
|
|
|
where each index corresponds to specific note from scale.
|
2022-10-27 22:32:20 +02:00
|
|
|
Assuming scale [c,d,e] example above would be
|
2022-08-29 21:45:17 +02:00
|
|
|
|
|
|
|
step: 2 3 4 5 6 7 8 9 10
|
|
|
|
c c c c c
|
|
|
|
d d d
|
|
|
|
e e
|
|
|
|
|
|
|
|
which would resolve into:
|
|
|
|
|
|
|
|
play c d c e (c & d) c d (c & e)
|
|
|
|
|
|
|
|
--------------------------------------------------------------
|
2022-08-29 21:38:15 +02:00
|
|
|
|
2022-10-27 22:32:20 +02:00
|
|
|
Length := 40,
|
2022-08-29 21:38:15 +02:00
|
|
|
|
2022-10-27 22:32:20 +02:00
|
|
|
cmajor := (c,d,e,f,g),
|
|
|
|
scale := reverse cmajor,
|
|
|
|
primes := nprimes (len scale),
|
|
|
|
indicies := up (len scale),
|
2022-08-29 21:38:15 +02:00
|
|
|
|
2022-10-27 22:32:20 +02:00
|
|
|
oct 3,
|
|
|
|
len (1/16),
|
2022-08-29 21:38:15 +02:00
|
|
|
|
2022-10-25 16:10:34 +02:00
|
|
|
for (2 + up Length) ( i |
|
2022-10-27 22:32:20 +02:00
|
|
|
play (chord scale.(indicies.(i % primes == 0))),
|
|
|
|
),
|