Arduino Mega 2560 Error: 'usbMIDI' was not declared in this scope

Hi everyone,
I've never coded before, and I am trying to use a sketch uploaded by someone else to run a series of force sensitive resistors to trigger sounds. When trying to verify the code, I get the error "Error: 'usbMIDI' was not declared in this scope".
I have looked through this forum for similar issues and the two options:

  • replace usbMIDI with MIDIUSB (with the corresponding library downloaded) - a new error then appears, " Compilation error: exit status 1"
  • select usbMIDI from tools (not an available option)

The code I am trying to use is here KontrolFreak/VirusPad_04/VirusPad_04.ino at master · KontinuumLab/KontrolFreak · GitHub

Thank you for your help!!

you forgot to install USBMIDI library.

Hm, in this sketch not present line

#include "USBMIDI.h"

and no description or readme. how do you know what it is?

This is not the actual error. If you scroll up further, you'll probably see a message about the MIDIUSB library not supporting the Arduino MEGA.

Native MIDI over USB is not possible on the ATmega2560. You'll need something like Hairless MIDI, HIDUINO, or an external MIDI-to-USB adapter.

See Control Surface: MIDI over USB for details.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.