1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- set :tC1, current_time
- oldT1 = 0
- set :tC2, current_time
- oldT2 = 0
- set :tC3, current_time
- oldT3 = 0
- latency = 0.2
- #use_sched_ahead_time 0.4
- #set_sched_ahead_time! 0.3
- live_loop :sample01 do
-
- use_sched_ahead_time latency
-
- a = sync "/osc/trigger/sample01"
- nowT = a[0]
- 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 a[1], amp: a[2]
- end
-
- end
- live_loop :sample02 do
-
- use_sched_ahead_time latency
-
- a = sync "/osc/trigger/sample02"
- nowT = a[0]
- 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 a[1], amp: a[2]
- end
-
- end
- live_loop :synth01 do
-
- use_sched_ahead_time latency
-
- a = sync "/osc/trigger/synth01"
- nowT = a[0]
- 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 a[1], note: a[2], cutoff: a[3], sustain: a[4], amp: 0.15
- end
-
- end
|