-
Notifications
You must be signed in to change notification settings - Fork 22
How to use your own Synthdefs
So you have manage to bind the supercollider project as a library project. The next question is obviously how do u make your own sounds. Basically the key here is defining your own supercollider synthdef files and using OscMessages to start, stop and parameterise it. Here are the steps on how to do it.
Synthdef files are not supercollider-android specific and can be thought of as "functions". Please read supercollider tutorials and about synthdefs if you do not know what they are.
Use supercollider on your pc to generate a synthdef file. The file extension would be .scsyndef
Copy the file in your "assets" directory in your project manually.
In your app, the synthdef file(s) should be copied from the assets directory to the sdcard into the directory named "/sdcard/supercollider/synthdefs/" by your app during runtime(for the first time). The supercollider classes will read it form there. The logic for creating the direcotry and copying files can be copied from the ScService onCreate() method.
Make sure that your application has permissions to write on the sdcard by declaring it in your AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
See "Sending messages" in this tutorial to see how to create OscMessages to use your synthdef.