monkeyswarm / MobMuPlat

MobMuPlat is an iOS & Android app to host PureData patches with custom visual interfaces and hardware access.
www.mobmuplat.com
Other
182 stars 25 forks source link

adding 3rd party externals to MobMuPlat #21

Open batchku opened 7 years ago

batchku commented 7 years ago

Hi Daniel, Moving the email discussion here for clarity (mark down) and posterity.

I think i've quite close here. I'm following your recommendation; my external is called "resonators~":

and

#ifdef LIBPD_EXTRA
  bob_tilde_setup();
  bonk_tilde_setup();
  choice_setup();
  fiddle_tilde_setup();
  loop_tilde_setup();
  lrshift_tilde_setup();
  pique_setup();
  sigmund_tilde_setup();
  stdout_setup();
  resonators_tilde_setup();  //added by ali
#endif

My only question is: The last time i was doing this, i also had to add a line near the top of "MMPViewController.m" like this:

extern void expr_setup(void);
extern void bonk_tilde_setup(void);
extern void choice_setup(void);
extern void fiddle_tilde_setup(void);
extern void loop_tilde_setup(void);
extern void lrshift_tilde_setup(void);
extern void sigmund_tilde_setup(void);
extern void pique_setup(void);
extern void resonators_tilde_setup(void);  //added by ali

However, in the current version of MobMuPlat, "MMPViewController.m" no longer lists any of those externals. Is that because those externals are now included in pd 0.47.1?

batchku commented 7 years ago

Update:

It is not necessary to add anything to "MMPViewController.m". In order to include additional externals, only changes to "libpd/pure-data/extra/Makefile.am" and "libpd/libpd_rapper/z_libpd.c" are necessary. I am successfully running a 3rd party DSP on my iPhone now.

-ali

batchku commented 7 years ago

I'm now trying to repeat this process (of adding 3rd party externals) for Android and am running into troubles; it seems that the core pd engine on the android side is pre-built and binaries for the 3rd party externals are included in your repo.

Can you recommend a way to add 3rd party externals to the Android build?

monkeyswarm commented 7 years ago

Oops apologies for delay. When using the normal distribution of libd for android, it does indeed use a prebuilt binary in a remote repository, which has only the built-in objects. You'll have to instead set up a build of libpd and pure data as local dependencies, add the object code to the externals folder, and recompile using the NDK (which should output a series of .so files. Note that I heard there have been changes to NDK/C/C++ support within Android Studio recently, so this process may have changed).