Skip to content
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 out crashes #29

Open
aspitarl opened this issue Dec 27, 2019 · 3 comments
Open

Midi out crashes #29

aspitarl opened this issue Dec 27, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@aspitarl
Copy link

Hi, I'm totally new to unity, but was able to get version 9.0.0 to build and am able to use/hear keyboards drums etc in VR with a valve index and both unity version 2019.2.15 and 2019.2.17

I am trying to get midi out to work with ableton using LoopMIDI. The midi out device sees the LoopMIDI channels and is able to connect. However, whenever I try and send a signal, either from a keyboard or a xyz controller, the program crashes. I am getting the following error message.

DeviceException: Error in the application.
Midi.OutputDevice.CheckReturnCode (Midi.Win32API+MMRESULT rc) (at <3ae8989f39284848a71554ade1624b8b>:0)
Midi.OutputDevice.SendNoteOn (Midi.Channel channel, Midi.Pitch pitch, System.Int32 velocity) (at <3ae8989f39284848a71554ade1624b8b>:0)
MIDImaster.outputNote (MIDIdevice _dev, System.Boolean on, System.Int32 ID, System.Int32 channel) (at Assets/Scripts/MIDI/MIDImaster.cs:164)
midiComponentInterface.OutputNote (System.Boolean on, System.Int32 ID, System.Boolean add48) (at Assets/Scripts/MIDI/midiComponentInterface.cs:200)
keyboardDeviceInterface.keyHitEvent (System.Boolean on, System.Int32 ID) (at Assets/Scripts/Keyboard/keyboardDeviceInterface.cs:135)
keyboardDeviceInterface.asynchKeyHit (System.Boolean on, System.Int32 ID, keyboardDeviceInterface+keyInput k) (at Assets/Scripts/Keyboard/keyboardDeviceInterface.cs:120)
keyboardDeviceInterface.hit (System.Boolean on, System.Int32 ID) (at Assets/Scripts/Keyboard/keyboardDeviceInterface.cs:170)
key.keyHitCheck () (at Assets/Scripts/UI/key.cs:61)
key.onTouch (System.Boolean on, manipulator m) (at Assets/Scripts/UI/key.cs:140)
manipulator.OnCollisionEnter (UnityEngine.Collision coll) (at Assets/Scripts/CoreClasses/manipulator.cs:141)

@plaidpants
Copy link
Owner

This died in the external midi.dll midi-dot-net, need to debug further into that DLL on the PC to see what happened. https://github.com/jstnryan/midi-dot-net/, I have not been focusing on the PC/VIVE/Rift version of the code but I suspect this could occur on the original release also. I will need to see if I can reproduce the issue on the PC. Probably should switch to a different MIDI support library as midi-dot-net does not work on Android which is needed for Oculus Quest support. Probably something paid like https://assetstore.unity.com/packages/tools/audio/midi-unified-2019-2-6-85256

@andybak
Copy link

andybak commented Dec 29, 2019

I was previously using Keijiro's Midi Jack but he's switched to rtmidi: https://github.com/keijiro/jp.keijiro.rtmidi

He's also written a wrapper that maps it to the new input system (might not be suitable for your use case): https://github.com/keijiro/Minis

Just thought I'd mention it. It would be a shame to add a non-open source dependency to this project.

@plaidpants
Copy link
Owner

I rebuilt the Midi.dll code with debug info with VS 2017. I was not able to get it to crash now. Could you pull the dll and see if you are still seeing an issue.

@plaidpants plaidpants added the bug Something isn't working label Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants