[PD] [PD-dev] we now have Pd on Android!

chrism chris at mccormick.cx
Sun Jul 25 20:09:27 CEST 2010


> On Sun, Jul 25, 2010 at 7:55 AM, chrism <chris at mccormick.cx> wrote:
>> (I am hacking on a Pd + WebKit framework which should enable people to
>> put their patches on Android and build user interfaces for them using
>> HTML5 + Javascript, no need to recompile anything).

Ok, I've actually managed to get this working after a Sunday of hacking
(thanks again to the tremendous work by Peter Brinkmann). Here is the
code if you want to check it out:

<http://gitorious.org/~chr15m/pd-for-android/aurioid-pd-webkit>

If you have an Android device you can download the .apk file directly
from here:

<http://mccormick.cx/dev/Aurioid-debug.apk>

Try putting the Pd message "freq 220" into the textbox to get a taste
for what is going on.

Just to re-iterate what it is. This is Pd for Android with a WebKit
front-end. It should make it simple for media people to build Pd +
HTML/javascript instruments and package them as redistributable Android
apps. The audio backend is Pd patches, and the interface frontend is
regular old HTML, CSS, and javascript files.

The HTML/javascript is in "assets/index.html". The Pd file is in
"res/raw/test.pd".

To send a message to Pd you use the Javascript call "pd.send('my
message');" which is received by the receiver named '[r gui]' in your Pd
patch.

To send a message from Pd to the front end, use the sender '[s
android]' which calls the Javascript callback "pd_receive(msg)" in the
frontend.

There seems to be some latency between the frontend and Pd.

An example of what you could do with this: set up some HTML toggle
boxes, and use them to control a beat in Pd. Pd could send back a 'tick'
to indicate which toggle it's currently up to.

You can also trivially change the icons and name of the app if you
wanted to release your own Pd patch as a branded Android app.

I would love to build some Android-Pd-HTML-Javascript instruments now,
but it's 2am here and I have to work tomorrow.

Goodnight!

Chris.

PS incidentally, here is the Android device I am using:
<http://www.merimobiles.com/Witstech_A81_E_Android_2_1_WinCE6_0_Free_Case_p/meri0306.htm>
It has many flaws but it is playing simple Pd patches ok. :)

PPS Note on the license: I would love to release my contribution
(Aurioid.java) as GPLv3 but since it's 90% Peter's code, based on
PdServiceTest.java with some WebKit thrown in, I am not sure if it's
within my rights to change it from BSD. Opinions?

[Deeply ironic that you can't do this on an iPhone/iPad/iPod even
though Jobs is jonesing for HTML5. No problem. Keep your walled garden.]

-------------------
http://mccormick.cx



More information about the Pd-list mailing list