Super Collider on Android

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Super Collider on Android

Postby redned » Tue Oct 19, 2010 9:14 am

Hi, first post in here.
Apologies if this post is in the wrong forum. As part of a third level project I am trying out sound syntheseis for an android app.

I heard that super collider has been made available for android. Has anyone on here any experience in setting it up with the eclipse plugin. I found a few instructions here http://github.com/glastonbridge/SuperCollider-Android/wiki/get-a-development-branchon github but I was unable to fully understand what to do. Steps 5 and 6 have me stumped.
I presume it means run that from the command line but I cannot find where I enter the command. Any info I have found, I couldn't use as my run configurations are different in eclipse.

Any help on this would be greatly appreciated.
redned
Freshman
Freshman
 
Posts: 2
Joined: Mon Oct 18, 2010 8:17 pm

Top

Re: Super Collider on Android

Postby b2063046 » Wed Oct 20, 2010 8:32 pm

redned wrote:Hi, first post in here.
Apologies if this post is in the wrong forum. As part of a third level project I am trying out sound syntheseis for an android app.

I heard that super collider has been made available for android. Has anyone on here any experience in setting it up with the eclipse plugin. I found a few instructions here http://github.com/glastonbridge/SuperCollider-Android/wiki/get-a-development-branchon github but I was unable to fully understand what to do. Steps 5 and 6 have me stumped.
I presume it means run that from the command line but I cannot find where I enter the command. Any info I have found, I couldn't use as my run configurations are different in eclipse.

Any help on this would be greatly appreciated.


Hi there!

So, I haven't tried to install all the things, but I can tell you how you can find the command line ;)

1. I think you're using windows? Press Ctrl+R and then type: cmd. This will start the command line.
2. so, you type there: cd/. This will bring you to the root of your hard drive
3. then find the full path to your "SuperCollider-Android" folder and type in cmd: cd "here that full path started with C:".
4. if you are there, type: /path/to/android-ndk-r4b-crystax/ndk-build


With "6" it means you have to change some java-file, i.e. putting a space and then re-build the project
b2063046
Freshman
Freshman
 
Posts: 7
Joined: Wed Oct 20, 2010 7:24 pm

Re: Super Collider on Android

Postby Coma » Sat Oct 15, 2011 5:10 pm

Hi there, this is my first post here! I've been searching a way to get started with supercollider on my Android Nexus One (currently version 2.3.6). Like it is mentioned above, I'm also trying to follow these steps (https://github.com/glastonbridge/SuperCollider-Android/wiki/get-a-development-branch).

I downloaded the NDK crystax, Cygwin and reached the part of compiling the files (ndk-build) being inside the projects folder. I had a little problem with one of the header files (glastonbridge-SuperCollider-Android-afd567c\jni\Headers\plugin_interface\SC_InlineUnaryOp.h).

It didn't seem to recognize the "std::isnan(x)" function:

Code: Select all
#include <cmath>
#include <math.h>
/////////////////////////////////////////////////////////////////
inline bool sc_isnan(float x)
{
#if (defined(__cplusplus) && defined(__GNUC__) && _GLIBCXX_HAVE_ISNAN)
   //return std::isnan(x);
   return isnan(x);
#else
   return (!(x >= 0.f || x <= 0.f));
#endif
}


I kinda fixed (in a dirty way) by adding a definition of "isnan" i found on the web (http://www.gnu.org/s/hello/manual/autoconf/Function-Portability.html):

Code: Select all
#include <cmath>
#include <math.h>
         
          #ifndef isnan
          #define isnan(x) \
              (sizeof (x) == sizeof (long double) ? isnan_ld (x) \
               : sizeof (x) == sizeof (double) ? isnan_d (x) \
               : isnan_f (x))
          static inline int isnan_f  (float       x) { return x != x; }
          static inline int isnan_d  (double      x) { return x != x; }
          static inline int isnan_ld (long double x) { return x != x; }
          #endif
///////////////////////////////////////////////////////////////////////////////////////

inline bool sc_isnan(float x)
{
#if (defined(__cplusplus) && defined(__GNUC__) && _GLIBCXX_HAVE_ISNAN)
   //return std::isnan(x);
   return isnan(x);
#else
   return (!(x >= 0.f || x <= 0.f));
#endif
}


After this modification I was able to compile it using
Code: Select all
/path/to/android-ndk-r4b-crystax/ndk-build
from inside the SuperCollider-Android directory ("glastonbridge-SuperCollider-Android-afd567c" in my case). After a minute or 2 of compiling, I built the project in Eclipse but just te second it launches on my device it "has stopped unexpectedly". So I have to force close it.

In LogCat I get the following error:
Code: Select all
10-15 17:55:28.438: ERROR/AndroidRuntime(17850): FATAL EXCEPTION: main
10-15 17:55:28.438: ERROR/AndroidRuntime(17850): java.lang.ClassCastException: android.os.BinderProxy
10-15 17:55:28.438: ERROR/AndroidRuntime(17850):     at net.sf.supercollider.android.SuperColliderActivity$ScServiceConnection.onServiceConnected(SuperColliderActivity.java:45)


Line 45 of SuperCollider Activity is the following:

Code: Select all
package net.sf.supercollider.android;

import net.sf.supercollider.android.ISuperCollider;
[..other imports..]

public class SuperColliderActivity extends Activity {
   private ServiceConnection conn = new ScServiceConnection();
   private ISuperCollider.Stub superCollider;
   private TextView mainWidget = null;
   
   /*
    * Gets us a SuperCollider service.
    */
   private class ScServiceConnection implements ServiceConnection {
      //@Override
      public void onServiceConnected(ComponentName name, IBinder service) {
         SuperColliderActivity.this.superCollider = (ISuperCollider.Stub) service; //<--Line 45
         try {
            // Kick off the supercollider playback routine
            superCollider.start();
            // Start a synth playing
            superCollider.sendMessage(OscMessage.createSynthMessage("default", 999, 0, 1));
            setUpControls(); // now we have an audio engine, let the activity hook up its controls
         } catch (RemoteException re) {
            re.printStackTrace();
         }
      }
      //@Override
      public void onServiceDisconnected(ComponentName name) {

      }
   }
   ....


I'm not sure if I maybe missed out on a step or I might have done something wrong.. :_(

I know this post has been inactive for a year, but I was hoping I could maybe find some directions here.

Sorry if I've made this a bit of a messy post!
Thank you in advanced.
Coma
Once Poster
Once Poster
 
Posts: 1
Joined: Sat Oct 15, 2011 4:38 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 5 guests