Hi everyone. I’m Chris, french musician and new to sonic pi.
The first thing I tried is a generative version of Fur Alina, the famous piece by Arvo Pärt.
I created functions that corresponds to the “cells” of the piece, and by that I mean the little “parts” of two or more notes that shows little by little the principle of tintinnabuli : m-voice + t-voice.
If you don’t know how Pärt writes music, I highly recommend the Paul Hiller book about the composer’s style, it’s really interesting.
Anyway, here is my code. I’m sure it’s full of inelegant errors (and the commentaries are in french) but it’s a work in progress so …
Also, after I post this, I have a question for you people, about the use of functions
#code arvo pärt
#fonctions tintinnabuli inspirée de fur alina
#version polyphonique playdefine :drone do
play :B2, release: 5, amp: rrand(0.50, 1)
play :B0, release: 5, amp: rrand(0.50, 1)
sleep choose([2, 3, 4, 5])
enddefine :a do
play :B3, release: 5, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :Fs2, release: 5, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :b do
play choose([:Cs4,:D4]), attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :B2, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :c do
play choose([:E4,:Fs4]), attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :D3, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :d do
play choose([:G4,:A4,:B4]), attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :Fs3, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :e do
play choose([:Cs4,:D4]), attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :B3, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :f do
play choose([:E5,:Fs5]), attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :D4, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :g do
play choose([:G5,:A5,:B5]), attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :Fs4, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :h do
play choose([:Cs6,:D6]), attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :B4, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :flower do
play :Fs5, attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :Cs4, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :bfa do
play :D4, attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :B2, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
enddefine :dfa do
play :B4, attack: choose([0.2,0.5]), release: 3, amp: rrand(0.50, 1)
sleep choose([0, 1])
play :Fs3, attack: choose([0.2,0.5]), release: 4, amp: rrand(0.50, 1)
sleep choose([0.5, 1, 2, 3, 4, 5])
end#structure
in_thread(name: :arvopart) do
#uncomment to use one or another
#use_play_defaults port: ‘focusrite_usb_play’
#use_play_defaults port: ‘arturia_minibrute_2’with_fx :reverb, room: 0.9 do
loop do use_synth :hollow drone 14.times do choose ([a, b, c, d, e, f, g, h, flower]) end end
end
end