SuperCollider-Android
SuperCollider-Android copied to clipboard
Stuck with using new SynthDef
Hi,
supercollider-android is a wonderful project, I was able to run the demo application basically without a problem. However, I am having trouble defining a new Synth. If I'm not mistaken, I have to create a server-readable synth definition, which I am trying to accomplish within SuperCollider on my Mac like so:
( SynthDef("pantest", { |outbus=0, amp=1, freq=440, noise=0, pan = 0| var sona; var sonb; sona = XFade2.ar(SinOsc.ar(freq), PinkNoise.ar, noise); sonb = Pan2.ar(sona, pan); Out.ar(outbus, sonb * (amp)) } ).writeDefFile("/Users/csapoadam/Documents/Development/Android/ScanVoxSuperCollider/assets/"); )
(I have also tried it with store and copied the file into the assets folder from the synthdefs folder of SuperCollider.)
The scsyndef file "pantest.scsyndef" is indeed created, and I treat it in the android application code in just the same way as it was done for "default.scsyndef". I can also see that the the new scsyndef file is loaded onto my tablet, in the same supercollider/synthdefs folder.
Despite all of that, when I try to run superCollider.sendMessage(OscMessage.createSynthMessage("pantest", OscMessage.defaultNodeId, 0, 1));
I receive a "s_new FAILURE SynthDef not found" message.
I have tried all sorts of things (for example the original default.scsyndef file had executable permissions), but it makes no difference.
I would be grateful for any suggestions.
Thank you, Adam
I'm having trouble with this as well. I created a simple synthdef with SuperCollider, mySynth.scsyndef. I have a simple app that loads both the original default.scsyndef and mySynth.scsyndef onto my device and allows me to switch between the two. The default plays but mySynth doesn't.
I'm still digging into this looking for a solution....
It's not reading the synthdef files. Delete the file on the device, or write an empty default.scsyndef file, it still plays. It's just playing the internal default synth. Bummer. Back to the drawing board.
Hi Captaingnu, thanks for looking into this!
It's interesting that your app still played the default.scsyndef file after you deleted it - on my end this is different: when I delete the file from my tablet, the app becomes silent. Could it be that the file is copied/loaded to some internal place and was still available from there after you deleted the original copy?
After having experimented a bit, it seems to me now that the problem has to be with the way the synthdef file is created. At least when I tried to replace the old default.scsyndef file (the one that is working correctly) with a new one that has the same filename and same synthdef name, my app still wasn't able to load it (instead, there was only silence). So it seems that the problem might not be with a naming convention, but rather with the way that the .scsyndef file is generated...
Cheers, Adam
Thought of that too. I tried renaming the default file, no go. I rewrote the method that copies the def files from the assets folder to the device so that all the files in that directory get installed on the device.
Success! You were right. I tried rolling back to an older version of SuperCollider, generated my synthdef and now it works.
I'm running it on a Mac. I was using 3.6. Writing the synthdefs with Version 3.5 (.7) seems to work.
Carry on...
Oh, wow, congratulations! And thanks for doing that, I never would have thought I would need to use an older version of SuperCollider.
I will try doing that myself... how exciting!
On Sun, Nov 30, 2014 at 5:29 PM, captaingnu [email protected] wrote:
Success! You were right. I tried rolling back to an older version of SuperCollider, generated my synthdef and now it works.
I'm running it on a Mac. I was using 3.6. Writing the synthdefs with Version 3.5 (.7) seems to work.
Carry on...
— Reply to this email directly or view it on GitHub https://github.com/glastonbridge/SuperCollider-Android/issues/24#issuecomment-64990532 .
Great find! @csapoadam please update us with whether it works, a revised 3.6 version of SC-A would be the ideal fix but in the meantime we should at least make sure the workaround is documented.
Hi glastonbridge,
I have just tried using SuperCollider version 3.5.7 to generate the SynthDefs, and indeed I can confirm that they are now playing on my Android tablet.
Thanks for the hard work, and all the best, Adam