'NoteOn' was not declared in scope

I’m not good at writing English. Please forgive me.
I want to use midi library in MIDI.getType(),
I wrote sorce and compile, But compilation error has occurred,
I want if send NoteOn(tap sampler) ,display note number,

This is sorce,

#include <LiquidCrystal.h>
#include <MIDI.h>
#include <midi_Defs.h>
#include <midi_Message.h>
#include <midi_Namespace.h>
#include <midi_Settings.h>

#define PEDAL_MARGIN 64
#define AD_CONVERTER 14
#define INPUT_MIDI_CH 10

int switchPins[] = {1, 2, 3 , 0}; //アナログpin
int pedalPins[] = {5, 6, 7, 8};//デジタルpin

//5, 6, 7, 8, 1, 2, 3, 0,pin//
//1, 2, 3, 4, 5, 6, 7, 0,port//

void setup() {
  Serial.begin(9600);// 9600bpsでシリアルポートを開く
  for (int i = 0; i < sizeof(switchPins); i++) {
    pinMode(switchPins[i] + AD_CONVERTER, INPUT); // ピンを入力に設定
    digitalWrite(switchPins[i] + AD_CONVERTER, HIGH); // プルアップ抵抗を有効に

  for (int i = 0; i < sizeof(pedalPins); i++) {
    pinMode(pedalPins[i], INPUT); // ピンを入力に設定
    digitalWrite(pedalPins[i], HIGH); // プルアップ抵抗を有効に

void loop() {
  uint8_t data1, data2;
  if (MIDI.read()) {
    MIDI.setInputChannel(INPUT_MIDI_CH);   //読み込むチャンネルを設定
    switch (MIDI.getType()) {
      case NoteOn : //鍵盤を押す   ←this
        data1 = MIDI.getData1(); // ノートNo.(音階)


exit status 1
‘NoteOn’ was not declared in this scope

Please teach me the reason for the error. m(_ _)m

exit status 1
'NoteOn' was not declared in this scope

That is not the error message I get.

It says there is an error compiling it for a Uno, or Mega. What type of Arduino are you trying to use?

Anyway try:-

 case midi::NoteOn:

I use the UNO.
I made it!!!
Thank you!

I use only java once.
How use I that switch sentence in C(?) ?

How use I that switch sentence in C(?) ?

I don't understand, this code is C++

I think there may be two MIDI libraries here. There is one here which has the files and syntax being used by @taro but I suspect that the IDE is trying to use the standard MIDI library.
To use the FortySevenEffects library, I think you would have to move the distributed MIDI library somewhere where the IDE can't see it.