Add MIDI functions
Clean up formatting
WIP Add buffer support