Finally got GS to work with MIDI input!
Hi all!
I just wanted to come here and mention this because I am excited. If you look at my post history you'll see that around 2018 I kept asking how to get my GS game to be controlled by a MIDI input and I was struggling and never found the answer. I can't quite remember, but I think I was trying to experiment with having a GS game be controlled by LeapMotion at the time. Anyway I came back to the idea just this week because I wanted to show off some of my old GSR biofeedback equipment to my new students, and I got it working today!? I have no idea why it wasn't working before, but I'm sure it was simple user error on my part. Not on LeapMotion, but with an old MIDI controller I've had forever called a MIDI Sprout - the Sprout's original aim is to convert skin biofeedback into MIDI so that you can control music through touch, and more specifically, change the music based on the responsiveness of your particular skin.
So I am on Mac Monterey, so I have my MIDI Sprout routed through my IAC Driver, and am passing it through a small program called MidiPipe (which is useful for getting my MIDI signal to control WebGL, but I'm not 100% sure if it is needed for GS, anyway, I have it open and set up just in case). I then have another little program called MIDIStroke which I am using to control key presses through MIDI. Then I simply make a game requiring keypresses and hey presto! I'm not sure why this did not work for me correctly back when I tried it in 2018.
The point of the Sprout is that the MIDI input is a bit random, which doesn't equate very well to the idea of key presses, so instead, I'm going to set up a scene with LOTS of different potential key presses. So rather than it being a traditional game, it might be more like a situation where you change the imagery of the scene by being more or less 'stressed', as this stress or emotional reaction is being picked up through the skin. All I did today was get a box to move when my skin gets 'stressed' so it's not a file worth sharing yet but I just wanted to share my excitement.
The MIDI Sprout is essentially obsolete now, so that's a bit of a shame because if it dies (its looking pretty beat up because I have used it a lot over the years) I'll have to rethink my setup. But it had been annoying me that it should work as long as there is a 3rd party program telling the computer what key presses to make (eg MIDIStroke) and yet I couldn't get it to work. Today it finally did. Yay!
Now to double check and see if I can replicate it... knowing my luck I'll try again and it won't work...
Comments
That's very exciting! I have often wanted to do the same thing and could not figure it out.
Good luck with the effort!
Some googling found this:
https://github.com/c0redumb/midi2vjoy
Which means you might be able to pipe midi through a virtual joystick and maybe control a game through the gamepad / joystick devices (giving you analog control on top of binary on/off).
The only thing I'm not sure of is whether our gamepad library supports this as a device, but it's worth a shot?
Amazing!!! Brilliant to know this is possible !!
Thanks adent42! I've been using two little programs 'Midipipe' and 'Midistroke' (for key presses) in combination, which is working for me for mapping to keyboard presses. I'll check out midi2vjoy as well!