Play Music and Move Multiple Servos to The BPM

Status
Not open for further replies.

Ts123

New member
Hi,

I'd like to use a Teensy 4 or 3.6 (if it's better) to play music and coordinate multiple
servo's movements with the BPM (tempo) or the peak of the music that is being heard.
I know this is hard to do with fast music due to the latency of servos but
maybe I could use slow BPM music ?
Do I need FFT ?

Appreciate your help.
 
You could run your audio through the audio sheild and use the audio library to delay the music dynamically based on the bpm of the music to overcome the servo delay.
You could use the audio library for fft and do beat detection.
 
Thanks, sounds good.
Could you please elaborate your idea?
Any articles or links a rookie like me can refer to for the hardware and software ?
 
In terms of the servos, it might be simpler to move the majority of the servo processing off to a secondary board that handles the low level details of doing the pulse management, so it doesn't interfere with the sound processing.

For example:

If you wanted the simplest way the servo controller, you can use the Adafruit feather adapter, and their i2c featherwing. Note, the longer Teensy 3.6 means you have to mount the Teensy underneath the feather adapter:
 
The Audio and Servo libraries should work together well on Teensy 3.x and 4.0.

Interrupt priority levels are used, so the Servo library gets the low latency interrupt response it needs to create accurate pulses. Audio processing runs at a lower priority level.

You can also use PWMServo, to avoid any use of interrupts for the servo pulses.
 
Thank you all for your replies.

My servos are already connected and controlled by an Arduino Uno and two PCA9685 - 16 channel boards.
I thought of using Teensy 4 for playing the music and doing FFT, or maybe better to use a Teensy 3 since it has a SD card reader.

I'm really a newbie, need to find out first if I should play the music through powered speakers then pick up the sound with a
sound sensor module (no good since it will pick up any surrounding noise) or I can have my cake and it it too i.e. have a line for speakers and one for sound analysis.
 
Status
Not open for further replies.
Back
Top