I’m working through some code on Sam’s MagPi resource. Here’s the code:
live_loop :moon_rise do
with_fx :echo, mix: 1, mix_slide: 8 do |fx|
control fx, mix: 1
notes = (scale :e3, :minor_pentatonic, num_octaves: 2).shuffle
sn = synth :prophet, sustain: 8, note: :e1, cutoff: 70, cutoff_slide: 8
control sn, cutoff: 130
control sn, note: notes.tick, pan: rrand(-1,1)
end end end
I’m confused about the |fx| at the end of the second line, and how it’s used in line 3. Specifically, what does setting the |fx| like that mean? Does it always have to be on the same line as the with_fx, and at the end? Is this a way to declare a variable and then use it in line 3?
Thanks in advance!