Close
0%
0%

Stepper Synth

A Musical 4-Stepper Motor MIDI Box

Public Chat
Similar projects worth following
Based on the Arduino Uno - CNCv3 shield (4x DRV8825), this magical box acts as a MIDI instrument to windows and will play anything sent to it.

The purpose of this project page and its entries is to serve as a collection of all the performances that the box makes. Please see the "details" section below for details about the project itself.

Please let me know in the 'discussion' section or the comments below if you have any MIDIs you want to be played.

Demonstration of the Stepper Synth:

(Full playlist: https://www.youtube.com/playlist?list=PL2ooT_IbEkqMiinSHTkgUE5FmuR5s200x)

ALL project information is contained within this "details" section below, the project logs are recordings of the box playing music only :)


MIDI Implementation Information:

How do I send midi through the Arduino Uno serial link (from windows)?

Step 1: -->
Use "loopMIDI" to create a virtual midi device in the windows environment.
https://www.tobias-erichsen.de/software/loopmidi.html
Step 2: -->
Use "Hairless MIDI" to send midi data from your virtual loopmidi midi device (as a "MIDI In") to your Arduino Uno serial port. Make sure to set the serial baud rate in the preferences to match your Arduino code.
You will need to disable hairless to program your Arduino each and every time...
https://projectgus.github.io/hairless-midiserial/
Step 3: -->
Use "MIDIMapper" to force windows to output midi to your loopmidi virtual device.
https://coolsoft.altervista.org/en/midimapper
Step 4: -->
Play a midi file using anything in windows that would ordinarily play midi. I use Winamp.
https://www.winamp.com/
If you're using midi specific software that can select a midi device directly, you can skip step 3. Try Anvil studio:
https://www.anvilstudio.com/
OR for testing purposes you can use "VMPK" (a virtual midi keyboard) to send any note. Just make sure it is actually sending to the loopmidi device and not ignoring the now modified windows default.
https://vmpk.sourceforge.io/

If your Arduino board supports a native USB (and you are using the usb midi Arduino libraries) you can skip steps 1 and 2.

How do you process the midi information in the Arduino environment?

I used the "Arduino MIDI Library":
https://github.com/FortySevenEffects/arduino_midi_library
This library covers both the usage of the programming port (i.e. over 'serial') and the native USB port. The difference is only inserting the phrase 'USB' a couple of times for setup. The rest is the same.

How do you prepare a MIDI file to sound the best on a stepper synth?

Step 1: -->
Using "Anvil Studio" (mentioned above), I open the midi file and identify the key 4 tracks of the music. I then set these 4 tracks to channels 1, 2, 3 & 4 if it's that simple.
Step 2: -->
If more then one note at once is being played on a track (i.e. chords), I duplicate that track and use the "Track" > "Limit the number of notes played at one time..." option to play, say, the highest note and lowest note (opposite options for each of the identically duplicated tracks. This, of course, means you need another channel.
Step 3: -->
If you notice that there are tracks playing only at times when another track is not playing then combine them! Do this by setting both of those tracks to the same channel! All the steppers sound the same so they may as well play other parts if they're not in confliction! Even if they are, Anvil will choose the higher/lower note (I don't know which).
Step 4: -->
Transpose the entire song (or track only) up/down octaves to fall within the frequency range of the synth. Usually there is no lower limit. Higher frequency notes are hard to hit due to stepper torque requirements for rapid acceleration!
Step 5: -->
Modify the music! As there is no volume control for this implementation (though you could if you dynamically controlled the stepper current), you may want instrument solos to be louder. At those parts of the song only 1 or 2 channels will be playing and you can simply copy paste the music to the other channels so as to really exaggerate the solos.


Stepper Motor Control:

First of all, I'd love to give a shoutout to Jonathan Kayne who's work I originally based my project off of: https://www.hackster.io/JonJonKayne/arduino-midi-stepper-synth-d291ae
Although the software/hardware has changed from his implementation, I never would have tackled this project without his initial work that broke my fear of implementing midi into a project.

Hardware Implementation

The hardware used is actually functionally...

Read more »

Software.rar

The Arduino Uno code that runs the show. The structure is a bit strange as it was developed using the new "Arduino Pro" IDE. Rest assured you can grab the main code and header file to be used with the standard IDE.

RAR Archive - 322.40 kB - 07/18/2020 at 16:01

Download

Mechanical.rar

A collection of all the mechanical cad files relating the enclosure. I can't say they are organised too well so good luck...

RAR Archive - 44.95 MB - 07/18/2020 at 15:34

Download

MIDI Samples.rar

A selection of MIDI files that have been optimised for the 4-channel stepper motor experience.

RAR Archive - 40.37 kB - 07/18/2020 at 15:29

Download

  • 4 × Stepper Motors Nema 17 Stepper Motor 42BYGH 1.8 Degree 38MM 1.5A 42 Motor (17HS4401S) 42N.cm (60oz.in) 4-Lead
  • 4 × Stepper Motor Drivers DRV8825 Stepper Motor Driver Module with Heat Sink for 3D Printer Rrerap Ramps 1.4 A4988
  • 1 × Red/Black Multi-Core Cable For some internal wiring between switches, etc.
  • 4 × Female Spade Crimps 6.3mm For connecting to the switch.
  • 1 × Electrical Tape RED For sorting out the cabling nightmare.

View all 17 components

View all 14 project logs

Enjoy this project?

Share

Discussions

David Scholten wrote 07/20/2020 at 23:27 point

Thanks!

By tuning do you mean finding the resonant speeds? Unfortunately I only have 1 type of stepper motor, so I can't confirm. I did have some slight variation between the steppers I used though, but that could also be due to the stepper current being slightly different for each motor (sensitive set-point potentiometers). The variation wasn't enough to warrant differentiating the motors in software though.

  Are you sure? yes | no

Dan Maloney wrote 07/20/2020 at 20:21 point

That's really cool! Did you find that stepper by different manufacturers "tuned up" differently?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates