-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the use of multiple MIDI devices #9
Comments
The main problem is: what should happen if a grid is opened in a different midi context, where some midi device are missing? Should we:
This feature seems to add a lot of complexity. I'll wait a bit to see if more people are interested. |
Most of the work is available in this branch for testing. |
Just had a play with this. I set the device to an external USB device with the channel on a node set to 14 and got a panic.
Here: Lines 116 to 123 in cd9265d
We need to change to: // NoteOn sends a Note On midi meessage to the given device.
func (m *midi) NoteOn(device int, channel uint8, note uint8, velocity uint8) {
m.outputs[device] <- gomidi.NoteOn(channel, note, velocity)
}
// NoteOff sends a Note Off midi meessage to the given device.
func (m *midi) NoteOff(device int, channel uint8, note uint8) {
m.outputs[device] <- gomidi.NoteOff(channel, note)
} No more panic and the node sends the message on correct device and channel |
Also when cutting and pasting a node:
The note copy function does not have the device included: Lines 59 to 74 in cd9265d
func (n Note) Copy() *Note {
newKey := *n.Key
newDevice := *n.Device
newChannel := *n.Channel
newVelocity := *n.Velocity
newLength := *n.Length
source := rand.NewSource(time.Now().UnixNano())
return &Note{
midi: n.midi,
rand: rand.New(source),
Key: &newKey,
Device: &newDevice,
Channel: &newChannel,
Velocity: &newVelocity,
Length: &newLength,
Probability: n.Probability,
}
} |
Thanks a lot for testing! I just fix theses in the branch. Do you have an opinion on how you would imagine this to behave when you open a grid in a context where all needed midi devices aren't connected? Should we fallback on the default device? Should we display an error message? |
My understanding is that currently it's not possible to know whether all MIDI devices are connected as the device is serialised as an index. For example if I unplug a device and plug another in that new device might have the same index as the unplugged device. If the device were serialised as the string representation (gomidi When you deserialise and can't map a device name to an existing device then you could select a default. Also there could be a conversion sub(?) command outside of the UI that allows converting devices matching one MIDI device to another. |
You're right. Using the string representation is the only way to reliably reference a device.
Indeed. I guess the default device value for a new node could be default, which reference to the grid device configuration. But the parameter would allow to select a specific device. I think I like that approach. It's simple enough, and the default way is still using only one device (which is my way of using Signls, I map channels to different devices in Carla).
Not entirely sure what you mean here. |
Support for multiple MIDI devices has been added in v0.7.0. |
Right now, all MIDI message are sent to the configured grid midi device.
We could add a new node parameter that allows to choose the midi device per node, with the grid one being the default.
The text was updated successfully, but these errors were encountered: