Przygotowanie krótkiego utworu (~30s) w środowisku Sonic Pi, spełniającego następujące wymagania:
chord, chord_inversion, chord_degreePaństwu pozostawiam zapoznanie się z dokumentacją w Sonic Pi. (Widok > Pokaż pomoc > Lang)
chordchord_degreechord_inversionuse_bpm 600
state = "A"
use_random_seed 3
live_loop :markov do
# Zrealizuj stan
print "Current state: ", state
if state == "A" then
play :c4
elsif state == "B" then
play :g4
elsif state == "C" then
play :e4
stop
end
sleep 1
# Przejdź do następnego stanu
if state == "A" then
n = rrand 0, 1
if n <= 0.3 then state = "A"
elsif n <= 0.9 then state = "B"
elsif n <= 1 then state = "C" end
elsif state == "B" then
n = rrand 0, 1
if n <= 0.1 then state = "A"
elsif n <= 1 then state = "B"
elsif state == "C" then
end
end
end