Newbie question: How do you store your code?

Newbie question: How do you store your code?

Currently I’m using a Google Docs and paste code into: “MG learning Sonic Pi”

2 Likes

Hi

You can save your code using the save button. You will get a .rb file. Then you can load these files into buffers.

Good luck

2 Likes

Hi @Relaxnow, nlb is correct (if that’s the kind of question you were asking). Next to the playback buttons are the save and load buttons, for accessing files on your file system.

Incidentally, these details are also visible in the tutorial near the beginning under the chapter ‘exploring the interface’ :slightly_smiling_face:

1 Like

Thank you

I guess I feel kind of overwhelmed by the amount of code I produce and collect from other people to learn Sonic Pi and wondered how other people organize.

My system are: “copy to Google Docs” when buffer 0-9 are full.

Sure.
On our wishlist is the ability to save and load sets of files/buffers as projects. I’d like to think we’ll be able to get there one day :sweat_smile:

In the mean time, myself, I have Google drive connected to my computer, so that I can sync files to the cloud. This includes a sub-folder for Sonic Pi creations - so every time I save/load a buffer in Sonic Pi, I point the file picker at the Google Drive folder :slightly_smiling_face:
(One day, maybe we’ll manage to integrate cloud storage directly into the app too :man_shrugging: :crossed_fingers:)

2 Likes

I save them as gists

(a nice thing you get is syntax highlighting)

Gists are mentioned in sections 3.6 and B.3 of the built-in tutorial.

2 Likes

Hi, I also store my codes on Google docs. I find it useful for team work. I also suggest Code blocks extension for Google Docs: it formats the text in a code-like output, with highlight words and indentation. So it’more readable.
Bye, Leo

1 Like

I just save them in a normal folder inside my Mega folder, which makes them accessible from anywhere…

1 Like

Has there ever been talk of built-in git integration? Or does anyone have a workflow that allows use of GitHub for source control / history?

2 Likes

It depends what you mean by ‘git integration’.
Sonic Pi already stores each code run in a Git commit, so that buffer contents can be saved and reloaded when the app is closed and reopened - our wishlist includes plans to hopefully do lots more interesting things with these Git commits one day, such as being able to easily browse through and copy old buffer contents at will. It comes down to a question of priorities vs resources to actually get there though :slightly_smiling_face:

1 Like

I have upgraded my Google Docs for Sonic Pi code with formatting using “Block code” extension and organised in tables with headers from page 98.

2 Likes

I store mine in a folder and have that linked up to a GitHub repo :slight_smile:

2 Likes

Beginner workshop 220201 Sonic Pi beginner workshop links - Google Docs for my students

MG learning Sonic Pi 1 https://tinyurl.com/mgsonicpi
(About 300 pages of code, so takes time to load)

MG learning Sonic Pi 2 - this docs tinyurl.com/mgsonicpi2
Version2 docs for my journey with coding in Sonic Pi

Just to be completely different from everyoine else, I store my code in a Dropbox
public folder. This means whichever of my machines I’m working on I’ve got access
I also store samples on a public folder, this makes them easy to make available on the
forum, if I publish code with non-SP samples in.

Eli…

1 Like

@Eli

a public repo would be better no ? (history of changes etc.)