Giter VIP home page Giter VIP logo

arduino-usb-drum's Introduction

arduino-usb-drum

Main Image

This project began as an experiment with strain guages which eventually became a drum. Here, using strain guages instead of the typical piezo sensor for drums enables more flexible design, such as making a 3d-printable model. It runs on an Arduino Uno, which has its serial interface turned into a MIDI input using LoopMIDI and Hairless MIDI running on the computer, and feeds into Ableton Live. Everything required to recreate this project is provided, but the code requires calibration due to variability in construction.

Explanation

The "drum" is 3D printed with three functional sections: the base, the stem, and the face-plate. The base is clamped to a table, and while one taps out a rhythm on the face-plate, that force causes the stem to bend. That bending can be measured by the strain guages configured in a half bridge which is directly hooked into a differential amplifier. This signal is then fed into a simple peak detector in order to make a response curve that's easy to program for.

The program basically works like this:

  1. Because each input is bound to have a varied level of DC bias, the average of twenty samples is taken from each, which is subtracted from all future samples to compensate.
    • Because the circuit is prone to some noise, anything that falls in a certain range is eliminated and replaced with a zero.
  2. All samples are fed into what is, in effect, a circular buffer with a size of ten, which the newest sample is compared against to determine if there has been a hit. This is set up for each input.
  3. Once a hit has been determined for a certain input, the Arduino continually polls that input to determine a maximum value for a specific amount of time.
  4. The maximum value is mapped within the MIDI specification then sent over serial, along with whatever note number that input is assigned and the NOTE_ON header.

Components

The following are required per drum:

  • 3D-printed model
  • Strain guages (2) with lead wires
  • LM358 (1 per two inputs) and 0.1uF capacitor
  • 1N4148, or any standard diode
  • 10mH inductor, or a 10k resistor
  • 100 resistor (2)
  • 10k resistor (3)
  • 100k resisitor (2)
  • 0.1uF capacitor (2)
  • 10uF capacitor The following are required regardless of drum count:
  • Arduino Uno
  • 1000uF capacitor

Schematic

Schematic

Demonstration

arduino-usb-drum demonstration

TO-DO

  • Port program to the Arduino Pro Micro, which can be configured as a class-compliant USB MIDI device (or attempt to figure out V-USB or the micronucleus bootloader, which can be configured to do the same)
  • Eliminate peak detector with further programming
  • Go from half-bridge to quarter-bridge if possible
  • Update code to be more flexible with drums count up to six
  • Migrate from breadboard to PCB or perfboard to mitigate possible crosstalk

arduino-usb-drum's People

Contributors

colonelwatch avatar

Watchers

 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.