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

1 Like

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?

1 Like

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.

1 Like

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

2 Likes