So i used mobile.processing for the first time last night. Great stuff. Made a quick and easy live synth for my phone. It's relatively responsive, considering...
Sketch has been tested and working on a Sony Ericsson K610i
[expand / collapse code]EDIT: fixed up the code (from pasting into HTML), thanks Benoch for pointing that one out!/* Simple Live Instrument (for mobile phone)
by Sebastian Tomczak
12 June 2007, Adelaide, Australia
*/
import processing.sound.*;
int keyvalue = 0;
int[] pitches = {
57, 59, 60, 62, 64, 65, 67, 69, 71};
void draw() {
}
void keyPressed() {
if(key >= '1' && key <= '9') {
keyvalue = key - '1';
keyvalue = pitches[keyvalue];
Sound.playTone(keyvalue, 100, 100);
}
}
8 comments:
I test it on my Sony Ericsson k700i.
It works but I must change code's row:
if(key >= '1' &&amp; key <= '9') {
into:
if(key >= '1' && key <= '9') {
I test it on my Sony Ericsson K700i.
It works, but I had to change this row's code:
if(key >= '1' &&amp; key <= '9') {
into:
if(key >= '1' && key <= '9') {
Good!
whoops! this is a mistake from copying yhe code into HTML! my apologies.
cheers,
seb
will give this a go on my k750i
works fine on k750i
cool.
its good to hear that it works on your phone. thanks for trying it out.
Worked just fine on my Sony Ericsson W810i. I am thinking with a bit more code this could get rather interesting.
Post a Comment