MIDIUSB errors go on & on

I am writing a sketch for a MIDI keyboard, based on a sketch by Notes and Volts. I had made some modifications to the sketch and downloaded it to a Nano. This was working fine using the MIDI.h library.

I decided to try using MIDIUSB library, which threw up an error. I have now removed all reference to the MIDIUSB library but I'm still getting errors when compiling and each time I try compiling the errors increase.

I have tried another Nano, I have removed the IDE and reinstalled, I have tried compiling with the WiFi off and I have rewritten the code. I cannot get rid of the errors. Any suggestions would be gratefully received. I can provide a copy of the errors.

Welcome to the forum

You started a topic in the Uncategorised category of the forum when its description explicitly tells you not to

Your topic has been moved to a relevant category. Please be careful in future when deciding where to start new topics

let see

let see

Can we see the code. Other wise we can't help you. Sorry

Sorry about that. I haven’t used the forum before and I was a bit confused as to how to use it.

Regards John

Here it is:

#include <pitchToNote.h>

#include <MIDI.h>
#include "Controller.h"

/*************************************************************
  MIDI CONTROLLER

  by Notes and Volts
  www.notesandvolts.com

  Version 1.2 **Arduino UNO ONLY!**
 *************************************************************/

MIDI_CREATE_DEFAULT_INSTANCE();

//************************************************************
//***SET THE NUMBER OF CONTROLS USED**************************
//************************************************************
//---How many buttons are connected directly to pins?---------
byte NUMBER_BUTTONS = 2;
//---How many potentiometers are connected directly to pins?--
byte NUMBER_POTS = 0;
//---How many buttons are connected to a multiplexer?---------
byte NUMBER_MUX_BUTTONS = 0;
//---How many potentiometers are connected to a multiplexer?--
byte NUMBER_MUX_POTS = 0;
//************************************************************

//***ANY MULTIPLEXERS? (74HC4067)************************************
//MUX address pins must be connected to Arduino UNO pins 2,3,4,5
//A0 = PIN2, A1 = PIN3, A2 = PIN4, A3 = PIN5
//*******************************************************************
//Mux NAME (OUTPUT PIN, , How Many Mux Pins?(8 or 16) , Is It Analog?);


//Mux M1(10, 16, false); //Digital multiplexer on Arduino pin 10
//Mux M2(A5, 8, true); //Analog multiplexer on Arduino analog pin A0
//*******************************************************************


//***DEFINE DIRECTLY CONNECTED POTENTIOMETERS************************
//Pot (Pin Number, Command, CC Control, Channel Number)
//**Command parameter is for future use**

//Pot PO1(A0, 0, 1, 1);
//Pot PO2(A1, 0, 10, 1);
//Pot PO3(A2, 0, 22, 1);
//Pot PO4(A3, 0, 118, 1);
//Pot PO5(A4, 0, 30, 1);
//Pot PO6(A5, 0, 31, 1);
//*******************************************************************
//Add pots used to array below like this->  Pot *POTS[] {&PO1, &PO2, &PO3, &PO4, &PO5, &PO6};
Pot *POTS[] {};
//*******************************************************************


//***DEFINE DIRECTLY CONNECTED BUTTONS*******************************
//Button (Pin Number, Command, Note Number, Channel, Debounce Time)
//** Command parameter 0=NOTE  1=CC  2=Toggle CC **.
uint8_t upOctave = 4;
uint8_t dnOctave = 5;
uint8_t notes[] = {pitchC4, pitchD4};

Button BU1(2, 0, notes[0], 1, 5 );
Button BU2(3, 0, notes[1], 1, 5 );
//Button BU3(4, 0, 62, 1, 5 );
//Button BU4(5, 0, 63, 1, 5 );
//Button BU5(6, 0, 64, 1, 5 );
//Button BU6(7, 0, 65, 1, 5 );
//Button BU7(8, 1, 64, 1, 5 );
//Button BU8(9, 2, 64, 1, 5 );
//*******************************************************************
//Add buttons used to array below like this->  Button *BUTTONS[] {&BU1, &BU2, &BU3, &BU4, &BU5, &BU6, &BU7, &BU8};
Button *BUTTONS[] {&BU1, &BU2};
//*******************************************************************


//***DEFINE BUTTONS CONNECTED TO MULTIPLEXER*************************
//Button::Button(Mux mux, byte muxpin, byte command, byte value, byte channel, byte debounce)
//** Command parameter 0=NOTE  1=CC  2=Toggle CC **

//Button MBU1(M1, 0, 0, 70, 1, 5);
//Button MBU2(M1, 1, 1, 71, 1, 5);
//Button MBU3(M1, 2, 2, 72, 1, 5);
//Button MBU4(M1, 3, 0, 73, 1, 5);
//Button MBU5(M1, 4, 0, 74, 1, 5);
//Button MBU6(M1, 5, 0, 75, 1, 5);
//Button MBU7(M1, 6, 0, 76, 1, 5);
//Button MBU8(M1, 7, 0, 77, 1, 5);
//Button MBU9(M1, 8, 0, 78, 1, 5);
//Button MBU10(M1, 9, 0, 79, 1, 5);
//Button MBU11(M1, 10, 0, 80, 1, 5);
//Button MBU12(M1, 11, 0, 81, 1, 5);
//Button MBU13(M1, 12, 0, 82, 1, 5);
//Button MBU14(M1, 13, 0, 83, 1, 5);
//Button MBU15(M1, 14, 0, 84, 1, 5);
//Button MBU16(M1, 15, 0, 85, 1, 5);
//*******************************************************************
////Add multiplexed buttons used to array below like this->  Button *MUXBUTTONS[] {&MBU1, &MBU2, &MBU3, &MBU4, &MBU5, &MBU6.....};
Button *MUXBUTTONS[] {};

//*******************************************************************


//***DEFINE POTENTIOMETERS CONNECTED TO MULTIPLEXER*******************
//Pot::Pot(Mux mux, byte muxpin, byte command, byte control, byte channel)
//**Command parameter is for future use**

//Pot MPO1(M2, 0, 0, 1, 1);
//Pot MPO2(M2, 1, 0, 7, 1);
//Pot MPO3(M2, 2, 0, 50, 1);
//Pot MPO4(M2, 3, 0, 55, 2);
//Pot MPO5(M2, 4, 0, 50, 1);
//Pot MPO6(M2, 5, 0, 55, 2);
//Pot MPO7(M2, 6, 0, 50, 1);
//Pot MPO8(M2, 7, 0, 55, 2);
//Pot MPO9(M2, 8, 0, 50, 1);
//Pot MPO10(M2, 9, 0, 55, 2);
//Pot MPO11(M2, 10, 0, 50, 1);
//Pot MPO12(M2, 11, 0, 55, 2);
//Pot MPO13(M2, 12, 0, 50, 1);
//Pot MPO14(M2, 13, 0, 55, 2);
//Pot MPO15(M2, 14, 0, 50, 1);
//Pot MPO16(M2, 15, 0, 55, 2);
//*******************************************************************
//Add multiplexed pots used to array below like this->  Pot *MUXPOTS[] {&MPO1, &MPO2, &MPO3, &MPO4, &MPO5, &MPO6.....};
Pot *MUXPOTS[] {};
//*******************************************************************


void setup() {
  MIDI.begin(MIDI_CHANNEL_OFF);
   Serial.begin(9600);
  pinMode(upOctave, INPUT_PULLUP);
  pinMode(dnOctave, INPUT_PULLUP);
}

void loop() {
  if(digitalRead(upOctave) == LOW){
    updateOctaveUp();
  };
  
  if(digitalRead(dnOctave) == LOW){
    updateOctaveDown();
  };

  if (NUMBER_BUTTONS != 0) updateButtons();
  if (NUMBER_POTS != 0) updatePots();
  if (NUMBER_MUX_BUTTONS != 0) updateMuxButtons();
  if (NUMBER_MUX_POTS != 0) updateMuxPots();
}


//*****************************************************************
//Stub
void updateOctaveUp(){
  Serial.println("UP");
  delay(500);
};
//Stub
void updateOctaveDown(){
  Serial.println("DOWN");
  delay(500);
};

void updateButtons() {

  // Cycle through Button array
  for (int i = 0; i < NUMBER_BUTTONS; i = i + 1) {
    byte message = BUTTONS[i]->getValue();

    //  Button is pressed
    if (message == 0) {
      switch (BUTTONS[i]->Bcommand) {
        case 0: //Note
          MIDI.sendNoteOn(BUTTONS[i]->Bvalue, 127, BUTTONS[i]->Bchannel);
          break;
        case 1: //CC
          MIDI.sendControlChange(BUTTONS[i]->Bvalue, 127, BUTTONS[i]->Bchannel);
          break;
        case 2: //Toggle
          if (BUTTONS[i]->Btoggle == 0) {
            MIDI.sendControlChange(BUTTONS[i]->Bvalue, 127, BUTTONS[i]->Bchannel);
            BUTTONS[i]->Btoggle = 1;
          }
          else if (BUTTONS[i]->Btoggle == 1) {
            MIDI.sendControlChange(BUTTONS[i]->Bvalue, 0, BUTTONS[i]->Bchannel);
            BUTTONS[i]->Btoggle = 0;
          }
          break;
      }
    }

    //  Button is not pressed
    if (message == 1) {
      switch (BUTTONS[i]->Bcommand) {
        case 0:
          MIDI.sendNoteOff(BUTTONS[i]->Bvalue, 0, BUTTONS[i]->Bchannel);
          break;
        case 1:
          MIDI.sendControlChange(BUTTONS[i]->Bvalue, 0, BUTTONS[i]->Bchannel);
          break;
      }
    }
  }
}
//*******************************************************************
void updateMuxButtons() {

  // Cycle through Mux Button array
  for (int i = 0; i < NUMBER_MUX_BUTTONS; i = i + 1) {

    MUXBUTTONS[i]->muxUpdate();
    byte message = MUXBUTTONS[i]->getValue();

    //  Button is pressed
    if (message == 0) {
      switch (MUXBUTTONS[i]->Bcommand) {
        case 0: //Note
          MIDI.sendNoteOn(MUXBUTTONS[i]->Bvalue, 127, MUXBUTTONS[i]->Bchannel);
          break;
        case 1: //CC
          MIDI.sendControlChange(MUXBUTTONS[i]->Bvalue, 127, MUXBUTTONS[i]->Bchannel);
          break;
        case 2: //Toggle
          if (MUXBUTTONS[i]->Btoggle == 0) {
            MIDI.sendControlChange(MUXBUTTONS[i]->Bvalue, 127, MUXBUTTONS[i]->Bchannel);
            MUXBUTTONS[i]->Btoggle = 1;
          }
          else if (MUXBUTTONS[i]->Btoggle == 1) {
            MIDI.sendControlChange(MUXBUTTONS[i]->Bvalue, 0, MUXBUTTONS[i]->Bchannel);
            MUXBUTTONS[i]->Btoggle = 0;
          }
          break;
      }
    }
    //  Button is not pressed
    if (message == 1) {
      switch (MUXBUTTONS[i]->Bcommand) {
        case 0:
          MIDI.sendNoteOff(MUXBUTTONS[i]->Bvalue, 0, MUXBUTTONS[i]->Bchannel);
          break;
        case 1:
          MIDI.sendControlChange(MUXBUTTONS[i]->Bvalue, 0, MUXBUTTONS[i]->Bchannel);
          break;
      }
    }
  }
}
//***********************************************************************
void updatePots() {
  for (int i = 0; i < NUMBER_POTS; i = i + 1) {
    byte potmessage = POTS[i]->getValue();
    if (potmessage != 255) MIDI.sendControlChange(POTS[i]->Pcontrol, potmessage, POTS[i]->Pchannel);
  }
}
//***********************************************************************
void updateMuxPots() {
  for (int i = 0; i < NUMBER_MUX_POTS; i = i + 1) {
    MUXPOTS[i]->muxUpdate();
    byte potmessage = MUXPOTS[i]->getValue();
    if (potmessage != 255) MIDI.sendControlChange(MUXPOTS[i]->Pcontrol, potmessage, MUXPOTS[i]->Pchannel);
  }
}

and here are the error messages:

In file included from d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:17:0:
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:18:2: error: #error MIDIUSB can only be used with an USB MCU.
#error MIDIUSB can only be used with an USB MCU.
^~~~~
In file included from d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:17:0:
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:129:2: error: 'EndpointDescriptor' does not name a type; did you mean 'MIDIJackinDescriptor'?
EndpointDescriptor len; // 9
^~~~~~~~~~~~~~~~~~
MIDIJackinDescriptor
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:158:2: error: 'IADDescriptor' does not name a type; did you mean 'MIDI_EPDescriptor'?
IADDescriptor iad;
^~~~~~~~~~~~~
MIDI_EPDescriptor
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:160:2: error: 'InterfaceDescriptor' does not name a type; did you mean 'MIDI_ASInterfaceDescriptor'?
InterfaceDescriptor Audio_ControlInterface;
^~~~~~~~~~~~~~~~~~~
MIDI_ASInterfaceDescriptor
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:164:2: error: 'InterfaceDescriptor' does not name a type; did you mean 'MIDI_ASInterfaceDescriptor'?
InterfaceDescriptor Audio_StreamInterface;
^~~~~~~~~~~~~~~~~~~
MIDI_ASInterfaceDescriptor
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:212:1: error: expected class-name before '{' token
{
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:226:21: error: 'USBSetup' has not been declared
int getDescriptor(USBSetup& setup);
^~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:228:14: error: 'USBSetup' has not been declared
bool setup(USBSetup& setup);
^~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp: In member function 'int MIDI_::getInterface(uint8_t*)':
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:19:28: error: 'pluggedInterface' was not declared in this scope
#define MIDI_AC_INTERFACE pluggedInterface // MIDI AC Interface
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:44:9: note: in expansion of macro 'MIDI_AC_INTERFACE'
D_IAD(MIDI_AC_INTERFACE, 2, MIDI_AUDIO, MIDI_AUDIO_CONTROL, 0),
^~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:19:28: note: suggested alternative: 'getInterface'
#define MIDI_AC_INTERFACE pluggedInterface // MIDI AC Interface
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:44:9: note: in expansion of macro 'MIDI_AC_INTERFACE'
D_IAD(MIDI_AC_INTERFACE, 2, MIDI_AUDIO, MIDI_AUDIO_CONTROL, 0),
^~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:44:3: error: 'D_IAD' was not declared in this scope
D_IAD(MIDI_AC_INTERFACE, 2, MIDI_AUDIO, MIDI_AUDIO_CONTROL, 0),
^~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:45:3: error: 'D_INTERFACE' was not declared in this scope
D_INTERFACE(MIDI_AC_INTERFACE,0,MIDI_AUDIO,MIDI_AUDIO_CONTROL,0),
^~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:45:3: note: suggested alternative: 'D_AS_INTERFACE'
D_INTERFACE(MIDI_AC_INTERFACE,0,MIDI_AUDIO,MIDI_AUDIO_CONTROL,0),
^~~~~~~~~~~
D_AS_INTERFACE
In file included from d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:17:0:
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:22:27: error: 'pluggedEndpoint' was not declared in this scope
#define MIDI_ENDPOINT_OUT pluggedEndpoint
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:191:10: note: in definition of macro 'D_MIDI_JACK_EP'
{ 9, 5, _addr,_attr,_packetSize, 0, 0, 0}
^~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:53:35: note: in expansion of macro 'MIDI_ENDPOINT_OUT'
D_MIDI_JACK_EP(USB_ENDPOINT_OUT(MIDI_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,MIDI_BUFFER_SIZE),
^~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:53:18: error: 'USB_ENDPOINT_OUT' was not declared in this scope
D_MIDI_JACK_EP(USB_ENDPOINT_OUT(MIDI_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,MIDI_BUFFER_SIZE),
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:191:10: note: in definition of macro 'D_MIDI_JACK_EP'
{ 9, 5, addr,attr,packetSize, 0, 0, 0}
^~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:53:18: note: suggested alternative: 'MIDI_ENDPOINT_OUT'
D_MIDI_JACK_EP(USB_ENDPOINT_OUT(MIDI_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,MIDI_BUFFER_SIZE),
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:191:10: note: in definition of macro 'D_MIDI_JACK_EP'
{ 9, 5, addr,attr,packetSize, 0, 0, 0}
^~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:53:54: error: 'USB_ENDPOINT_TYPE_BULK' was not declared in this scope
D_MIDI_JACK_EP(USB_ENDPOINT_OUT(MIDI_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,MIDI_BUFFER_SIZE),
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:191:16: note: in definition of macro 'D_MIDI_JACK_EP'
{ 9, 5, addr,attr,packetSize, 0, 0, 0}
^~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:55:18: error: 'USB_ENDPOINT_IN' was not declared in this scope
D_MIDI_JACK_EP(USB_ENDPOINT_IN(MIDI_ENDPOINT_IN),USB_ENDPOINT_TYPE_BULK,MIDI_BUFFER_SIZE),
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:191:10: note: in definition of macro 'D_MIDI_JACK_EP'
{ 9, 5, addr,attr,packetSize, 0, 0, 0}
^~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:55:18: note: suggested alternative: 'MIDI_ENDPOINT_IN'
D_MIDI_JACK_EP(USB_ENDPOINT_IN(MIDI_ENDPOINT_IN),USB_ENDPOINT_TYPE_BULK,MIDI_BUFFER_SIZE),
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:191:10: note: in definition of macro 'D_MIDI_JACK_EP'
{ 9, 5, addr,attr,packetSize, 0, 0, 0}
^~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:58:9: error: 'USB_SendControl' was not declared in this scope
return USB_SendControl(0, &midiInterface, sizeof(midiInterface));
^~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp: At global scope:
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:61:19: error: 'bool MIDI
::setup' is not a static data member of 'class MIDI
'
bool MIDI
::setup(USBSetup& setup attribute((unused)))
^~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:61:19: error: 'USBSetup' was not declared in this scope
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:61:19: note: suggested alternative: 'setup'
bool MIDI
::setup(USBSetup& setup attribute((unused)))
^~~~~~~~
setup
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:67:26: error: 'int MIDI
::getDescriptor' is not a static data member of 'class MIDI
'
int MIDI
::getDescriptor(USBSetup& setup attribute((unused)))
^~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:67:26: error: 'USBSetup' was not declared in this scope
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:67:26: note: suggested alternative: 'setup'
int MIDI
::getDescriptor(USBSetup& setup attribute((unused)))
^~~~~~~~
setup
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp: In member function 'void MIDI
::accept()':
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:22:27: error: 'pluggedEndpoint' was not declared in this scope
#define MIDI_ENDPOINT_OUT pluggedEndpoint
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:25:17: note: in expansion of macro 'MIDI_ENDPOINT_OUT'
#define MIDI_RX MIDI_ENDPOINT_OUT
^~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:90:22: note: in expansion of macro 'MIDI_RX'
if (!USB_Available(MIDI_RX)) {
^~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:90:8: error: 'USB_Available' was not declared in this scope
if (!USB_Available(MIDI_RX)) {
^~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:90:8: note: suggested alternative: 'available'
if (!USB_Available(MIDI_RX)) {
^~~~~~~~~~~~~
available
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:22:27: error: 'pluggedEndpoint' was not declared in this scope
#define MIDI_ENDPOINT_OUT pluggedEndpoint
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:25:17: note: in expansion of macro 'MIDI_ENDPOINT_OUT'
#define MIDI_RX MIDI_ENDPOINT_OUT
^~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:96:16: note: in expansion of macro 'MIDI_RX'
c = USB_Recv(MIDI_RX, &event, sizeof(event) );
^~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:96:7: error: 'USB_Recv' was not declared in this scope
c = USB_Recv(MIDI_RX, &event, sizeof(event) );
^~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp: In member function 'midiEventPacket_t MIDI
::read()':
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:22:27: error: 'pluggedEndpoint' was not declared in this scope
#define MIDI_ENDPOINT_OUT pluggedEndpoint
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:25:17: note: in expansion of macro 'MIDI_ENDPOINT_OUT'
#define MIDI_RX MIDI_ENDPOINT_OUT
^~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:124:31: note: in expansion of macro 'MIDI_RX'
if (USB_Available(MIDI_RX)) {
^~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:124:17: error: 'USB_Available' was not declared in this scope
if (USB_Available(MIDI_RX)) {
^~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:124:17: note: suggested alternative: 'available'
if (USB_Available(MIDI_RX)) {
^~~~~~~~~~~~~
available
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp: In member function 'void MIDI
::flush()':
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:23:37: error: 'pluggedEndpoint' was not declared in this scope
#define MIDI_ENDPOINT_IN ((uint8_t)(pluggedEndpoint+1))
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:26:17: note: in expansion of macro 'MIDI_ENDPOINT_IN'
#define MIDI_TX MIDI_ENDPOINT_IN
^~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:144:12: note: in expansion of macro 'MIDI_TX'
USB_Flush(MIDI_TX);
^~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:144:2: error: 'USB_Flush' was not declared in this scope
USB_Flush(MIDI_TX);
^~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp: In member function 'size_t MIDI
::write(const uint8_t*, size_t)':
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:23:37: error: 'pluggedEndpoint' was not declared in this scope
#define MIDI_ENDPOINT_IN ((uint8_t)(pluggedEndpoint+1))
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:26:17: note: in expansion of macro 'MIDI_ENDPOINT_IN'
#define MIDI_TX MIDI_ENDPOINT_IN
^~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:167:20: note: in expansion of macro 'MIDI_TX'
int r = USB_Send(MIDI_TX, buffer, size);
^~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:167:11: error: 'USB_Send' was not declared in this scope
int r = USB_Send(MIDI_TX, buffer, size);
^~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:167:11: note: suggested alternative: 'USBS0'
int r = USB_Send(MIDI_TX, buffer, size);
^~~~~~~~
USBS0
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp: In constructor 'MIDI
::MIDI
()':
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:190:22: error: class 'MIDI
' does not have any field named 'PluggableUSBModule'
MIDI
::MIDI
(void) : PluggableUSBModule(2, 2, epType)
^~~~~~~~~~~~~~~~~~
In file included from d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:17:0:
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:29:33: error: 'EP_TYPE_BULK_OUT' was not declared in this scope
#define EP_TYPE_BULK_OUT_MIDI EP_TYPE_BULK_OUT
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:192:14: note: in expansion of macro 'EP_TYPE_BULK_OUT_MIDI'
epType[0] = EP_TYPE_BULK_OUT_MIDI; // MIDI_ENDPOINT_OUT
^~~~~~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:29:33: note: suggested alternative: 'EP_TYPE_BULK_OUT_MIDI'
#define EP_TYPE_BULK_OUT_MIDI EP_TYPE_BULK_OUT
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:192:14: note: in expansion of macro 'EP_TYPE_BULK_OUT_MIDI'
epType[0] = EP_TYPE_BULK_OUT_MIDI; // MIDI_ENDPOINT_OUT
^~~~~~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:28:32: error: 'EP_TYPE_BULK_IN' was not declared in this scope
#define EP_TYPE_BULK_IN_MIDI EP_TYPE_BULK_IN
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:193:14: note: in expansion of macro 'EP_TYPE_BULK_IN_MIDI'
epType[1] = EP_TYPE_BULK_IN_MIDI; // MIDI_ENDPOINT_IN
^~~~~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.h:28:32: note: suggested alternative: 'EP_TYPE_BULK_IN_MIDI'
#define EP_TYPE_BULK_IN_MIDI EP_TYPE_BULK_IN
^
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:193:14: note: in expansion of macro 'EP_TYPE_BULK_IN_MIDI'
epType[1] = EP_TYPE_BULK_IN_MIDI; // MIDI_ENDPOINT_IN
^~~~~~~~~~~~~~~~~~~~
d:\Arduino\Sketches\libraries\MIDIUSB\src\MIDIUSB.cpp:194:2: error: 'PluggableUSB' was not declared in this scope
PluggableUSB().plug(this);
^~~~~~~~~~~~

exit status 1

Compilation error: exit status 1

It's okey now do you have the code now or you fixed it @johnd2117 :grinning: :grinning: :grinning:

hey you dont have to copy the eror mesege over and over agein just get one partthat ig good anaf

That's how they came out. Each time I try to run the program the messages double up.

Hi again, I have resolved my problem. I removed the PatchToNote library and reinstalled it, now the program is working. It makes no sense to me as the library is just a list of notes to associated DIN numbers with no reference to MIDIUSB at all. I can get on with the program now, I want to expand it to 25 keys. Thanks for your input.

It can be important to see the full error message even if it seems that the same error is repeated several times.

The easiest way to copy it is to use the Copy Error Message button in the IDE and the best way to present it here is to put it into code tags