Control_Surface library multi midi interface error.

Hello to everyone! I copied the code below from an example from the library help guide but I get this error:

exit status 1
'MultiMIDI_Interface' does not name a type; did you mean 'MSC_GetInterface'?

Can someone explain why and how to resolve?

Here is the code:

// Create two MIDI interfaces
HardwareSerialMIDI_Interface serialmidi = {Serial1, MIDI_BAUD};
USBMIDI_Interface usbmidi;
 
// And group them together
MultiMIDI_Interface<2> midi = {{&usbmidi, &serialmidi}};
 
// The MIDI interface that was instantiated last will be used as the
// default MIDI interface by Control_Surface.
// To override the default, you can use the following line in your setup:
//    `midi.setAsDefault();`
// where `midi` is the MIDI interface you want to set as the default.

Can you post your whole sketch?

The whole sketch:

#include <Control_Surface.h>

// Create two MIDI interfaces
HardwareSerialMIDI_Interface serialmidi = {Serial1, MIDI_BAUD};
USBMIDI_Interface usbmidi;
 
// And group them together
MultiMIDI_Interface<2> midi = {{&usbmidi, &serialmidi}};
 
// The MIDI interface that was instantiated last will be used as the
// default MIDI interface by Control_Surface.
// To override the default, you can use the following line in your setup:
//    `midi.setAsDefault();`
// where `midi` is the MIDI interface you want to set as the default.

// Create a new instance of the class `CCPotentiometer`, called `potentiometer`,
// on pin A0, that sends MIDI messages with controller 7 (channel volume)
// on channel 1.
CCPotentiometer potentiometer = {
  A0, {MIDI_CC::Sostenuto, CHANNEL_1}
};

Bank<4> bank(4);
IncrementDecrementSelectorLEDs<4> selector = {
    bank,
    {2,3},
    {10,16,14,15},
    Wrap::Wrap
  };
Bankable::CCButtonLatched<4> buttons[] = {
  {{bank, BankType::CHANGE_ADDRESS}, 4, 0x14},
  {{bank, BankType::CHANGE_ADDRESS}, 5, 0x15},
  {{bank, BankType::CHANGE_ADDRESS}, 6, 0x16},
  {{bank, BankType::CHANGE_ADDRESS}, 7, 0x17},
};


void setup() {
  Control_Surface.begin(); // Initialize Control Surface
}
 
void loop() {
  Control_Surface.loop(); // Update the Control Surface
}

The line which cause the error:

MultiMIDI_Interface<2> midi = {{&usbmidi, &serialmidi}};

Without the code line above, all works well.

Thank to everyone who will help! ???

Could this be the problem? I found it on the github page for the control_surface library https://github.com/tttapa/Control-Surface:

8a3b1b314cf5b4aedf3ad60cbbc492fbcbb25c73
For the same reason as the bullet above, the MultiMIDI_Interface was removed, and has been replaced by the MIDI Pipe routing system.

Where did you get that example?

Like ToddL1962 said, MultiMIDI_Interface has been removed. You can now use MIDI Pipes, as shown in the Dual-MIDI-Interface example.

Pieter

Thanks for the help, I read of MultiMIDI_Interface in its relative example some months ago, copied it in my sketch and commented it. Now that I have a compatible Pro Micro, wanted to realize a MIDI interface trough USB port and MIDI din port.

Thanks again!
Luca.