About "define" and the possibility to edit it

Hi there! Here is my question about “define”
I have created a new creation and inside there is a big block, a live_loop in fact.
When I recall it later, is it possible to edit it enterily, with “rptich” for instance (with an array) to change the pitches of all the notes inside my live_loop block in the same time? I have searched for documentation here and there but in vain…more generally, is it possible to edit a define when you call it?
Writing this f.i:

define :test do
live_loop :ab do
sleep x
end 

test rpitch: (ring with different values).tick

I hope my question is clear for you all.
Thanks for attention! :smile:

`

You can’t edit the contents of a function as such when you call it, but you can get somewhere close.
Each time you call the function it will recreate the live_loop, and you pass in some parameters that affect how it is created. For example:

use_bpm 80
use_synth :fm

define :test do |notes|
  live_loop :ab do
    play notes.tick
    sleep 0.5
  end
end

test (chord :c, :maj)
sleep 3
test (chord :e, :min)
1 Like

Thanks Emlyn @emlyn it’s cool :smile:…In fact from the call block, you edit directly inside the define block! That’s interesting to explore on that way using also different parameters.

1 Like