Anyone using Lemur? (On iOS)
Trying to get a fairly simple Lemur patch on my iPhone working before the end of the week, to replace a flaky Bluetooth controller for a performance. I've got all the pads sorted, but I need to use the accelerometer to control one fader (which seems to be the only way to get tilt data out of Lemur) which I'm then mapping to velocity & other functions in max.
As far as I can see, the way to do this is via scripting, but after most of a day trying to get my head around this I've gotten absolutely nowhere! (And no help forthcoming on the Liines forum either).
I'm thinking that maybe there are more script bunnies around Max!
So if there are any Lemur users who've also figured out scripting in that app, would you mind explaining to me how to use the accelerometer function to control a fader?
Thanks!
The accelerometer provides 3 values (for the x, y and z axes) so if you want to control one slider, you have to choose among accelerometer[0] for x axis, accelerometer[1] for y axis and accelerometer[2] for z axis.
However I don't think you need a slider to send these data. You could use a oscout message with a bundle:
oscout(0,'/accel',{accelerometer[0], accelerometer[1], accelerometer[2]});
You might create a script either with an "On Frame" execution or with "On Expression" and an expression such as "accelerometer[0] || accelerometer[1] || accelerometer[2]".
Sorry couldn't test but I think it should work.
Oh, and if you still want to control a Fader, it should be something like Myslider.x = accelerometer[0]
Thanks Roald,
Both of those work, and as I thought, the solution is very simple when you know how. Pity the docs don't make it that simple (I guess they assume a fair amount of knowledge to start with. I was trying to figure something out starting by declaring variables - obviously completely unnecessary)
The actual output of the accelerometer from Lemur though seems to be very "nervous" and keeps jumping to zero. Fortunately I remembered that TouchOSC also outputs accelerometer data (never used that data stream before!), and it's a _lot smoother/more stable (perhaps there's some software smoothing going on under the bonnet). So although it doesn't look as nice, I easily put together a little keyboard that is doing what I wanted. And I no longer have the connection issues I was having with the hardware (bluetooth) device that I was trying to use. (Pity though - it's nicer to press physical keys than virtual ones on an iPhone)
And one of these days, it would be nice to figure out how to get the Lemur app working properly.
thanks again...
David, did you know it's possible to transfer OSC messages over a USB connection ? At least it works between my iPad and a Mac computer. Also, it might be possible to smooth the accelerometer data. Basically, one would have to use an array as a circular buffer then compute the smoothed data with a lowpass- or median filter.
My feeling about Lemur is that the documentation provides the answers to most questions but sometimes one has to search a bit to gather the pieces.