1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- set :tC1, current_time
- oldT1 = 0
- set :tC2, current_time
- oldT2 = 0
- set :tC3, current_time
- oldT3 = 0
- latency = 0.3
- #use_sched_ahead_time 0.4
- #set_sched_ahead_time! 0.3
- live_loop :sample01 do
-
- use_sched_ahead_time latency
-
- a, b, c = sync "/osc*/trigger/sample01"
- nowT = a
- inc = nowT - oldT1
- oldT1 = nowT
- print inc
-
- delta = (get[:tC1] - current_time) + inc #0.25
- print delta
-
- if(delta > 0.1 )
- delta = 0
- end
- if(delta < -0.1 )
- delta = 0
- end
-
- time_warp delta do
- t = current_time
- set :tC1, t
- sample b, amp: c
- end
-
- end
- live_loop :sample02 do
-
- use_sched_ahead_time latency
-
- a, b, c = sync "/osc*/trigger/sample02"
- nowT = a
- inc = nowT - oldT2
- oldT2 = nowT
- print inc
-
- delta = (get[:tC2] - current_time) + inc #0.25
- print delta
- if(delta > 0.1 )
- delta = 0
- end
- if(delta < -0.1 )
- delta = 0
- end
-
- time_warp delta do
- t = current_time
- set :tC2, t
- print current_time
- sample b, amp: c
- end
-
- end
- live_loop :synth01 do
-
- use_sched_ahead_time latency
-
- a, b, c, d, e, f = sync "/osc*/trigger/synth01"
- nowT = a
- inc = nowT - oldT3
- oldT3 = nowT
- print inc
-
- delta = (get[:tC3] - current_time) + inc #0.25
- print delta
- if(delta > 0.1 )
- delta = 0
- end
- if(delta < -0.1 )
- delta = 0
- end
-
- time_warp delta do
- t = current_time
- set :tC3, t
- print current_time
- synth b, note: c, cutoff: d, sustain: e, amp: f
- end
-
- end
|