Smooth pitch bending using an Arduino + proximity sensor theremin?

leo alexander's icon

Hi there :)

I'm trying to build a theremin-style controller to have analogue control of a synth patch (ie: continuous pitch bending rather than just scrolling through the piano roll).

I've hooked up an Arduino to m4l and using a SR04 proximity sensor I'm able to control the frequency shifter audio effect, by mapping to the coarse and fine tuning (rather than the transpose parameter on the actual synth as this would only scroll through midi notes) , but I have a couple issues:

1. When mapping to frequency shifter the readings jump all over the place and it seems like I'm jumping between certain Hz values, rather than smoothly cycling through them. Can I adjust this in m4l so the scrolling is more smooth?

2. I found mapping to this plugin gave me way more control - http://www.maxforlive.com/library/device/1825/pitchbendautomation
Perhaps because the range you can bend is so much smaller (+/- 1 tone like a modwheel rather then accross the Hz spectrum). Is there a way to hack this plugin to extend the range it can bend or is that a restriction within Ableton? See attached for M4L diagram

If anyone could point me in the right direction that would be great :)

Cheers,

Leo