factoring out common MidiDevice interface