I’m working on a little project that already generated quite a lot of code (particularly as I like to use lots of comments, and split long lines for readability).
I’d like to split some of the setup code out to separate files to reduce clutter in the main script.
This doesn’t seem to be something that’s often done in Supercollider, which surprises me.
I’m aware it’s possible to save any object to a file, and load it back in again.
The downside of this approach seems to be that the saved object isn’t especially readable, or easily editable by hand (though it is just a raw text file).
I have read it’s also possible to read in a text file and execute any SCLang code it contains.
Is this a better approach, or does it create issues with the scope of variables etc. created by the script in the external document?
What I’m really looking for, I think is an equivalent to “include” or “require”, but I understand Supercollider lacks these.
What are other people doing to modularise their code?