ported code to AVR C

* code is now completely written in AVR C, without Arduino libraries
* timer1 is no longer being used
* added MIDI library since it was necessary to modify it for AVR C
* other minor stuff