Do you have example of programs that launch, stop and mix different live_loops? It can be useful for using Sonic Pi as DAW.
def my_live_loop(name) in_thread do with_fx :level, amp:0 do |level_control| set name.to_s.concat("_level"), level_control loop do yield end end end end
And I use this wrapper to control loops volume in mix method:
def mix() set_volume! 1 control get["bd_level"], amp: 1.0 control get["snare2_level"], amp: 1.0 control get["algorave_level"], amp: 0.5 increase = linear_slide(0.0, 0.5, 33) 32.times do control get["bass_level"], amp: increase.tick(:bass) control get["algorave_level"], amp: 0.5 -increase.look(:bass) sleep 1 end ...
That kind of works and it is better than having a lot of sleeps in each thread but still I don’t think this is optimal solution.
Do you have any example of using Sonic Pi to fully program the track?