Julusian / node-midi

A node.js wrapper for RtMidi providing MIDI I/O
https://www.npmjs.com/package/@julusian/midi
MIT License
22 stars 7 forks source link

Napi error thrown after receiving after-touch #4

Closed navelpluisje closed 1 year ago

navelpluisje commented 1 year ago

After receiving an after touch message next error gets thrown: libc++abi: terminating with uncaught exception of type Napi::Error

This can be reproduced by cloning and running https://github.com/navelpluisje/electron-midi-starter. Let it receive an after-touch message and an error message should appear.

aolsenjazz commented 1 year ago

I believe this is a problem with your implementation; all 2-byte messages sent to your application (programchange, etc) cause it to crash.

For others verifying before trying this library, I tested virtual ins, out, as well as hardware ins, out receiving/sending aftertouch messages. All successful. It seems to me that this issue can be closed as unrelated.

Thanks @Julusian for your work on this!

aolsenjazz commented 1 year ago

Looking back at this, I see you (@Julusian) define a MidiMessage as [number, number, number]. It would probably be helpful to change this to number[] to reinforce that length isn't guaranteed. Will open a PR

aolsenjazz commented 1 year ago

Opened #6

navelpluisje commented 1 year ago

Rechecked, was indeed an implementation issue