Perhaps when uploading, Windows does not have enough time to sort out the initial device disconnect (Cache flushes included) before Teensy usbMIDI is back online pestering Windows for a connection..
Make sure all your stuff is backed up!
Fell into a rabbithole remarkably similar to this a while ago.
Synth Host system,Win7, Reaper, Presonus, MIO-10 and MidiSport usb-Midi interfaces and my Teensy usbMIDI project. Everything worked until adding and using the IDE.
From a cold...
Another thought:-
Depending on the ambient light source, actual light levels are gonna be modulated by the means of production.
Jurassic incandescent will carry some mains frequency component. CFLs often run at some higher frequency. LED...
MIDI_Crab_v2.ino in attachment above is incomplete in that two Tabs are missing. These would be named Controller.cpp and Controller.h. Most compile errors in the OP are a consequence of those missing tabs.
The sketch looks like (part) of a...
For lots of multiplexed encoders check out the EncoderTool library Thread by @luni found here:-
https://forum.pjrc.com/index.php?threads/encodertool.70264/