Manage MIDI channel assignment in a better way #447
daveyarwood
started this conversation in
Ideas
Replies: 2 comments
-
When we do this, we should also make sure that the channel assignments are deterministic - see this Slack thread. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This has been implemented in Alda 2.3.0. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As noted in alda-lang/alda-core#77, it is possible to attempt to play a score with more parts than there are available MIDI channels. This is not a great experience, because the client doesn't tell you that something went wrong, it just fails on the backend when the player attempts to play (or export) the score.
I think it would be better if the client were in charge of assigning MIDI channels, so that you get an error immediately if you use too many of them. That way, there is no need to communicate with a player process at all in "bad input" scenarios like the one above.
In addition, I'd like to implement the idea I had here where there is a
midi-channel
attribute that allows the score writer to explicitly specify which MIDI channel to use at the current point in the score, thus allowing score writers to switch patches on the same MIDI channel, i.e. have multiple instruments share a MIDI channel.To enable better validation (e.g. recognizing when the specified channel is already in use by another part), I think each part could have a "channel itinerary," kind of like how there is a tempo itinerary that specifies the offset of every tempo change. This would be per-part, and by default, each part would have an empty itinerary, which would correspond to the current behavior where Alda uses the first available channel. The midi-channel attribute would record in a part's itinerary that it should be using channel N at the current offset.
The player should probably accept a new type of OSC message where the client can specify which channel a track should be using as of a particular offset, and then the player could update its own in-memory "channel itinerary" for that part accordingly.
Beta Was this translation helpful? Give feedback.
All reactions