BelaPlatform / supercollider

an environment and programming language for real time audio synthesis and algorithmic composition
GNU General Public License v3.0
14 stars 8 forks source link

Include classes for projects #42

Open sensestage opened 7 years ago

sensestage commented 7 years ago

It would be good for each project to have:

This config-file can also be used for including downloaded quarks. This would also fix #38

sensestage commented 7 years ago

example of the format of the yaml file

includePaths:
    - /root/.local/share/SuperCollider/downloaded-quarks/arduino
    - /root/Bela/projects/myproject/classes
excludePaths:
    []
postInlineWarnings: false
sensestage commented 7 years ago

Startup sclang with:

sclang -l /root/Bela/Projects/myproject/sclang_config.yaml

sensestage commented 7 years ago

Suggested fix:

Default sclang_config.yaml-file in SuperCollider project (so template should have this in addition to _main.scd) with contents:

includePaths:
    []
excludePaths:
    []
postInlineWarnings: false

Change line 80 of Bela Makefile to: RUN_COMMAND?=sclang -l sclang_conf.yaml $(SUPERCOLLIDER_FILE) This will use the language configuration.

Then users can add to compile their own classes with SuperCollider code like this:

LanguageConfig.addIncludePath( File.getcwd ); // add the local directory to the language configuration.
LanguageConfig.store( "sclang_conf.yaml"); // store in the local directory

Note that the program has to run once to make the change to the language config file. Then the second time the program is run, the folder will be compiled.

It would be more elegant if Bela projects support subfolders from the Web IDE, then users can keep their class files nicely in folders.

This solution will also allow for Quarks to be installed via the SuperCollider interface for Quarks installation. (Although you may want to have internet access enabled for the Bela then to fetch quarks). Again, allowing for uploading folders will make usage easier. Then users can just add the folders with the Quarks they want to use from their laptop to the project, add them to the LanguageConfig like above, and keep it contained like that.

sensestage commented 5 years ago

same as #71