Little hacky thing for passing variables between buffers

Today in my jam session I was wanting to define variables for sample paths in one buffer and then use them in another one. But, I didn’t really want to set & get them, I wanted to just be able to put their names down.

So I did it like this:

samps = {
  bass_loop: '~\samplepath',
  shaker_loop: '~\samplepath' ,
  loud_city: '~\samplepath',
}.each do |k,v|
  define k.to_sym do
    return v

I had quite a few samples I was using in this session, so I didn’t wanna define them by hand.

I imagine there’s probably a simpler solution I completely missed :smiley:

1 Like

Hi :slight_smile:
may i ask why you dont want to use set/get ?
your solution looks great, i will test it soon, thx