GithubHelp home page GithubHelp logo

sosciencety / arduino-midi-stepper-motor-instrument Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jzkmath/arduino-midi-stepper-motor-instrument

0.0 0.0 0.0 1.47 MB

This is an Arduino Project that uses A4988 stepper drivers with bipolar stepper motors along with the MIDI library to create sound.

License: GNU General Public License v3.0

C++ 55.62% C 44.38%

arduino-midi-stepper-motor-instrument's Introduction

Arduino-MIDI-Stepper-Motor-Instrument

This is an Arduino Project that uses A4988 stepper drivers with bipolar stepper motors along with the MIDI library to create sound.

Link to my Project on the Arduino Website HERE

UPDATE: I am working on a new version of the MIDI Stepper Synth that uses an FPGA, Custom PCBs and 32 Stepper Motors. Link HERE

Hardware:

  • Any Arduino board (Uno, Mega, Micro, Mini, etc)
  • NEMA 17 Stepper Motor or similar
  • A4988 Stepper Driver

I used an Arduino CNC Shield to control the stepper motors, so the code is preset for that pinout.

How to use:

Make sure you have the MIDI Arduino library installed in your IDE.

The Arduino code is designed so that it can expand to handle as many stepper motors as you need. I have put instructions on how to configure the code in the ino file.

You might want to use the TuneStepper code to check for your motor's resonant frequency (which will sound bad). For me, the notes that were around the resonant frequency were E3, F3, and F#3.

I have also put plenty of comments in the source code so that you can easily understand the code and what it does.

MIDI Communication

There are a few ways to communicate with the Arduino to send MIDI Data. You can:

USB MIDI Setup

If you want to configure your Arduino to be a USB MIDI Device, we need to change the firmware on the AVR chip. This chip's job is to convert the USB communication to serial data that the processor (the ATMEGA328 chip on an UNO). To make the computer see it as a MIDI device, we simply put a different firmware on the chip. I am using a custom compiled firmware called mocuLUFA that allows a dual boot option depending on the presense of a jumper on the ISCP header. One of the drawbacks of changing a firmware on the AVR chip is that you loose the ability to reprogram the 328 chip through the Arduino IDE. This method fixes that problem. So how do we do it?

  1. You will need to install the Atmel FLIP software

  2. Get the "midi_stepper.hex" file from the LUFA directory above. (or make your own custom hex file HERE)

  3. Open up both Atmel FLIP and the Device Manager

  4. Plug in the Arduino. It should appear on a COM port.

  5. Check your Arduino to see if you have an 8U2 or 16U2 chip. It is located here:

ad_layout 6. Put your Arduino in DFU Mode by briefly shorting the reset and ground pins, as shown in the picture:

ad_dfu The Arduino should then disappear from the device manager and appear as an unknown device.

  1. Right click on the unknown device in the device manager and choose "update driver". Specify the path to the driver, which is by default "C:/Program Files (x86)/Atmel/Flip x.x.x/usb" and be sure that "include subdirectory" is checked. After doing so, the device should rename to 8U2 or 16U2 in the device manager.

  2. in Atmel FLIP, go to "Device > Select" and choose the matching chip ("Atmega16U2" or "Atmega8U2")

  3. Go to "Settings > Communication > USB" then click "Open"

  4. Go to "File > Load HEX File" and choose the correct Hex file.

  5. Click "Run" and it should load the new code.

  6. Unplug and re plug in the Arduino and it should appear as "Midi Stepper" in the device manager.

If you want to enter USB Serial Mode, connect a jumper (while off) to the Arduino as follows:

ad_usbser And now it will act like an ordinary Arduino.

arduino-midi-stepper-motor-instrument's People

Contributors

jzkmath avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.