I would like to monitor some midi events :just the key pressed and particularly when a key is released for a bug tracking.
printk2 p4
printk2 p5
show the velocity and the note but does not show when the key is release.
How can I do that in cabbage in order to get an output like showing that the key has been released ? :
p4 : 60
p5 : 0.8
About the midi bug : Somehow, all key when pressed and release indeed send a note on / note off message… but my synth from time to time continue sending audi, as if the note off was not received… this is really weird. I can’t see where this comes from.
Well, I tried the @gsenna 's trick on real key board with no result.
Concerning the VS debugging : i tried but this really goes over my programming skills.
However, I manage to reproduce the bug very easily using debugger :
Start debugging, launch the instrument, load a preset.on keyboard
Play a few note to check if this woks
Then
just put any breakpoint into the CsoundPluginProcessor::ReadMidiData function (i.e. at the return line)
play a note on the real keyboard.
remove the breakpoint and continue execution with F5… The note plays for ever. ( whene ever in the process the key has been release long time ago)
I think that just proves what we already know, i.e, somehow, somewhere, a note off message is not getting through. I apologise for not being able to look into this at the moment. Once things settle down a little at work I should have more free time to delve into the dark world of MIDI messages!
Oh, sorry it didn’t work. This is with a real keyboard, right? Can you trigger this behavior with the virtual keyboard also? If no, then how about midi monitoring with MIDI-OX to see if the note off is there?
Could you post a minimal .csd? I can install latest Cabbage in a virtual machine after coming back from Montevideo next week and try with my Casio keyboard if you like.
Many thanks to you. @rorywalsh : no worries, things will find a solution.
@gsenna : My keyboard is a ALESIS VI-49, I did indeed monitor with MIDI-OX . All notes are sent with a note on and a note off message. So the keyboard is not buggy.
Once I have triggered the bug with the real midi keyboard, then I can repeat it with the virtual keyboard, on the same note.
When printing all messages received by the instrument, it indeed receive all note on and note off.
I also changed the computer from my tablet to my big Tower (core i7) .. I get the same trouble after a while.
It seems to me that, Cabbage forgets from time to time to send a note off to Csound. (I discovered today that there can be a residual sound with all previously played notes, as if some buffer was never cleaned, despite the fact that I clear all audio variable at the end of the instrument).
The csd and the howto are in this post : New synth beta : Morpheur - #3 by Karamel1
Even if it seems to be big… in fact all audio is in instr 1, the rest is for GUI and keyboard management and effects. I also tried to comment a lot.. for further maintenance
Please feel to try it and thank you a lot for your help.