monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
633 stars 147 forks source link

norns UI allows one MIDI device to occupy multiple device slots #1490

Closed xmacex closed 2 years ago

xmacex commented 2 years ago

Hi, I'm formulating this as an issue, but maybe I fail to see a productive or fun use for it. Let me know if llllllllines would be better place for this.

Norns allows setting the same MIDI device to occupy more than device slots, ie. one-to-many mapping between physical devices and the device listing.

This gets confusing, because some of the MIDI events get lost, e.g. just now I had a synth both at slot 1 and slot 5 (=also out of sight on 4-line listing in SYSTEM > DEVICES > MIDI). I got pretty confused; some scripts would respond to MIDI events, e.g. Lost Future would play sounds but others e.g. MIDI Monitor would not get MIDI data from the device. I now think the former listened to notes from all devices on all channels. Also m = midi.connect(1); m.event = function(data) print("bah") end callback would not print anything when pressing keys.

Everything works as expected when removing the duplicate device allocation, in this case I set device 5 to none.

I suggest a usability improvement UI redesign so that the MIDI device list only allows each device to occupy one slot. Maybe simply when assigning a device to a slot, remove it from other slots?

Cheers thanks for all the good stuff, take care, stay safe :)

tehn commented 2 years ago

thanks for pointing this out, your describe the problem well.

two solutions:

  1. as you suggest, remove duplicate assignments
  2. expand the routing logic to be capable of redirecting to multiple vports. this is a performance hit and wondering if it's really worth pursuing for the use case.

edit, after a quick look option 2 would actually require a bit of refactoring of the midi data structure (adding the ability to track multiple ports assignments) which i really think is probably overkill: https://github.com/monome/norns/blob/main/lua/core/midi.lua#L419

so let's fix this with option 1