All right, I did some basic stuff with the code I wrote around Mido. Basically, just proved things out, and got some hands-on experience with the code. From there, I've got a few quick conclusions.
First off, the stuff that I thought through and completely understood worked well. On the other hand, there are some areas where I'm going to need to add abstractions. Currently, the "play a note" function expects a note-on message object, which it derives a note-off message from, somewhat haphazardly. I believe I should write a higher-level class that constructs the relevant messages as needed.
This class should probably be pretty minimal, to start with, because I don't know what capabilities I'll want. But it only makes sense that the types should be what is expected, and the note and channel values should match.
My basic proof-of-concept tested out the play-note function with a simple scale. Here's where I want to go next:
- Higher-level "Note" object
- Recreate current poc with Trio primitives
- Play a chord
- Figure out what I want to change next
- Then start transcribing various songs to code, and refactor the code.
One thing I'll probably want in there is to put together something I've thought about: a port-like object that transcribes messages to a MIDI file. There are a few steps and procedures I'd need to get right for that, but it's the logical thing for me to want to add, now that I can do real-time playback.
Anyway, it's pretty late, I should wrap up.