Didn't start a new adventure yet, but continued an old one a bit... went and did some reading and configuring - now the memory protection unit, or MPU to friends, is working for the money, enforcing the user/supervisor split as it should. Now you...
Presumably, somewhere in the Serial.println code, it turns interrupts back on which allows the code to proceed. If it isn't called, interrupts stay off and the print buffer fills up and then println hangs.
[edit] I suspect that if instead there...
I doubt that sending midi notes will affect the sequence. It is more likely to need a Program Change or Control Change message. Which midi software are you using and does it have any documentation?
Pete
The code you posted sends a MIDI NoteOn when you press a button and a MIDI NoteOff when you release the button.
The message is sent to whatever you have connected the Teensy USB port to.
What is the Teensy USB connected to?
What is playing "a...
FYI I tried your code on a Teensy 2 connected to Windows 10 and with a piece of wire as a button on Pin 0.
MIDI-Ox on Windows sees the midi messages.
So the code works as advertised. There must be something wrong with how you are detecting the...
What have you connected the Teensy USB to in order to receive/detect the midi messages? The code is sending note C4 on MIDI Channel 2 (internal channel 1).
If you're sending to a synthesizer/DAW/whatever, it must be set receive the correct...