Using accelerometer to control multiball so it bounces?

Discuss Lemur and share techniques.
fourier
Newbie
Posts: 5
Joined: 27 Jan 2012 00:45

Using accelerometer to control multiball so it bounces?

Post by fourier »

Hi there,

I have a question regarding the accelerometer in combination with multiball.

I would like to control the multiball using the accelerometer in such a way that it if you tilt your iPad/iPhone the ball falls to the specific side of the screen in a straight line. However...I would like it to bounce to the side as if it hits the floor like a ping pong ball. If you tilt the iPad/iPhone to the other side the ball should follow.

At this moment I have the ball following the accelerometer using this script:

y=(accelerometer[0]*-1+1)/2;
x=(accelerometer[1]+1)/2;

But it doesn't bounce yet. Any ideas on how I could accomplice this?

Thanx!

Fourier
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: Using accelerometer to control multiball so it bounces?

Post by Phil999 »

that's a funny idea, but I believe this is not the way these elements are intended to use. Both multiball and accelerometer are input devices, separate input devices. They are here to use for a certain purpose, not to control each other. I understand the fun in moving the balls with the movement of the iPad, but I think you are missing the true purpose of those elements.

A ball moving along the physical movement of an iPad makes the ball an output device, which it isn't. Excuse my horrible English, but do you get my idea?
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
studioda
Newbie
Posts: 15
Joined: 23 Dec 2011 09:18
Location: france
Contact:

Re: Using accelerometer to control multiball so it bounces?

Post by studioda »

H!,
I want to know which data five by accelerometer .
accelerometer[0]= what,accelerometer[1]= what ,accelerometer[2]= what ???
and is it possible to translate accelerometer in {x,y,z} ????
fourier
Newbie
Posts: 5
Joined: 27 Jan 2012 00:45

Re: Using accelerometer to control multiball so it bounces?

Post by fourier »

Phil999 wrote:that's a funny idea, but I believe this is not the way these elements are intended to use. Both multiball and accelerometer are input devices, separate input devices. They are here to use for a certain purpose, not to control each other. I understand the fun in moving the balls with the movement of the iPad, but I think you are missing the true purpose of those elements.

A ball moving along the physical movement of an iPad makes the ball an output device, which it isn't. Excuse my horrible English, but do you get my idea?
Hi Phil,

I understand what you mean. It would be great if the Multiball object could be controlled via OSC so I can do the scripting on the computer. I have a script that does it for my Monome 64 which has also an accelerometer.

I guess I need to do some rethinking.
axel_liine
Liine Staff
Posts: 126
Joined: 14 Dec 2011 12:12

Re: Using accelerometer to control multiball so it bounces?

Post by axel_liine »

Well you can control the Multiball from the outside, by sending it /Multiball/x and /Multiball/y messages.
You could also simulate some physics using the accelerometer in the script engine, I'll try to come up with an example for you.
axel_liine
Liine Staff
Posts: 126
Joined: 14 Dec 2011 12:12

Re: Using accelerometer to control multiball so it bounces?

Post by axel_liine »

A short one as promised. Will make it more customizeable for the User Lib.
Attachments
gravity.jzml.zip
(1.33 KiB) Downloaded 304 times
fourier
Newbie
Posts: 5
Joined: 27 Jan 2012 00:45

Re: Using accelerometer to control multiball so it bounces?

Post by fourier »

Hi Axel,

Thats great!!!! It works like I wanted. Only reversed but will fiddle around with the code.

Thanx a million. I don't think I could have done this in this short time.

Fourier
studioda
Newbie
Posts: 15
Joined: 23 Dec 2011 09:18
Location: france
Contact:

Re: Using accelerometer to control multiball so it bounces?

Post by studioda »

and what about accelerometer[2] ?
fourier
Newbie
Posts: 5
Joined: 27 Jan 2012 00:45

Re: Using accelerometer to control multiball so it bounces?

Post by fourier »

studioda wrote:and what about accelerometer[2] ?
What do you mean?
studioda
Newbie
Posts: 15
Joined: 23 Dec 2011 09:18
Location: france
Contact:

Re: Using accelerometer to control multiball so it bounces?

Post by studioda »

fourier wrote:
studioda wrote:and what about accelerometer[2] ?
What do you mean?
I notice that all template which use accelerometer ,utilise only accelerometer[0] and accelerometer[1] but why not accelerometer[2]?
Post Reply