Results 1 to 6 of 6

Thread: Using Arduino for MIDI...

  1. #1
    mp Mezzo-Piano bnelson218's Avatar
    Join Date
    Aug 2011
    Location
    Toledo, Ohio
    Posts
    358

    Using Arduino for MIDI...

    I'm curious if anyone else has used Arduino processors for creating MIDI. I'm adding MIDI to the upper manual of my Hammond X77, and using an Arduino Mega to process the note on/note off data. It works and all 61 notes play but I've noticed some latency and polyphony issues. I'd like to hear from anyone else who has used these processors.
    Thanks,
    Bruce
    Over the years: Hammond M3, BC, M102, B3, four X77s and three PR-40s, a Thomas Electra and a Celebrity, three Fender Rhodes, Roland HS-10, HP-2000, HP-600, RD-600, JV-880, a thing made by Korg (?), two Leslie 910s, 122, 257, 258, 247, two 142s, and three custom-built Leslies. Wow, way too much money spent!

  2. #2
    Administrator Admin's Avatar
    Join Date
    Jun 2003
    Location
    Arizona
    Posts
    3,187

    1 members found this post helpful.
    I've used Arduino board components for MIDI chores, but not keyboard encoding. I've also used the ATMega328p processor, used in the Uno and other Arduinos, in some of my own designs. The Allen MOS2 keyboard encoder that I designed, uses a PIC processor, similar in capabilities to an ATMega328p; however, it's coded in assembly language. It encodes 3 keyboards and the pedal board and implements a transposer. I would think that with a properly written program an Arduino Mega should be up to the task of functioning as keyboard encoder, especially so for a single keyboard.

    If optimizing software is not your thing, use a faster processor. I'd take a look at the Teensy 3.x series.

  3. #3
    mp Mezzo-Piano John Kinkennon's Avatar
    Join Date
    Apr 2009
    Location
    Vancouver, WA
    Posts
    354

    2 members found this post helpful.
    I just finished adding a capture system to a small Moller pipe organ using the Teensy 3.6. It's so easy to use and really fast so it would be a great choice to add midi for an entire console. There's no substitute for real time hardware and software experience, but at 180Mhz the main issue with the Teensy 3.6 may be slowing it down. The Teensy libraries I've used, SPI and EEPROM mainly, have been fast and reliable.

  4. #4
    mp Mezzo-Piano bnelson218's Avatar
    Join Date
    Aug 2011
    Location
    Toledo, Ohio
    Posts
    358

    I designed a 61 note keying system, which supplies note on/note off data to the Arduino, and uses 4066 bilateral switch ICs. The chips are pulled down to ground through a 1500 ohm resistor and LED. I've yet to do a run that these chips couldn't handle (maybe Joey D could, I suppose). But the Mega seems to lag at times, which has me wondering. I'll keep playing with sketch and lightening the code.

  5. #5
    mp Mezzo-Piano John Kinkennon's Avatar
    Join Date
    Apr 2009
    Location
    Vancouver, WA
    Posts
    354

    The Arduino debounce examples I've seen use simple inline delays for debouncing switch contacts. That is a huge potential slowdown as well as any use of conventional 5-pin MIDI. Try Teensyduino on a Teensy 3.6, use the Teensyduino timing functions such as elapsedMillis() which doesn't pause the entire program, or better yet poll the inputs continuously and debounce based on perhaps three or four closed or open readings in sequence. Also, the Teensy allows a simple changeover to USB-MIDI with its 200x or more speed increase so MIDI traffic never creates a delay.

  6. #6
    p Piano stefanv's Avatar
    Join Date
    Jul 2008
    Location
    Ontario, Canada
    Posts
    294

    1 members found this post helpful.
    I have very little experience personally with the Arduino ecosystem, but I have implemented a fully polyphonic synth a fully polyphonic synth using a Raspberry Pi. My first reaction upon seeing this thread is that even an Arduino would be more than fast enough to work as a keyboard encoder without introducing any noticeable latency.

    As John states above, debouncing correctly is the key (pun sort of intended) to not introducing latency. Naive debouncing algorithms wait until the key has been down for some period of time before acting on the key press. Likewise for the key release.

    One correct way to debounce is to act on the key press immediately, and then ignore any additional key presses that appear to happen during the debounce interval. The trick it to realize that for a bouncing key to register again, a key release first has to register. By ignoring any releases during the debounce interval, you ignore any bounces during that interval. This way, the note sounds as soon as you hit the key, but any bounces will not cause additional notes to sound. The only latency that ever shows up with this scheme is on the key release, but even that can be very short (around 1ms).

Similar Threads

  1. Convert old electronic organ to midi - With arduino
    By gislef in forum Electronic Organs
    Replies: 2
    Last Post: 11-18-2017, 01:02 PM
  2. Sequencing on-board my device - music sequencers with Arduino
    By vivitern in forum MIDI Devices & Software
    Replies: 0
    Last Post: 11-08-2017, 07:11 AM
  3. Replies: 4
    Last Post: 10-11-2017, 10:01 AM
  4. Origins of MIDI - Interview with Dave Smith (the Inventor of MIDI)
    By Momboc in forum MIDI Devices & Software
    Replies: 0
    Last Post: 08-04-2015, 11:58 PM
  5. midi consoles for virtual organ + real stops midi usb
    By dalest in forum Buy & Sell MIDI and Sound Equipment Archive
    Replies: 0
    Last Post: 02-04-2011, 05:22 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •