Named Buffers / Buffer management

This discussion reminded me of a UX suggestion I have Syncing across buffers?

Having the ability to assign custom names to the buffers would be helpful. Nine things is a lot to keep track of (in human memory) unless you’ve developed a real system or experience around something. If I close down Sonic Pi and don’t get back to it (sadly) for a few days, or even a few hours, I’ve forgotten what is in all the buffers.

Out of curiosity - is there a motivation behind starting with nine buffers specifically? I know they’re all arbitrary but as a new user I’m always having a moment of asking myself which buffer to paste a piece of code into, and then flipping through each of them to assess which is the stalest / least interesting for replacing with. Of course, there’s nothing stopping each user from creating their own conventions (buffer 0 is “scratch”, buffer 1 is “main”, buffer 2 is “drums”…). Being able to label would cut down on some mental tax there.

I think some or all of these additions would help:

  • Allow for renaming buffers to a user-friendly label
  • Option to name buffers automatically based on loaded file name
  • Start with less buffers, ability to add more buffers as needed
  • Command to Reset all buffers
  • Default Buffers config - after a reset or new project, layout buffers according to user prefs (i.e. list of named buffers)

Thank you for your consideration and most of all for your great work!

Hi @perpetual_monday,

I completely agree with you. Named buffers and their extension, projects (saving and loading whole groups of named buffers) has been on my TODO list for quite a while. I will get round to it I promise.

The motivation behind a number of named buffers dates back to Sonic Pi’s first ever implementation. The original goal was just to build a tool to support a number of lessons, so I first gave it 7 buffers as the first pilot had 7 lessons. I then 0 indexed the buffer numbers at a later date to make it easier to explain indexing. Finally I added a couple more buffers because it simply gave people a little bit more room to play and it was easy to do. It’s definitely high time that this was all changed :slight_smile:

2 Likes

Loading / Saving a set of buffers would be brilliant. Already I’m using multiple buffers for each song and loading/saving as individual files e.g. ‘title 0.rb’, ‘title 1.rb’ etc. If just that could be automated it make things much easier and less error prone. That could be implemented with just a couple of new menu items and without having to define some new kind of project structure file.

For me, named buffers aren’t a big thing. The existing ability to put free-form comments at the top of each buffer/file are already fine.

18,000 thumbs up for this. I really need the ability to save all buffers together as a project (and name them).

Bryan