Create a gist now

Instantly share code, notes, and snippets.

Sonic Pi processing remote control GUI
The files in this Gist accompany a video series on YouTube at
https://www.youtube.com/playlist?list=PLjMfQ8Gw5Iq6xoFy57fzRXkyjhz5L5KP1
and an article at https://rbnrpi.wordpress.com/
which detail the operation of a remote control GUI for Sonic Pi written with the processing app (processing.org)
The programs are all referred to either in the article or the videos. You will need to alter the path variables
in the various programs to fit your own system. i have tested the programs on a Mac and a Raspberry Pi using
SP 2.11.1 and SP 2.11 respectively, the current release versions for these two platforms.
Unfortunately I have had problems in getting the sopnic-pi-cli to work on my Windows 10 machine, althouhg the GUI itself
can be built on this platform, as processing has versions available for download for Mac, PC, Linux and Raspberry Pi.
Details for installing the sonic-pi-cli for Mac and Raspberry Pi are contained in the article.
#!/usr/bin/ruby
`/usr/local/bin/sonic_pi stop`
`/usr/local/bin/sonic_pi "run_file '~/Documents/SPfromXML/BeatusVirControlled-RF.rb'"`
##| run_file "~/Documents/SPfromXML/BeatusVirControlled-RF.rb"
restart="~/Documents/SPfromXML/BeatusVirControlled-RFAuto.rb"
use_debug false #turn off log_synths
use_arg_checks false #turn off log_cues
s=[] #holds OSC cue info received: set global here
bs=1 #starting bar number
bpba=[4]*13 #setup up list of section beats per bar
bpba[1]=6
#puts bpba
st=[] #holds info for start section and remaining bars to process: set global here
#part pan positions
p1=-0.8;p2=-0.7;p3=-0.3;p4=0.3;p5=0.5;p6=0-0.1;p7=0.8;p8=0.7;p9=0.1
############### define functions used in the script
define :numbeats do |durations| #return number of crotchet beats in a note durations list
l=0.0
durations.each do |d|
l+=d
end
return l
end
#find starting section, and number of bars in that section to be processed
#to determine the starting note index
define :startDetails do |bn,bNumberSecStart,durations|
startSecIndex=0
remainingBars=bn
#iterate until remaning bn is within the section
while bn>bNumberSecStart[startSecIndex]
remainingBars=bn-bNumberSecStart[startSecIndex]
startSecIndex+=1
end
#return the section to start playing and number of bars to determine starting note index
return startSecIndex-1,remainingBars
end
define :getmatchd do |bn,bpb,durations| #works out the note index for a given bar number
matchbeat=(bn-1)*bpb #target number of beats to find
l=0.0;x=0
until l>=matchbeat || (l-matchbeat).abs < 0.0625 #0.0625 is smallest quantisation to consider
l+=durations[x]
x+=1
end
return [x ,l-matchbeat] #return the matched beat note index, plus sleep for tied note (if any)
#nb if the bar start coincides with a tied note, then the part will start with the next
#note and a sleep command will be issued for the remaining duration of the tied note
end
##########################
#wait for an OSC cue to be received from the Processing GUI sketch
#This sends two parameters: First controls Play (1) Stop (-1)
#second gives reauested bar start number
tr=0
until tr==1 #wait for PLAY cue from processing GUI (first parameter will be set to 1)
s=sync '/transport'
#tr=s[:args][0] #if SP2.11
tr=s[0] #if SP 2.11.1
#puts s #for debugging
end
#bs, start bar number is second parameter received
#bs=s[:args][1] #if using SP 2.11
bs=s[1] #if using SP 2.11.1
puts "BS selected is "+bs.to_s
##########################
#start polling for an OSC cue to stop playing from the Processing GUI sketch
#this runs continuously in a thread
in_thread do #this thread polls for an OSC cue to stop the program
tr=0
until tr==-1 #the first parameter will be set to -1 for a STOP signal
s=sync '/transport'
#tr=s[:args][0] #if using SP 2.11
tr=s[0] #if using SP 2.11.1
#puts s #for debugging
end
#stop command detected
puts"stopping"
puts "running sonic pi cli script to restart"
system(restart+" &") #run the auto script to stop and rerun the code
end
##########################
with_fx :reverb, room: 0.8 do
with_fx :level,amp: 0.7 do
use_synth :tri
a1=[]
b1=[]
a1[0]=[:r,:E5,:E5,:D5,:D5,:D5,:D5,:C5,:C5,:C5,:C5,:C5,:C5,:B4,:C5,:r,:E4,:F4,:G4,:A4,:r,:G4,:A4,:C5,:C5,:B4,:C5,:r,:r,:r,:r,:E5,:E5,:D5,:D5,:D5,:D5,:C5,:C5,:C5,:C5,:C5,:C5,:B4,:C5,:r,:r,:r,:r,:r,:E5,:D5,:C5,:B4,:A4,:B4,:C5,:D5,:E5,:F5,:E5,:D5,:C5,:r,:r,:r,:r,:r,:r,:r,:E5,:D5,:D5,:D5,:C5,:E4,:E4,:F4,:E4,:F4,:G4,:A4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.0]
a1[8]=[:r,:r]
b1[8]=[4.0,2.0]
a1[9]=[:r]
b1[9]=[2.0]
a1[10]=[:B4,:B4,:B4,:B4,:A4,:B4,:Cs5]
b1[10]=[0.75,0.25,0.5,0.5,1.0,1.0,2.0]
a1[11]=[:Cs5]
b1[11]=[2.0]
a1[12]=[:r,:A4,:A4,:A4,:A4,:A4,:A4,:r,:r,:A4,:A4,:A4,:A4,:A4,:A4,:r,:r,:D5,:D5,:D5,:D5,:D5,:D5,:r,:r,:D5,:D5,:D5,:D5,:D5,:D5,:r,:D5,:D5,:D5,:D5,:D5,:E5,:E5,:F5,:E5,:E5,:D5,:D5,:E5,:E5,:E5,:E5,:E5,:E5,:D5,:D5,:D5,:D5,:D5,:E5,:E5,:F5,:E5,:E5,:D5,:C5,:E5,:D5,:C5,:B4,:A4,:G4,:F4,:E4]
b1[12]=[4.0,0.5,0.25,0.25,0.5,0.25,0.25,2.0,4.0,0.5,0.25,0.25,0.5,0.25,0.25,2.0,4.0,0.5,0.25,0.25,0.5,0.25,0.25,2.0,4.0,0.5,0.25,0.25,0.5,0.25,0.25,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,2.0,2.0,3.0,1.0,3.0,1.0,3.0,1.0,4.0,4.0]
c1=[90,240,90,70,90,70,90,70,90,70,90,70,90]
###################### calculate starting data
#calc bar offset for start of each tempo change. Held in bNumberSecStart list
bNumberSecStart=[]
bNumberSecStart[0]=0
bNumber=0
b1.length.times do |z|
bNumber+= numbeats(b1[z])/bpba[z]
bNumberSecStart[z+1]=bNumber
end
#puts bNumberSecStart #for debugging
#calc number of bars inthe piece
bmax=bNumberSecStart[b1.length]
puts "Total number of bars="+bmax.to_s
#adjust requested bar start number if too large
if bs>bmax
bs=bmax
puts "Start bar exceeds piece length: changed to :"+bs.to_s
end
#calculate info for starting sector containing bar start requested,
#and number of remaining bars to process to get starting index
st=startDetails(bs,bNumberSecStart,b1)
startSec=st[0]
remainingBars=st[1]
puts "Start Section="+st[0].to_s
puts "Remaining Bars to find starting index="+st[1].to_s
puts
################### now ready to procoess an play each part in turn (played together in threads)
#each part is processed in exactly the same way
#calc starting index and any sleep for tied notes for part 1
sv1=getmatchd(st[1],bpba[st[0]],b1[st[0]])
puts "1: "+sv1.to_s #print start index and sleep time
in_thread do
for i in st[0]..a1.length-1
use_bpm c1[i]
sleep sv1[1] #sleep for tied note (>0 if tied)
for j in sv1[0]..a1[i].length-1
play a1[i][j],sustain: b1[i][j]*0.9,release: b1[i][j]*0.1,pan:-p1
sleep b1[i][j]
end
sv1=[0,0] #reset so subsequent iterations of j loop in full and no tied sleep
end
end
#2nd part
a2=[]
b2=[]
a2[0]=[:r,:r,:E5,:E5,:D5,:D5,:D5,:D5,:C5,:r,:G4,:A4,:E4,:F4,:r,:G4,:F4,:E4,:D4,:D4,:C4,:r,:r,:r,:r,:r,:E5,:E5,:D5,:D5,:D5,:D5,:C5,:r,:r,:r,:r,:r,:C5,:B4,:A4,:G4,:F4,:G4,:G4,:A4,:C5,:C5,:B4,:C5,:r,:r,:r,:r,:r,:r,:r,:C5,:C5,:C5,:C5,:B4,:C5,:C4,:C4,:C4,:C4,:D4,:E4,:F4,:F4,:r,:r,:r,:r,:E5,:E5,:D5,:D5,:D5,:D5,:C5,:r,:r,:r,:r,:r,:r,:r,:r,:r,:E5,:E5,:E5,:D5,:D5,:C5,:C5,:B4,:B4,:A4,:G4,:G4,:F4,:E4,:D4,:C4,:C5,:C5,:C5,:C5,:C5,:B4,:C5,:r,:r,:r,:r,:r,:r,:E5,:E5,:D5,:D5,:D5,:D5,:C5,:r,:D5,:D5,:A4,:B4,:C5,:D5,:A4,:B4,:C5,:D5,:C5,:B4,:r,:r,:r,:r,:r,:r,:r,:r,:C5,:C5,:C5,:C5,:C5,:B4,:A4,:G4,:r,:r,:r,:r,:r,:G5,:F5,:E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2.0,0.5,0.25,0.25,0.5,0.25,0.25,4.0,2.0,0.5,0.25,0.25,0.5,0.25,0.25,4.0,2.0,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,2.0,2.0,3.0,1.0,3.0,1.0,4.0,1.0,1.0,4.0]
c2=[90,240,90,70,90,70,90,70,90,70,90,70,90]
#calc starting index and any sleep for tied notes for part 2
sv2=getmatchd(st[1],bpba[st[0]],b2[st[0]])
puts "2: "+sv2.to_s #print start index and sleep time
in_thread do
for i in st[0]..a2.length-1
use_bpm c2[i]
sleep sv2[1] #sleep for tied note (>0 if tied)
for j in sv2[0]..a2[i].length-1
play a2[i][j],sustain: b2[i][j]*0.9,release: b2[i][j]*0.1,pan: p2
sleep b2[i][j]
end
sv2=[0,0] #reset so subsequent iterations of j loop in full and no tied sleep
end
end
#remaining parts not commneneted. Work as for part1 and 2
a3=[]
b3=[]
a3[0]=[:r,:r,:G4,:G4,:F4,:A4,:G4,:G4,:G4,:r,:r,:r,:r,:r,:r,:r,:G4,:G4,:F4,:A4,:G4,:G4,:G4,:r,:r,:r,:r,:r,:r,:r,:G4,:F4,:E4,:D4,:C4,:D4,:E4,:D4,:E4,:F4,:E4,:D4,:C4,:r,:r,:r,:r,:r,:r,:r,:r,:G4,:F4,:E4,:D4,:C4,:r,:r,:r,:r,:r,:r,:r,:r,:r,:G4,:G4,:G4,:F4,:E4,:D4,:D4,:C4,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:G4,:G4,:F4,:A4,:G4,:G4,:E4,:r,:r,:r,:r,:r,:r,:r,:r,:E4,:E4,:E4,:E4,:Fs4,:G4,:Fs4,:E4,:D4,:r,:r,:r,:r,:r,:r,:r,:r,:r,:A4,:G4,:G4,:F4,:E4,:D4,:C4,:r,:r,:r,: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3,:A3,:B3,:B3,:C4,:B3,:B3,:A3,:A3,:B3,:B3,:B3,:B3,:B3,:B3,:r,:G4,:G4,:G4,:G4,:F4,:E4,:E4,:D4,:E4,:C4,:D4,:C4,:r,:E4,:F4,:C4,:C4]
b3[12]=[0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,2.0,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,0.5,0.25,0.25,0.5,0.25,0.25,4.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,2.0,2.0,4.0,8.0,4.0,4.0,4.0]
c3=[90,240,90,70,90,70,90,70,90,70,90,70,90]
sv3=getmatchd(st[1],bpba[st[0]],b3[st[0]])
puts "3: "+sv3.to_s
in_thread do
for i in st[0]..a3.length-1
use_bpm c3[i]
sleep sv3[1]
for j in sv3[0]..a3[i].length-1
play a3[i][j],sustain: b3[i][j]*0.9,release: b3[i][j]*0.1,pan: p3
sleep b3[i][j]
end
sv3=[0,0]
end
end
a4=[]
b4=[]
a4[0]=[:r,:r,:E4,:E4,:A3,:A3,:D4,:G3,:G3,:r,:r,:r,:r,:F3,:E3,:F3,:G3,:A3,:B3,:C4,:C4,:C4,:B3,:C4,:r,:r,:r,:E4,:E4,:A3,:A3,:D4,:G3,:G3,:r,:r,:r,:r,:r,:r,:r,:E4,:D4,:C4,:B3,:A3,:B3,:C4,:C4,:C4,:C4,:B3,:C4,:r,:r,:r,:r,:G3,:G3,:A3,:G3,:A3,:B3,:C4,:C4,:r,:r,:r,:r,:r,:G3,:A3,:C4,:G3,:G3,:r,:r,:r,:r,:r,:r,:r,:r,:r,:E4,:E4,:E4,:D4,:C4,:C4,:B3,:C4,:r,:r,:r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,1.0,1.0,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,2.0,4.0,4.0,4.0,3.0,1.0,3.0,1.0,4.0,4.0]
c4=[90,240,90,70,90,70,90,70,90,70,90,70,90]
sv4=getmatchd(st[1],bpba[st[0]],b4[st[0]])
puts "4: "+sv4.to_s
in_thread do
for i in st[0]..a4.length-1
use_bpm c4[i]
sleep sv4[1]
for j in sv4[0]..a4[i].length-1
play a4[i][j],sustain: b4[i][j]*0.9,release: b4[i][j]*0.1,pan: p4
sleep b4[i][j]
end
sv4=[0,0]
end
end
a5=[]
b5=[]
a5[0]=[:r,:r,:C4,:C4,:D4,:D4,:D4,:D4,:E4,:r,:r,:r,:r,:A3,:G3,:A3,:B3,:C4,:D4,:E4,:F4,:D4,:C4,:r,:r,:r,:C4,:C4,:D4,:D4,:D4,:D4,:E4,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:E3,:E3,:F3,:E3,:F3,:G3,:A3,:A3,:r,:r,:r,:r,:r,:C4,:C4,:C4,:C4,:B3,:C4,:r,:r,:r,:C4,:C4,:D4,:D4,:D4,:D4,:E4,:r,:r,:r,:r,:r,:r,:G3,:G3,:G3,:A3,:A3,:A3,:B3,:B3,:B3,:r,:r,:r,:C4,:C4,:C4,:B3,:B3,:A3,:A3,:G3,:G3,:A3,:C4,:C4,:B3,:C4,:r,:r,:r,:r,:r,:A3,:A3,:A3,:A3,:A3,:A3,:A3,:G3,:A3,:A3,:B3,:C4,:C4,:C4,:B3,:C4,:r,:r,:r,:C4,:C4,:D4,:D4,:D4,:D4,:A3,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:r,:E3,:F3,:G3,:A3,:G3,:A3,:B3,:C4,:r,:r,:r,:r,:r,:r,:r,:r,:G3,:G3,:A3,:A3,:D4,:G3,:G3,:r,:E3,:F3,:G3,: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:G3,:G3,:G3,:G3,:F3,:E3,:E3,:D3,:E3,:C3,:G3,:C3,:C3,:B2,:A2,:G2,:F2,:C3]
b6[12]=[0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,2.0,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,2.0,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,2.0,2.0,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,1.0,1.0,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.5,0.5,2.0,2.0,3.0,1.0,3.0,1.0,8.0,4.0]
c6=[90,240,90,70,90,70,90,70,90,70,90,70,90]
sv6=getmatchd(st[1],bpba[st[0]],b6[st[0]])
puts "6: "+sv6.to_s
in_thread do
for i in st[0]..a6.length-1
use_bpm c6[i]
sleep sv6[1]
for j in sv6[0]..a6[i].length-1
play a6[i][j],sustain: b6[i][j]*0.9,release: b6[i][j]*0.1,pan: p6
sleep b6[i][j]
end
sv6=[0,0]
end
end
use_synth :beep
a7=[]
b7=[]
a7[0]=[:r,:r,:C5,:C5,:C5,:C5,:C5,:B4,:C5,:r,:r,:r,:r,:r,:r,:r,:C5,:C5,:C5,:C5,:C5,:B4,:C5,:r,:r,:r,:G5,:G5,:A5,:G5,:F5,:E5,:D5,:E5,:F5,:D5,:E5,:E5,:F5,:E5,:F5,:E5,:F5,:G5,:A5,:r,:G5,:A5,:G5,:F5,:E5,:D5,:E5,:F5,:D5,:E5,:r,:r,:r,:r,:r,:E4,:E4,:F4,:E4,:F4,:G4,:A4,:r,:C5,:C5,:C5,:C5,:B4,:C5,:r,:r,:r,:r,:r,:r,:r,:C5,:C5,:C5,:C5,:C5,:B4,:C5,:r,:r,:r,:E5,:E5,:D5,:C5,:F5,:E5,:D5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sv9[0]..a9[i].length-1
play a9[i][j],sustain: b9[i][j]*0.9,release: b9[i][j]*0.1,pan: p9
sleep b9[i][j]
end
sv9=[0,0]
end
end
end #level
end #reverb
#FrereJaques-1part.rb
a1=[ ]
b1=[ ]
a1[0]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a1[1]=[:e4,:f4,:g4,:e4,:f4,:g4]
a1[2]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a1[3]=[:c4,:g3,:c4,:c4,:g3,:c4]
a1[4]=[:r]*8
a1[5]=[:r]*8
a1[6]=[:r]*8+a1[0]
a1[7]=a1[1]
a1[8]=a1[2]
a1[9]=a1[3]
a1[10]=a1[4]
a1[11]=a1[5]
a1[12]=[:r]*8
b1[0]=[1,1,1,1,1,1,1,1]
b1[1]=[1,1,2,1,1,2]
b1[2]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b1[3]=[1,1,2,1,1,2]
b1[4]=[1]*8
b1[5]=[1]*8
b1[6]=[1]*8+b1[0]
b1[7]=b1[1]
b1[8]=b1[2]
b1[9]=b1[3]
b1[10]=b1[4]
b1[11]=b1[5]
b1[12]=[1]*8
c1=[100,120,140,160,180,200,220,200,180,160,140,120,100]
use_synth :beep
in_thread do
for i in 0..a1.length-1
use_bpm c1[i]
for j in 0..a1[i].length-1
play a1[i][j],sustain: b1[i][j]*0.9,release: b1[i][j]*0.1
sleep b1[i][j]
end
end
end
#FrereJaquesControlled-RF.rb
restart="~/Documents/SPfromXML/FrereJaquesControlled-RFAuto.rb"
use_debug false #turn off log_synths
use_arg_checks false #turn off log_cues
bs=1 #starting bar number: give it an initial value here
bpba=[4]*13 #setup up list of section beats per bar
#puts bpba
st=[] #holds info for start section and remaining bars to process: set global here
#part pan positions
p1=-1;p2=-0.33;p3=0.33;p4=2
############### define functions used in the script
define :numbeats do |durations| #return number of crotchet beats in a note durations list
l=0.0
durations.each do |d|
l+=d
end
return l
end
#find starting section, and number of bars in that section to be processed
#to determine the starting note index
define :startDetails do |bn,bNumberSecStart,durations|
startSecIndex=0
remainingBars=bn
#iterate until remaning bn is within the section
while bn>bNumberSecStart[startSecIndex]
remainingBars=bn-bNumberSecStart[startSecIndex]
startSecIndex+=1
end
#return the section to start playing and number of bars to determine starting note index
return startSecIndex-1,remainingBars
end
define :getmatchd do |bn,bpb,durations| #works out the note index for a given bar number
matchbeat=(bn-1)*bpb #target number of beats to find
l=0.0;x=0
until l>=matchbeat || (l-matchbeat).abs < 0.0625 #0.0625 is smallest quantisation to consider
l+=durations[x]
x+=1
end
return [x ,l-matchbeat] #return the matched beat note index, plus sleep for tied note (if any)
#nb if the bar start coincides with a tied note, then the part will start with the next
#note and a sleep command will be issued for the remaining duration of the tied note
end
define :ver do
return version.to_s.split('.')
end
##########################
#wait for an OSC cue to be received from the Processing GUI sketch
#This sends two parameters: First controls Play (1) Stop (-1)
#second gives requested bar start number
tr=0
until tr==1 #wait for PLAY cue from processing GUI (first parameter will be set to 1)
s=sync '/transport'
if version="v2.11.1" or ver[2].to_i > 11
tr=s[0]
bs=s[1]
else
tr=s[:args][0] #tr governs play/stop value is 1 for play -1 for stop
bs=s[:args][1] #bs is start bar,the second parameter received
end
end
puts "BS selected is "+bs.to_s
##########################
#start polling for an OSC cue to stop playing from the Processing GUI sketch
#this runs continuously in a thread
in_thread do #this thread polls for an OSC cue to stop the program
tr=0
until tr==-1 #the first parameter will be set to -1 for a STOP signal
s=sync '/transport'
if version="v2.11.1" or ver[2].to_i > 11
tr=s[0]
bs=s[1]
else
tr=s[:args][0] #tr governs play/stop value is 1 for play -1 for stop
bs=s[:args][1] #bs is start bar,the second parameter received
end
end
#stop command detected
puts"stopping"
puts "running sonic pi cli script to restart"
system(restart+" &") #run the auto script to stop and rerun the code
end
##########################
with_fx :reverb, room: 0.8 do
with_fx :level,amp: 0.7 do
#part 1 data
a1=[]
b1=[]
a1[0]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a1[1]=[:e4,:f4,:g4,:e4,:f4,:g4]
a1[2]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a1[3]=[:c4,:g3,:c4,:c4,:g3,:c4]
a1[4]=[:r]*8
a1[5]=[:r]*8
a1[6]=[:r]*8+a1[0]
a1[7]=a1[1]
a1[8]=a1[2]
a1[9]=a1[3]
a1[10]=a1[4]
a1[11]=a1[5]
a1[12]=[:r]*8
b1[0]=[1,1,1,1,1,1,1,1]
b1[1]=[1,1,2,1,1,2]
b1[2]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b1[3]=[1,1,2,1,1,2]
b1[4]=[1]*8
b1[5]=[1]*8
b1[6]=[1]*8+b1[0]
b1[7]=b1[1]
b1[8]=b1[2]
b1[9]=b1[3]
b1[10]=b1[4]
b1[11]=b1[5]
b1[12]=[1]*8
c1=[100,120,140,160,180,200,220,200,180,160,140,120,100]
###################### calculate starting data
#calc bar offset for start of each tempo change. Held in bNumberSecStart list
bNumberSecStart=[]
bNumberSecStart[0]=0
bNumber=0
b1.length.times do |z|
bNumber+= numbeats(b1[z])/bpba[z]
bNumberSecStart[z+1]=bNumber
end
#puts bNumberSecStart #for debugging
#calc number of bars inthe piece
bmax=bNumberSecStart[b1.length]
puts "Total number of bars="+bmax.to_s
#adjust requested bar start number if too large
if bs>bmax
bs=bmax
puts "Start bar exceeds piece length: changed to :"+bs.to_s
end
#calculate info for starting sector containing bar start requested,
#and number of remaining bars to process to get starting index
st=startDetails(bs,bNumberSecStart,b1)
startSec=st[0]
remainingBars=st[1]
puts "Start Section="+st[0].to_s
puts "Remaining Bars to find starting index="+st[1].to_s
puts
################### now ready to process an play each part in turn (played together in threads)
#each part is processed in exactly the same way
#calc starting index and any sleep for tied notes for part 1
sv1=getmatchd(remainingBars,bpba[startSec],b1[startSec])
puts "1: "+sv1.to_s #print start index and sleep time
use_synth :beep
in_thread do
for i in startSec..a1.length-1
use_bpm c1[i]
sleep sv1[1] #sleep for tied note (>0 if tied)
for j in sv1[0]..a1[i].length-1
play a1[i][j],sustain: b1[i][j]*0.9,release: b1[i][j]*0.1,pan: p1
sleep b1[i][j]
end
sv1=[0,0] #reset so subsequent iterations of j loop in full and no tied sleep
end
end
a2=[]
b2=[]
a2[0]=[:r]*8
a2[1]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a2[2]=[:e4,:f4,:g4,:e4,:f4,:g4]
a2[3]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a2[4]=[:c4,:g3,:c4,:c4,:g3,:c4]
a2[5]=[:r]*8
a2[6]=[:r]*8+a2[0]
a2[7]=a2[1]
a2[8]=a2[2]
a2[9]=a2[3]
a2[10]=a2[4]
a2[11]=a2[5]
a2[12]=[:r]*8
b2[0]=[1]*8
b2[1]=[1,1,1,1,1,1,1,1]
b2[2]=[1,1,2,1,1,2]
b2[3]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b2[4]=[1,1,2,1,1,2]
b2[5]=[1]*8
b2[6]=[1]*8+b2[0]
b2[7]=b2[1]
b2[8]=b2[2]
b2[9]=b2[3]
b2[10]=b2[4]
b2[11]=b2[5]
b2[12]=[1]*8
c2=[100,120,140,160,180,200,220,200,180,160,140,120,100]
#calc starting index and any sleep for tied notes for part 2
sv2=getmatchd(remainingBars,bpba[startSec],b2[startSec])
puts "2: "+sv2.to_s #print start index and sleep time
use_synth :blade
in_thread do
for i in startSec..a2.length-1
use_bpm c2[i]
sleep sv2[1] #sleep for tied note (>0 if tied)
for j in sv2[0]..a2[i].length-1
play a2[i][j],sustain: b2[i][j]*0.9,release: b2[i][j]*0.1,pan: p2
sleep b2[i][j]
end
sv2=[0,0] #reset so subsequent iterations of j loop in full and no tied sleep
end
end
a3=[]
b3=[]
a3[0]=[:r]*8
a3[1]=[:r]*8
a3[2]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a3[3]=[:e4,:f4,:g4,:e4,:f4,:g4]
a3[4]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a3[5]=[:c4,:g3,:c4,:c4,:g3,:c4]
a3[6]=[:r]*8+a3[0]
a3[7]=a3[1]
a3[8]=a3[2]
a3[9]=a3[3]
a3[10]=a3[4]
a3[11]=a3[5]
a3[12]=[:r]*8
b3[0]=[1]*8
b3[1]=[1]*8
b3[2]=[1,1,1,1,1,1,1,1]
b3[3]=[1,1,2,1,1,2]
b3[4]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b3[5]=[1,1,2,1,1,2]
b3[6]=[1]*8+b3[0]
b3[7]=b3[1]
b3[8]=b3[2]
b3[9]=b3[3]
b3[10]=b3[4]
b3[11]=b3[5]
b3[12]=[1]*8
c3=[100,120,140,160,180,200,220,200,180,160,140,120,100]
#calc starting index and any sleep for tied notes for part 3
sv3=getmatchd(remainingBars,bpba[startSec],b3[startSec])
puts "3: "+sv3.to_s #print start index and sleep time
use_synth :tri
in_thread do
for i in startSec..a3.length-1
use_bpm c3[i]
sleep sv3[1] #sleep for tied note (>0 if tied)
for j in sv3[0]..a3[i].length-1
play a3[i][j],sustain: b3[i][j]*0.9,release: b3[i][j]*0.1,pan: p3
sleep b3[i][j]
end
sv3=[0,0] #reset so subsequent iterations of j loop in full and no tied sleep
end
end
a4=[]
b4=[]
a4[0]=[:r]*8
a4[1]=[:r]*8
a4[2]=[:r]*8
a4[3]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a4[4]=[:e4,:f4,:g4,:e4,:f4,:g4]
a4[5]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a4[6]=[:c4,:g3,:c4,:c4,:g3,:c4]+[:r]*6 #Tied note added here: to show how its dealt with start at bars 14 then 15
a4[7]=a4[1]
a4[8]=a4[2]
a4[9]=a4[3]
a4[10]=a4[4]
a4[11]=a4[5]
a4[12]=[:c4,:g3,:c4,:c4,:g3,:c4]
b4[0]=[1]*8
b4[1]=[1]*8
b4[2]=[1]*8
b4[3]=[1,1,1,1,1,1,1,1]
b4[4]=[1,1,2,1,1,2]
b4[5]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b4[6]=[1,1,2,1,1,4]+[1]*6 #Tied note added here: to show how its dealt with start at bars 14 then 15
b4[7]=b4[1]
b4[8]=b4[2]
b4[9]=b4[3]
b4[10]=b4[4]
b4[11]=b4[5]
b4[12]=[1,1,2,1,1,2]
c4=[100,120,140,160,180,200,220,200,180,160,140,120,100]
#calc starting index and any sleep for tied notes for part 4
sv4=getmatchd(remainingBars,bpba[startSec],b4[startSec])
puts "4: "+sv4.to_s #print start index and sleep time
use_synth :saw
in_thread do
for i in startSec..a4.length-1
use_bpm c4[i]
sleep sv4[1] #sleep for tied note (>0 if tied)
for j in sv4[0]..a4[i].length-1
play a4[i][j],sustain: b4[i][j]*0.9,release: b4[i][j]*0.1,pan: p4
sleep b4[i][j]
end
sv4=[0,0] #reset so subsequent iterations of j loop in full and no tied sleep
end
end
end #level
end #fx
#!/usr/bin/ruby
`/usr/local/bin/sonic_pi stop`
`/usr/local/bin/sonic_pi "run_file '~/Documents/SPfromXML/FrereJaquesControlled-RF.rb'"`
#4 Frere Jaques round played twice, speeds up then slows down
p1=-1;p2=-0.33;p3=0.33;p4=1
a1=[]
b1=[]
a1[0]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a1[1]=[:e4,:f4,:g4,:e4,:f4,:g4]
a1[2]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a1[3]=[:c4,:g3,:c4,:c4,:g3,:c4]
a1[4]=[:r]*8
a1[5]=[:r]*8
a1[6]=[:r]*8+a1[0]
a1[7]=a1[1]
a1[8]=a1[2]
a1[9]=a1[3]
a1[10]=a1[4]
a1[11]=a1[5]
a1[12]=[:r]*8
b1[0]=[1,1,1,1,1,1,1,1]
b1[1]=[1,1,2,1,1,2]
b1[2]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b1[3]=[1,1,2,1,1,2]
b1[4]=[1]*8
b1[5]=[1]*8
b1[6]=[1]*8+b1[0]
b1[7]=b1[1]
b1[8]=b1[2]
b1[9]=b1[3]
b1[10]=b1[4]
b1[11]=b1[5]
b1[12]=[1]*8
c1=[100,120,140,160,180,200,220,200,180,160,140,120,100]
use_synth :beep
in_thread do
for i in 0..a1.length-1
use_bpm c1[i]
for j in 0..a1[i].length-1
play a1[i][j],sustain: b1[i][j]*0.9,release: b1[i][j]*0.1,pan: p1
sleep b1[i][j]
end
end
end
a2=[]
b2=[]
a2[0]=[:r]*8
a2[1]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a2[2]=[:e4,:f4,:g4,:e4,:f4,:g4]
a2[3]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a2[4]=[:c4,:g3,:c4,:c4,:g3,:c4]
a2[5]=[:r]*8
a2[6]=[:r]*8+a2[0]
a2[7]=a2[1]
a2[8]=a2[2]
a2[9]=a2[3]
a2[10]=a2[4]
a2[11]=a2[5]
a2[12]=[:r]*8
b2[0]=[1]*8
b2[1]=[1,1,1,1,1,1,1,1]
b2[2]=[1,1,2,1,1,2]
b2[3]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b2[4]=[1,1,2,1,1,2]
b2[5]=[1]*8
b2[6]=[1]*8+b2[0]
b2[7]=b2[1]
b2[8]=b2[2]
b2[9]=b2[3]
b2[10]=b2[4]
b2[11]=b2[5]
b2[12]=[1]*8
c2=[100,120,140,160,180,200,220,200,180,160,140,120,100]
use_synth :blade
in_thread do
for i in 0..a2.length-1
use_bpm c2[i]
for j in 0..a2[i].length-1
play a2[i][j],sustain: b2[i][j]*0.9,release: b2[i][j]*0.1,pan: p2
sleep b2[i][j]
end
end
end
a3=[]
b3=[]
a3[0]=[:r]*8
a3[1]=[:r]*8
a3[2]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a3[3]=[:e4,:f4,:g4,:e4,:f4,:g4]
a3[4]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a3[5]=[:c4,:g3,:c4,:c4,:g3,:c4]
a3[6]=[:r]*8+a3[0]
a3[7]=a3[1]
a3[8]=a3[2]
a3[9]=a3[3]
a3[10]=a3[4]
a3[11]=a3[5]
a3[12]=[:r]*8
b3[0]=[1]*8
b3[1]=[1]*8
b3[2]=[1,1,1,1,1,1,1,1]
b3[3]=[1,1,2,1,1,2]
b3[4]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b3[5]=[1,1,2,1,1,2]
b3[6]=[1]*8+b3[0]
b3[7]=b3[1]
b3[8]=b3[2]
b3[9]=b3[3]
b3[10]=b3[4]
b3[11]=b3[5]
b3[12]=[1]*8
c3=[100,120,140,160,180,200,220,200,180,160,140,120,100]
use_synth :tri
in_thread do
for i in 0..a3.length-1
use_bpm c3[i]
for j in 0..a3[i].length-1
play a3[i][j],sustain: b3[i][j]*0.9,release: b3[i][j]*0.1,pan: p3
sleep b3[i][j]
end
end
end
a4=[]
b4=[]
a4[0]=[:r]*8
a4[1]=[:r]*8
a4[2]=[:r]*8
a4[3]=[:c4,:d4,:e4,:c4,:c4,:d4,:e4,:c4]
a4[4]=[:e4,:f4,:g4,:e4,:f4,:g4]
a4[5]=[:g4,:a4,:g4,:f4,:e4,:c4,:g4,:a4,:g4,:f4,:e4,:c4]
a4[6]=[:c4,:g3,:c4,:c4,:g3,:c4]+a4[0]
a4[7]=a4[1]
a4[8]=a4[2]
a4[9]=a4[3]
a4[10]=a4[4]
a4[11]=a4[5]
a4[12]=[:c4,:g3,:c4,:c4,:g3,:c4]
b4[0]=[1]*8
b4[1]=[1]*8
b4[2]=[1]*8
b4[3]=[1,1,1,1,1,1,1,1]
b4[4]=[1,1,2,1,1,2]
b4[5]=[0.5,0.5,0.5,0.5,1,1,0.5,0.5,0.5,0.5,1,1]
b4[6]=[1,1,2,1,1,2]+b4[0]
b4[7]=b4[1]
b4[8]=b4[2]
b4[9]=b4[3]
b4[10]=b4[4]
b4[11]=b4[5]
b4[12]=[1,1,2,1,1,2]
c4=[100,120,140,160,180,200,220,200,180,160,140,120,100]
use_synth :saw
in_thread do
for i in 0..a4.length-1
use_bpm c4[i]
for j in 0..a4[i].length-1
play a4[i][j],sustain: b4[i][j]*0.9,release: b4[i][j]*0.1,pan: p4
sleep b4[i][j]
end
end
end
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress sonicPi;
float mx,my; //will hold mouse position
int bs = 1; //current bar start value
int tr = 0; //play stop control
boolean flag; //controls OSC sending: once per click
PFont f;
int expand = 70;
void setup(){
background(204);
frameRate(60);
size(240,120); //x value is 100 + 2*expand
oscP5 = new OscP5(this, 8000);
sonicPi = new NetAddress("127.0.0.1",4559);//////INSERT ADDRESS REQUIRED////////
// add click rectangles
fill(255); //fill white
rect(45+expand,15,10,10);//bs+
rect(45+expand,55,10,10);//bs=1
rect(45+expand,90,10,10);//bs-
fill(255,0,0);//fill red
//stop rect initially semi-hidden
fill(204);
rect(10+expand,55,10,10);//stop
//redraw it with no strke to get effect
noStroke();
rect(10+expand,55,10,10);//stop
stroke(0);
fill(255+expand,0,0);//fill red
rect(80+expand,55,10,10);//play
// Create the font
f = createFont("ArialNarrow-16.vlw", 12);
textFont(f);
textAlign(CENTER, CENTER);
//add screen captions
fill(0);
text("play",85+expand,40);
text("bs+",50+expand,4);
text("bs-",50+expand,105);
text("bs1",50+expand,72);
text("1",48+expand,40); //print initial "bs" value
}
void sendOscData(int tr,int bs) {
OscMessage toSend = new OscMessage("/transport");
toSend.add(tr);
toSend.add(bs);
oscP5.send(toSend,sonicPi);
//println(toSend);//for debugging
}
void draw() {
mx=mouseX;
my=mouseY;
if (mousePressed) {
if ((mx > 44+expand) && (mx <56+expand )&&(my > 89) && (my < 101)){//bs- clicked
bs-=1;
if (bs<1){
bs=1;
}
fill(0,255,0); //set green
rect(45+expand,90,10,10);//bs-
//println(bs);//for debugging
}
if ((mx > 44+expand) && (mx < 56+expand)&&(my >14) && (my<26)) {//bs+ clicked
bs+=1;
fill(0,255,0); //green
rect(45+expand,15,10,10);//bs+
//println(bs);//for debugging
}
if ((mx >44+expand)&&(mx<56+expand)&&(my>54) && (my<66)){//bs=1 clicked
bs=1;
fill(0,255,0); //set green
rect(45+expand,55,10,10);//bs=1
//println(bs);//for debugging
}
if ((mx >79+expand)&&(mx<91+expand)&&(my>54) && (my<66)){//play clicked
if(flag==false){ //only send OSC once per click
tr=1;
sendOscData(tr,bs);
flag=true;
//switch on stop rectangle in red
fill(255,0,0);
rect(10+expand,55,10,10);//stop
//switch off play rectangle
fill(204);
noStroke();
rect(80+expand,55,10,10);//play
//clear play text caption
rect(70+expand,34,28,16);//play text clear rect
//add stop text caption
fill(0);
text("stop",15+expand,40);
//println(tr); //for debugging
//println(bs);
}
}
if ((mx >9+expand)&&(mx<21+expand)&&(my>54) && (my<66)) {//stop clicked
if(flag==false){ //only send OSC once per click
tr=-1;
sendOscData(tr,bs);
flag=true;
//switch on play rectangle in red
fill(255,0,0);
rect(80+expand,55,10,10);//play
//switch off stop rectangle
fill(204);
noStroke();
rect(10+expand,55,10,10);//stop
//clear stop text caption
rect(1+expand,34,28,16);//stop text clear rect
//add play text caption
fill(0);
text("play",85+expand,40);
//println(tr); //for debugging
}
}
fill(204); //update bs number on the screen
noStroke(); //clear last entry with a background rectangle
rect(30+expand,32,35,16);
stroke(0); //change stroke colour to black
fill(0); //set fill to black
text(bs,48+expand,40); //print bs value
}
else { //mouse now released
flag=false; //reset flag to allow OSC sending
//reset "bs" green rectangle
fill(255); //set white
rect(45+expand,90,10,10);//bs-
rect(45+expand,15,10,10);//bs+
rect(45+expand,55,10,10);//bs=1
}
delay(50); //loop delay
}
#test communication with StartBarSelector processing GUI
define :ver do
return version.to_s.split('.')
end
loop do
v= version
tr=0
until tr==1
s=sync '/transport'
if version="v2.11.1" or ver[2].to_i > 11
tr=s[0]
bs=s[1]
else
tr=s[:args][0]
bs=s[:args][1]
end
puts "play/stop tr variable is "+tr.to_s
puts "bs bar start variable is "+bs.to_s
end
until tr==-1
s=sync '/transport'
if version="v2.11.1" or ver[2].to_i > 11
tr=s[0]
bs=s[1]
else
tr=s[:args][0]
bs=s[:args][1]
end
puts "play/stop tr variable is "+tr.to_s
puts "bs bar start variable is "+bs.to_s
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment