I want to use a 16 channel Midi Controller to control an animatronic project using servo motors. I want to save the PWM info on a wave file as I can and then convert it to usable PWM data to send to an H bridge amplifier to drive servos.
Any ideas on how to save the data and how to convert it back to usable PWM data?
Thanks
Mark
Hi,
From what we understand of MIDI controllers, they do not use sound files directly but instead produce a series of state using the MIDI protocol.
What would be possible is to use a small microcontroller that would receive the MIDI signal and then process it into a PWM.
Your desired series of signals (your “song”) would be played on that channel by your MIDI controller to the microcontroller board.
We recommend an Arduino-based microcontroller as there is probable much MIDI-related example code for this platform already (MIDI Note Player, Arduino MIDI Library, etc.).
Of course, this is not exactly a trivial project. You will need to find information about the MIDI protocol, implement an interpreter for the commands you need (there are most likely tutorials/examples to be found online already) and also create a MIDI-compatible “song” that represents your desired motions for the servomotors (positions).
Good luck!
Sincerely,
thank you Scharette,
yes, after much reading I figured that out. I will assign a note to the amount of travel. MIDI files can run at 30FPS so in 1/0th of a second I do not see too much travel happening. MIDI allows 128 notes with values from 0-127. will assign 1 half step for each note and use velocity for direction, 1 for positive movement 127 for negative movement.
I will process the midi channels with Teensy modules, one for each channel and then drive servos or steppers.
Thanks
It certainly sounds like you are on the right path!
This project sounds very interesting, we recommend you post some pictures/videos about when you have some progress. You can do so here.