MIDI NoteOff event missing

May 31, 2011 at 9:10 PM
Edited May 31, 2011 at 9:16 PM

Hi,

i'm trying to use MIDI interface of NAudio and came across a little problem. When i press a key on the master keyboard, MessageReceived event fires up with the CommandCode NoteOn, but when i release the key it fires with NoteOn again.

Previously i wondered already about an exception which came up, cause the event couldn't be converted to NoteOnEvent, which really was (or should be) NoteOff.

Is it a bug in NAudio? Or should i check against velocity?

 

Edit: I searched a little bit and came across aftertouch and this thread from stackoverflow http://stackoverflow.com/questions/3306866/why-is-there-a-velocity-parameter-for-note-off-events. It sheds some light for me on this topic.

 

Thanks in advance

Andrej

Coordinator
May 31, 2011 at 9:17 PM

Lots of MIDI keyboards send a note on with a velocity of 0 to mean note off (it requires less bytes being sent as it can be sent as a MIDI follow-on message). I suspect that is what you are seeing.

Mark

May 31, 2011 at 9:27 PM

Thanks for fast reply.

 

What would you suggest to process events? Maybe you know a good site which explains such things and what they are good for? I never really used aftertouch and a couple of other exotic features before, but trying to get back into sound processing and would like to experiment with such features of my keyboard (there is more in that thing, than the first look reveals). 

Coordinator
May 31, 2011 at 9:42 PM

well to do anything from NAudio would require you to either write or host a software synthesizer. Neither is a particularly easy task although I am in the process of writing some very basic demos for the next version of NAudio. What do you actually want to achieve?

Jun 3, 2011 at 9:00 AM

Hi,

sorry for the late reply, but i had a lot of work-related stuff to do. 

Yes i'm trying to make a simple synth. Less for production, but rather for playing around with DSP and modular approach. It's especially about continuous data processing and parrallel programming.

For a couple of years now i wanted to create node-based application, just type into google if you don't know what i mean. Sometimes i lack time for this or even passion for programming at evenings, cause i'm already software developer in my job. Now i found both of it and wanted try it out. Maybe you have some pointer on modular data processing. I suppose in C# i have to use Object for plain data and cast or rather box/unbox it. In C++ i think it's void-poiner and casting.

Coordinator
Jun 6, 2011 at 8:37 AM

the next version of NAudio will hopefully contain some better examples for synth type applications. I'm already working on a drum machine and there will be a new interface called ISampleProvider which is intended to make it simpler to build modular effects paths. In the current version of NAudio the WaveBuffer class allows you to effectively do void pointer casting between arrays of bytes, shorts or floats as necessary.