Is there a way to differentiate between MIDI inputs?

SnoodySnoody Posts: 1Member

Hi Godot Friends!

I have several of what are essentially bluetooth drum pads that I'm connecting to Windows via "MIDIBerryM" and "LoopMIDI".

I'm able to get a list of the virtual ports created by LoopMIDI in godot using OS.get_connected_midi_inputs() but then I can't seem to do anything with that information. All the properties of InputEventMIDI for each pad are identical (Device: 0, Channel: 6, Message: 9 etc.) so I can't differentiate between them that way - I've tried changing those properties but I'm obviously only changing them for that event so the next event they default back again.

It's super cool to be able to interact with godot wirelessly like this but it would be even more super cool if I could treat each device as, y'know, a separate device.

To be clear I just want to achieve the behaviour of "Event x only triggers when I hit Pad x. Event y only triggers when I hit Pad y". Currently I can only get them working as though they are one device despite being connected to different ports.

Plz halp, thx.

Answers

  • soundgnomesoundgnome Posts: 3Member

    A bit of a shot in the dark here since I don't have the gear to replicate your setup, but if everything's showing up in Godot as the same device and channel then I don't see what you could do on the Godot side to differentiate between them. But it also sounds like there are several previous links in your signal chain which might be tweaked. The first thing I'd try is checking whether there's a way to set your drum pads to send on different MIDI channels, that way you could tell them apart even if they're showing up as the same device.

  • cyberealitycybereality Posts: 2,780Moderator

    I don't think this is an issue with Godot, as Godot just sees what is available in the OS. Most likely it is a configuration issue in loopMIDI or virtualMIDI. From my brief research it does appear multiple devices are supported, so it may just be a matter of making sure they are defined separately as individual devices and I believe it would work in Godot. However, I don't have any experience in MIDI and I don't have the hardware to test this myself.

  • TwistedTwiglegTwistedTwigleg Posts: 5,052Admin

    I also do not have any experience with MIDI, but one thing I might recommend trying if you are okay with the C# version of Godot is seeing if a C# library for MIDI (here's one I found on Google: DryWetMIDI) has the same issue. This might help deduce if it's a Godot thing or something on the driver/device side.

  • CalinouCalinou Posts: 1,057Admin Godot Developer
    edited November 21

    If you can build Godot from source, try compiling Godot with those changes made: https://github.com/bruvzg/godot/commit/270e0cc0130628192aee88cc868e7167f307894d

    The fix includes support for all platforms that have MIDI support in Godot (Windows, macOS, Linux).

    The branch is here, although it's based on master and is therefore not compatible with Godot 3.x projects.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file