# FX Automation (reverb, echo etc)

**URL:** <https://in-thread.sonic-pi.net/t/fx-automation-reverb-echo-etc/1680>\
**Category:** Support, Help & Resources\
**Created:** [November 11, 2018, 12:04pm UTC](https://in-thread.sonic-pi.net/t/fx-automation-reverb-echo-etc/1680 "2018-11-11T12:04:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbarkovalev](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/gbarkovalev/32/781_2.png) [@gbarkovalev](https://in-thread.sonic-pi.net/u/gbarkovalev)\
**Post date:** [November 11, 2018, 12:04pm UTC](https://in-thread.sonic-pi.net/t/fx-automation-reverb-echo-etc/1680/1 "2018-11-11T12:04:51Z")

</div>

How to automate phase parameter ?

```
live_loop :foo do
  with_fx :echo, phase: 0.2 do
    use_synth :blade
    play 60, release: 0.1
    sleep 1
  end
end
```

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [November 11, 2018, 4:23pm UTC](https://in-thread.sonic-pi.net/t/fx-automation-reverb-echo-etc/1680/2 "2018-11-11T16:23:17Z")

</div>

YIf you mean how can you change it in a program while it is running here are some ways.

```ruby
defonce :setp do #set a value for :p ONCE on first run after Sonic Pi powers up
  set :p,0.2
end

live_loop :foo do # here is your live loop
#each time it runs fx is set up with :phase = current value in get(:p)
  with_fx :echo, phase: get(:p) do 
    use_synth :blade
    play 60, release: 0.1
    sleep 1
  end
end

#now follow three methods of control
#first uses a midi "knob" on a controller

live_loop :phaseMidi do
  b=sync "/midi/usb_oxygen_8_v2/3/1/control_change" #I used my midi keyboard. Substitute your controller
  if b[0]==91 #my controlleer k=knob affects control channel 91
    set :p,0.05+b[1]/127.0*0.15 #set value of :p according to knob position between 0.05 and 0.2
  end
end

#this liveloop uses an incoming OSC message to effect the contriol
live_loop :phaseOsc do
  b=sync "/osc/Main/fader*" #my osc message (from TouncOSC) was addressed to "/main/fader2"
#note "/osc" at beginning added by Sonic Pi and wild card * so any /Main/fader works eg fader3
  puts b[0]
  set :p,0.05+b[0]*0.15 #update value stored in :p
end

#easiest manual control, uncomment next line and run
#set :p, 0.1 #uncomment to set phase to 0.1 when you next run

#manual control this thread increases then decreases the pahse each time the program is run
#comment #stop to get it to work
in_thread do
  stop
  l=line(0.05,0.25,steps: 10)
  l.length.times do |i|
    set :p,l[i]
    sleep 2
  end
  sleep 2
  l=line(0.25,0.05,steps: 10)
  l.length.times do |i|
    set :p,l[i]
    sleep 2
  end
end

```

EDIT. I changed the code above as Actually I didn’t use the lv control variable and removed it.

All three methods of control midi osc and manual can be active at once. The latest to change wins  
defonce may be unfamiliar to you. It executes the code set :p,0.2 ONCE the first time the program is run, but not thereafter until Sonic Pi is restarted.

---

<div class="post-metadata">

**Author:** ![gbarkovalev](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/gbarkovalev/32/781_2.png) [@gbarkovalev](https://in-thread.sonic-pi.net/u/gbarkovalev)\
**Post date:** [November 15, 2018, 5:51pm UTC](https://in-thread.sonic-pi.net/t/fx-automation-reverb-echo-etc/1680/4 "2018-11-15T17:51:24Z")

</div>

Very cool method with OSC faders. Could you tell me how to bind parameters with OSC  
Im using Sound Stage Control[  
https://osc.ammd.net/  
 ](https://osc.ammd.net/) And can I control three parameters with one fader? The use of slides opts also helps. But I have not quite figured out how they work. Thank. Nice.

```
with_fx :gverb , mix: 0 , mix_slide: 5 do |s|
  sample "C:/CNTRL_Sylenth_ArenaBreakdownSynth_Cm_Dry.wav" ##| any loop that lasts 4 seconds or more.
  sleep 1
  control s, mix: 0.8
end
```

---

<div class="post-metadata">

**Author:** ![binarysweets](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/binarysweets/32/2683_2.png) [@binarysweets](https://in-thread.sonic-pi.net/u/binarysweets)\
**Post date:** [November 18, 2018, 10:55pm UTC](https://in-thread.sonic-pi.net/t/fx-automation-reverb-echo-etc/1680/5 "2018-11-18T22:55:42Z")

</div>

It depends on what you’re doing but I always like using tick and look:

```
live_loop :automation do
  phase = (line 0.2, 1, steps: 8)
  
  with_fx :echo, phase: phase.tick do
    sample :bd_fat
  end
  
  sleep 1
end
```
