Hi all,
I have been working on a Bela project which is meant to be built upon some custom SC classes I've written, but unfortunately accessing these classes on the Bela doesn't seem to be as easy as throwing the .sc files into the project folder (I just get a "Class not defined" error). Any leads on how to go about adding custom classes? Maybe I'm missing something simple, but this has me stumped. Thanks in advance for any suggestions…

Cheers,
Mark

When installing supercollider on the board, a number of *.sc files go in /usr/local/share/SuperCollider/SCClassLibrary/, so maybe that's a good place to add yours, too?

3 months later

There should be a good place for extensions.
Normally this is:
.local/share/SuperCollider/Extensions
Or they can be added with a configuration file to sclang, passed on with -l
This last option would allow for creating a folder in a project with class files specifically for that project.

The library configfile has a yaml-like format, and would look like:

includePaths:
    -   /home/bela/path/to/project/project-scclasfiles
excludePaths:
    []
postInlineWarnings: false
3 years later

+1 for this. I have a SC project using custom classes I'm trying to port over that uses custom classes. Not sure quite what to do with the above information. How does one go about doing a new install of SC on bela if that's what I need to do?

Any help much appreciated!

Currently on Bela sclang is started with the -l /tmp/sclang.yaml flag. This should mean that if you edit that file and you add

includePaths:
    -   /root/Bela/projects/PROJECTNAME
excludePaths:
    []
postInlineWarnings: false

then it should look for .sc files in the PROJECTNAME project's folder. This file will get deleted every time the board is rebooted, but it should be a good starting point for testing. We can then look into changing that so that it includes a yaml file inside the project instead or a global one that doesn't get deleted every time at reboot.

As to how to edit that file, you can either ssh onto the board to edit it with your favourite editor, or you can create a symlink to it from your project so you can edit it in the Bela IDE. To do the latter, in the console at the bottom of the Bela IDE, run

ln -s /tmp/sclang.yaml /root/Bela/PROJECTNAME/sclang.yaml

(after replacing PROJECTNAME with the name of your current project)

a year later

Hey there! Are there any further developments on this?

"We can then look into changing that so that it includes a yaml file inside the project instead or a global one that doesn't get deleted every time at reboot."

Would be great to have custom classes for SC on a project base.

I just made a feat/sclang-conf branch here: https://github.com/BelaPlatform/Bela/tree/feat/sclang-conf). With these changes, sclang will load a sclang_conf.yaml file in the project folder. There you can put all your configurations. Are multiple files like this allowed to be loaded at once? I could then have multiple -l options to sclang so that there is also a global one, besides a project-specific one.

If you want to load a different file instead of the default one, pass the following option to make (it can be added to the "Make parameters" box in the IDE): SCLANG_YAML=/path/to/my/file.yaml. If you want to pass any other additional command line options to sclang, use SCLANG_CL= instead.

Anything else that I can help with? I am not really familiar with Supercollider so I am not sure what workflow is best and whether anything crucial is still missing.

In order to update your board to that branch to try out these changes, use the instructions updating to an experimental release here: https://learn.bela.io/using-bela/bela-techniques/updating-bela/#updating-to-an-experimental-release, using the zip archive you download at the link at the beginning of the post.