BelaPlatform / Bela

Bela: core code, IDE and lots of fun!
Other
489 stars 138 forks source link

(FEATURE) SuperCollider: Adding class and UGen files from the IDE #602

Open jreus opened 4 years ago

jreus commented 4 years ago

Hey all, this is a request for a new IDE feature. One very common thing to do for middle to advanced SuperColliders is the creation of code abstractions in the form of classes. Or the addition of custom UGens.

UGens are compiled .so files and classes are stored in .sc files, both need to be added to the SC extensions directory, which on the Bela is something like /usr/local/ext/SuperCollider/Extensions ... apologies but I don't have a Bela nearby to check the exact path, but needless to say it's outside of the core Bela directory.

Adding UGens and classes is done through scp direct from your host machine to the Bela ... this considerably complicates the SC-Bela workflow for people without command line experience ...

This is all a long backstory to say that it would be great if the IDE had an option to upload new UGen and class files directly to the SC Extensions directory. Possible? :-)

giuliomoro commented 4 years ago

scsynth provides this command line option:

   -U <ugen-plugins-path>
          A list of paths seperated by `:`.
          If specified, standard paths are NOT searched for plugins.

This means that any folder could become the Extensions folder, with the appropriate command line. I am thinking that maybe we could have a "dummy" project sc-extensions which we add by default to the path of scsynth. We could also add to this path the path to the current project and the system path, e.g.:

scsynth ... -U /usr/local/ext/SuperCollider/Extensions:/root/Bela/projects/sc-extensions:/root/Bela/projects/$MYPROJECT

This would be a similar behaviour to what we have currently, where a user can create a pd-externals dummy project where to store all the externals to be shared among Pd projects. These approaches are suboptimal, in that they use a dummy project, but have the advantage of keeping all user's extensions in a dedicated place, making it easy to track them and back them up.

I am not sure how extensions work for sclang, and your issue may be related to this one. I'd be also grateful if you could explain what sclang "classes" are what "quarks" are, that would help me get a better idea of the bigger picture.