-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
MIDI assignments don't distinguish between different MIDI controllers #256
Comments
Yes, per-device mapping isn't currently supported. Essentially there needs to be another key added to an assignment with the MIDI Device ID and then a check on the input event listener to see if it matches. https://github.com/m-o-d-v/modV/tree/2.0/src/extra/midi-assignment |
@2xAA Isn't the device ID system specific? So when I use the device on another computer, the ID will change? Which would mean that moving configs to another computer wouldn't work anymore. Need to test this. |
@TimPietrusky The spec doesn't mention. It should be unique and specific to the device and port. |
If testing discovers the ID to be non-unique per system then a dialog/modal should be presented to the user to select a new MIDI device to map to. The MIDI plugin is rather dumb as it will just accept any data as long as it's in the correct format. Currently there are no checks on present MIDI devices. |
According to WebAudio/web-midi-api#48 the ID for the same device on the same origin might change if the underlying storage is cleared, so it might also happen that the ID is changing even when you are not changing origins. Especially this one: WebAudio/web-midi-api#48 (comment) I think I was encountering something like this in the past when you added MIDI support in the first place. But we didn't looked into it. One way of handling this in luminave is that I only check for the name of the specific MIDI Input / Output, but that would mean that we can't have the same MIDI controller more than once. |
TestSetup
Test on Windows 10
ResultI was using the same MIDI controller. The ID on Windows looks like this: {
"deviceId": "input-1",
"variable": "Ball,enable,internal",
"value": null
} On MacOS, it looks like this: {
"deviceId": "138192998391",
"variable": "Ball,enable,internal",
"value": null
} |
Well this is less than ideal - thanks for confirming. Maybe we go with the Modal idea?
To make this easier for the user we can store the device name with the assignment data and present that when re-mapping devices. |
Still the question what we use to identify a device! We should try the SysEx thing mentioned by @halfbyte in the LiveJS slack:
Or just use the name of the controller itself as a workaround to have cross origin capabilities.
We have to test if installing the driver for a specific system is telling the OS to use the same Name for the same controller. |
Totally forgot to read this... So you mean that when we load a preset and if we can't find the MIDI device in the assignments (in we can't find the device name), then we ask the user to select a device? Because if we do this all the time then the user might go nuts. Maybe the modal should be on user action? So that the user goes into the MIDI assignments plugin and triggers the modal if they think it's wrong? |
MIDI devices per system seem to keep their IDs, even on Windows - so this as a short term solution is viable. Moving these assignments between systems is broken however.
This limits the user to only one of the same controller, it's not robust enough.
This isn't guaranteed to work with all devices still though, probably good enough for our needs but if somebody has a custom device or just a device which doesn't support this SysEx message then it's not gonna work.
Well that's only if the MIDI device isn't present based on the name which I think wouldn't be that often if the user specifically made that preset - but I can imagine scenarios where that would be fairly annoying.
Yes this seems to fit the needs better. I think an alternate solution would be to re-design the MIDI plugin panel in the "Plugins" tab to allow the user to manage the assignments manually - this mechanism doesn't need to be exactly just for this "missing device" scenario but could be a general assignment panel for the user to manage assignments at any point. This is a little more work, but it would add a lot of flexibility. I feel this functionality should be moved into a new issue. |
According to @halfbyte the OS is incrementing the device name if you add more than one. I don't have any device to test this behaviour. But even if that would be the case, it would be worth than using the ID.
You mean having the assignments per ID, so that we don't have to change this for every assignment? I would go with this idea.
Yes, I will move this into a new issue. |
Maybe we should even allow adding multiple IDs to a group of assignments! That way you can move the same preset between different origins and it always works! |
This ticket is done, because the new things around MIDI will be done in #296 |
When using more than one MIDI controller at the same time and both have the same note defined for one control, triggering one of them will result in triggering an "action" in modV.
Steps to reproduce
-> The module gets activated even when the controller was not used to define the assignment.
The text was updated successfully, but these errors were encountered: