Skip to content

How to use your own Synthdefs

hedget edited this page Feb 12, 2011 · 9 revisions

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.

Define your synthdef

Use supercollider on your pc to generate a synthdef file. The file extension would be .scsyndef

Copy the synthdef in assets

Copy the file in your "assets" directory in your project manually.

Copy synthdef file to the sdcard

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" />

Start the synthdef in your code and make sound noise

See "Sending messages" in this tutorial to see how to create OscMessages to use your synthdef.

Clone this wiki locally