Go Down

Topic: MIDI and Arduino and Virtual MIDI Piano Keyboard (Read 3096 times) previous topic - next topic

dmacq

I'm trying to build a MIDI controller and have followed the instructions on the Ardunio MIDI tutorial website. 

But I can't seem to get the  VMPK program to recognize that my UNO is plugged in.

Specifically, in the MIDI setup menu, VMPK asks for a MIDI input connection, but the selection window is empty and there doesn't seem to be any way to select the UNO as the input device.

Has anyone else dealt with this issue?

Cheers
DMacQ

PieterP

Have a look at this article I wrote some time ago, it covers everything you need to know to build a MIDI controller. The parts about the Arduino Leonardo are outdated, but the info for the Uno should still be relevant.
The code for the library in step 13 can be found here: https://github.com/tttapa/MIDI_controller, as well as the documentation and installation instructions.
(I'm working on an update, but it's not finished yet.)

Hope this helps!
Pieter

dmacq

I'm not sure it solves my VMPK issue, but there's a lot of answers to other questions I've had.
Thanks for such a long and infomative post.
Cheers

DMacQ

Grumpy_Mike

VMPK is a virtual MIDI piano keyboard for Linux, Windows and OSX. It is not for an Arduino.

You need something to convert the serial data that the Arduino sends into a MIDI port. One such helper application is called "hairless" and can be used to make an Arduino talk MIDI.

PieterP

Hairless is a great tool for debugging and testing, but I like to have it somewhat more "plug 'N' play". That's why I use HIDUINO, it's explained in the links in my previous post. It's MIDI firmware for the ATmega16U2 (the second microcontroller on the Uno), it takes the Serial MIDI signal sent by the Arduino's main MCU (ATmega328P) and converts it to MIDI-over-USB. This means that the Arduino will be recognized as a USB MIDI device when you plug it in.

Pieter

Grumpy_Mike

Quote
That's why I use HIDUINO,
Really?
For a Uno adding it on involves replacing the bootloader therefore makes the changing of the code quite a faf to say the least. I certainly would not recommend it for a beginner.

PieterP

Really?
For a Uno adding it on involves replacing the bootloader
Not the bootloader, just the ATmega16U2 firware, it can be done over USB extremely easily:

Code: (Bash) [Select]
#!/bin/bash

cd "$(dirname "${BASH_SOURCE}")"

read -p "Are you sure you want to flash your ATmega16U2 with the HIDuino MIDI firmware? [Y/n]: " confirm
if [ "$confirm" = y ] || [ "$confirm" = Y ]
then
if [ ! -e arduino_midi.hex ]
then
echo "Downloading firmware: arduino_midi.hex ..."
wget --quiet "https://raw.githubusercontent.com/ddiakopoulos/hiduino/master/compiled_firmwares/arduino_midi.hex"
fi
echo "Erasing ..."
sudo dfu-programmer atmega16u2 erase
echo "Flashing arduino_midi.hex ..."
sudo dfu-programmer atmega16u2 flash arduino_midi.hex
echo "Resetting ..."
sudo dfu-programmer atmega16u2 reset
echo "Done."
fi

That's all, it literally takes 3 seconds.  :)

Under Windows, you even get a GUI if you use Atmel Flip. (But the drivers are a pain though).

If you're interested, full instructions can be found on my GitHub: https://github.com/tttapa/MIDI_controller#arduino-uno-or-mega. (I admit that the instructions for Windows look quite scary, but I tried to include every little step of the installation process, in reality it's not that hard.)

[...] therefore makes the changing of the code quite a faf to say the least.
That's why I do use Hairless during development, when I'm finished, I use HIDUINO.

Pieter

dmacq

Well, hairless seems to work well alright -- although it crashes a LOT.

If VMPK isn't an Arduino compatible application, then I would vote for revising the Midi tutorial at
https://www.arduino.cc/en/Tutorial/MidiDevice where it features prominently.
That would keep more newbies like myself sane for a slightly longer period.

Thanks very much everyone

DMacQ

PieterP

Well, hairless seems to work well alright -- although it crashes a LOT.
That's why I prefer HIDuino ;)

If VMPK isn't an Arduino compatible application, then I would vote for revising the Midi tutorial at
https://www.arduino.cc/en/Tutorial/MidiDevice where it features prominently.
That would keep more newbies like myself sane for a slightly longer period.
It is Arduino compatible, you just need Hairless or HIDuino for it to work with an Uno or a Mega. It just needs a MIDI device to talk to.

Pieter

Grumpy_Mike

Quote
although it crashes a LOT.
Odd, never crashed for me. But then I do use a Mac.  :)

Go Up