How do I use buffer tabs?

My questions are somehow getting even more embarrassing.

Where can I find documentation about the buffer tabs?

I just discovered them when I hit my buffer limit this morning.
Can I break up my code into these tabs?
Can I pass variables between them?
Are they synced (That one I think I answered by messing around, and it sounded like one waited for the other to get in time)?
Can I sync their BPMs (might just be a repeat of my passing variables question)?
Is there a keyboard shortcut to jump between them?

If these are all answered somewhere, please point my that direction and I’ll start digging. I searched the tutorial and this forum for “tab” and didn’t find these answers.

Thanks!

Have you tried ? :slight_smile:
the best solution sometimes is to test by yourself

the simplest solution is to type
run_file
In a buffer and the to drag the icon of the file contains your code just after that and it will insert the full pathname to your file there. When you press run it will run the file for you and there is no size limit set as for the buffer.

You can of course type in the file path directly.

run_file "/home/pi/Documents/myfile.rb"

However you can with certain constraints split a program between buffers. Live loops can run in any buffer, BUT there is a caveat, if they use variables imported from other parts of the program. This will work if you do it via the timeline.
eg if you have

notes=[:c4,:e4,:g4,:c5]

live_loop :test do
play notes.tick
sleep 1
end

That will only work if notes is defined in the same buffer as the live loop but

#put in buffer o and run
notes=[:c4,:e4,:g4,:c5]
set :notes,notes

#put in buffer 1 and run (without stopping buffer 0)
live_loop :test do
  notes=get(:notes)
  play notes.tick
  sleep 1
end

will work. Alternatively you could have notes defined in each buffer in which it is used, but the set get method is much better and less prone to error. I have done one or two large programs where I have used this technique over two or three buffers, but I usually now use the run_file solution. The only draw back is that it makes editing a bit more tedious, although in some cases you can copy and paste bits of a long program and test them separetely.

2 Likes

Boy did I try. But was so new to the concept that I didn’t even know if I was trying correctly. So upon not getting results, I came here. :slight_smile:

1 Like

Thanks again for the insight, @robin.newman. This is super useful.