'NoteOn' was not declared in scope

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.

Pete