This time I´m not actually seeking help, but want to post a new approach to the same question - generating patterns that slowly evolve over time. This version is partly inspired by the App Nodebeat and the concept of having one sender triggering multiple ‘sound satellites’.
Also, the whole topic is in context of my research on forms of ‘Minimal Improvisation’.
http://www.phyla.info/?portfolio=minimal-improvisation
Thanks to @Martin for bringing up an elegant solution to create indeterminism in this thread:
I like it so much when I do NOT know what pattern will come up when I press start.
I´m very happy with this code as is, but I´m also interested in your feedback.
#Evolving Patterns
t = Time.now.to_i
use_random_seed t
puts rand
use_synth :sine
in_thread do
loop do
set :teim, (ring 0.125, 0.25, 0.375).choose
sleep rrand_i(64, 256)
end
end
in_thread do
loop do
set :taim, (ring 0.5, 0.75, 1, 1.5, 2).choose
sleep rrand_i(64, 256)
end
end
#Sending out regular cues
in_thread do
loop do
cue :zakkk
cue :pakkk
cue :rakkk
cue :rikkk
sleep get[:taim]
end
end
#Adding individual delay to be applied to each sound creates a rhythmic pattern
in_thread do
loop do
#Choosing the delay which is actually applied below
set :wa, (ring 0, 1, 2, 3, 4, 5, 6, 7).choose*get[:teim]
#After some time, the delay is changed, thus the pattern changes
sleep rrand_i(16, 256)
end
end
in_thread do
loop do
set :wo, (ring 0, 1, 2, 3, 4, 5, 6, 7).choose*get[:teim]
sleep rrand_i(16, 256)
end
end
in_thread do
loop do
set :wu, (ring 0, 1, 2, 3, 4, 5, 6, 7).choose*get[:teim]
sleep rrand_i(16, 256)
end
end
in_thread do
loop do
set :wi, (ring 0, 1, 2, 3, 4, 5, 6, 7).choose*get[:teim]
sleep rrand_i(16, 256)
end
end
in_thread do
loop do
sync :zakkk
#The choosen amount of delay is applied
wait get[:wa]
#The sound is played
play 66, amp: rrand(0.1, 1), release: rrand(0.1, 1)
end
end
in_thread do
loop do
sync :pakkk
wait get[:wo]
play 68, amp: rrand(0.1, 1), release: rrand(0.1, 1)
end
end
in_thread do
loop do
sync :rakkk
wait get[:wu]
play 59, amp: rrand(0.1, 1), release: rrand(0.1, 1)
end
end
in_thread do
loop do
sync :rikkk
wait get[:wi]
play 61, amp: rrand(0.1, 1), release: rrand(0.1, 1)
end
end
Some things I have in mind to add in the future:
- Change not only rhythm over time but also pitch
- Refine the variations of dynamics, these might also be subject to long-term changes or to patterns of accent
- Combine this way to create change with ways to create large scale form, that is mechanisms that cause repetion of certain developements
- Combine this with interactive mechanisms, for example have the tempo of movements influence the tempo of pattern changes
Also, instead of pitches, it is interesting to use drum samples or send midi to another device. I had some fun tweaking sounds in Ableton live while Sonic Pi served as the sequencer.