Accel XYZ data for controlling audio playback

Hello experts,
I'm new but fascinated by the almighty Arduino platform. I'm excited to get my first completed project out of the way. But I'll need the community's help because I'm starting from the ground up!

I have a theory in which the x, y, z data changes from an accelerometer/compass sensor can be used to manipulate playback of audio in real-time. I'm sure that theory is ancient and many sound generators or effects units use that workflow already to achieve some cool results. But I want to build my own!

For example how can I make a 180,000ms audio track suddenly play in reverse (while already playing) during a drastic shift of position of a baton/stick controller that is equipped with a non-click button and an accel/compass on its tip--say, a change from -300 to - 200 (100 increments) on xAxis while using the speed in which those 100 increments were reached, lets say 1000ms, to change the current playback speed? The button would simply be a switch to allow the accel data to pass through and perform an action. Kind of like the scrubber tool for all the a/v editors out there.

My main roadblock is the formula needed to convert accel data into time. A second roadblock is constructing a formula or function that shifts playback speed/direction back to normal upon release of the button, after carrying the momentum build up from a combination of the speed in which the coordinates shifted as well as the release moment of the button during that motion--like the varying results of a turntable motor due to torque settings.

Supposed things needed:

I anticipate needing more stuff that I'm hoping you all can help suggest. Real-time results is key since my application is a performance-based device.

Thank you all in advance for reading and potentially helping. I look forward to your suggestions :astonished: :fearful:

I think you are being way over ambitious for a beginner.
The Arduino is not well suited to doing those things you want.
For the moment forget about control with fancy devices, you have your hands full just getting your audio to do what you want.
To get something to play backwards you have to load it all into memory and put the samples to a D/A in the reverse order. The arduino has 2K of memory, not enough for a quarter of a second of audio.
So to do this you need a lot of memory. You can't use MP3 because the processor is not fast enough to decode it.
A 180 second audio file at a sample rate of 10KHz will take 3.6 M of memory at two bytes per sample.

Your only hope is to get a Yun and hope that the dark side of Linux offers something.

Grumpy_Mike:
I think you are being way over ambitious for a beginner.

Thanks for the reply. It's the perfect first response. I do tend to aim high and I'm patient enough to enjoy every step of the way.

Grumpy_Mike:
To get something to play backwards you have to load it all into memory and put the samples to a D/A in the reverse order. The arduino has 2K of memory, not enough for a quarter of a second of audio.
So to do this you need a lot of memory. You can't use MP3 because the processor is not fast enough to decode it.
A 180 second audio file at a sample rate of 10KHz will take 3.6 M of memory at two bytes per sample.

This is great. I figured as much but neglected to mention. 180 seconds was just me reaching for best case scenarios but of course I'll be taking baby steps.

I'll crawl actually: how about getting an accelerometer or even a pot to control speed and direction of a timer. Would be nice to peak at code/formulas involved in accomplishing that.

Thanks.

how about getting an accelerometer or even a pot to control speed and direction of a timer

Timers only go in one direction on this processor.

You can do a bit of audio processing here:-
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/