@iainmccurdy I think I may have found a potential reason why sometimes Cabbage & Csound (for me) go strange when I am experimenting. I have found that when I have the Blocks Dashboard app open on MacOS the app & Seaboard are in communication with SysEx messages. When using Midi-Monitor they are always sending data- and when a note is pressed even more SysEx messages are sent.
If I close the app those messages go away!
Roli Seaboard MPE with Cabbage
I made a video of the strange Aftouch issue, the data on left is Midi-Monitor, and on Right is Aftouch in Cabbage v2.0.27a
As one can see sometimes the numbers are the same- and sometimes there are random numbers? Both are raw values without smoothing applied. Blocks dashboard is closed. The Seaboard doesnât seam to be sending these false values.
Ironically after I finished this recording, I restarted Cabbage and the issue went away! So its very mysterious!
@Karamel1 I made a filter to stop the aftertouch event of 127 getting through, but I think there must be a better (more Csound) way:
k_trig_val linseg 0, ksmps/1000, 1
kAftouch init 0
if ((k_trig_val==1)) then
kAftouch aftouch
endif
printk2 kAftouch
So what is happening is that the Seaboard is only sending After Touch after the Note-On event. And Csound needs some value to be there, so its using the init 127 value.
Here is proof (a note-on event and after-touch log):
14:25:43.180 From Seaboard BLOCK Note On 7 FâŻ4 18
14:25:43.198 From Seaboard BLOCK Channel Pressure 7 7
14:25:43.216 From Seaboard BLOCK Channel Pressure 7 15
14:25:43.234 From Seaboard BLOCK Channel Pressure 7 29
14:25:43.252 From Seaboard BLOCK Channel Pressure 7 55
14:25:43.270 From Seaboard BLOCK Channel Pressure 7 76
14:25:43.288 From Seaboard BLOCK Channel Pressure 7 75
14:25:43.306 From Seaboard BLOCK Channel Pressure 7 37
14:25:43.324 From Seaboard BLOCK Channel Pressure 7 0
14:25:43.358 From Seaboard BLOCK Note Off 7 FâŻ4 89
Yet when we look at CC74 (Slide/Y event):
14:27:33.461 From Seaboard BLOCK Note On 7 FâŻ4 5
14:27:33.461 From Seaboard BLOCK Control 7 Brightness 67
14:27:33.516 From Seaboard BLOCK Control 7 Brightness 68
14:27:33.556 From Seaboard BLOCK Control 7 Brightness 67
14:27:33.598 From Seaboard BLOCK Note Off 7 FâŻ4 19
So After-Touch is happening after Note-On, and Slide/Y is sent at the same time as Note-On.
Hence why we need to use init 0 or a work around currently.
It may actually be interesting to have an option in the Roli Seaboard to allow Pressure to be sent as a CC message? Which could allow some interesting envelope control? (just a thought)
NOTE:
I suppose this is all a bit obvious, but considering the nature of the Seaboard I donât think anything is that obvious anymore. (at least to me)
The Midi.org spec states:
Channel Pressure (After-touch). This message is most often sent by pressing down on the key after it âbottoms outâ.
Iâm not sure if âafter bottoms outâ is a rule? Eg: After-Touch can be sent at Note-On time? If it were sent at note-on time then there would be no need to change anything in Csound- or a filter.
UPATE: Just built Csound with the aftouch init FL(0.0) and that does 100% fix problem.
I posted on Csound mailing list and Steven Yi was of the opinion that it would be a break. So best (as Steven suggests) to add a global variable or such to set the init value to 0, and default to 127.
@iainmccurdy I have also discovered in building Csound 6.10 from git that I am getting lots of stuck notes! This was not the case for me with the current 6.09.1, so possibly there could be something in the new 6.10 that is causing this issue. I also noticed straight away that lots of midi pitchbend data was being thrown away (I could hear noticeable increments in pitchbend). This throwing away of Midi data could be a potential cause of stuck notes.
It would be good if anyone could verify this before I log an issue on GitHub.
I think it would be good if you could post to the Csound list as soon as possible about this as there are plans to release 6.10 on Monday!
I donât mind posting an issue, but currently I donât really know what is going on. It seams to be specific to the Seaboard - and the torrent of MIDI data Csound is receiving from it. That said- @iainmccurdy is the only other Seaboard & Csound user/contributor I am aware of. So if this is specific to Seaboard I think it would be hard to verify by the community.
I know what you mean. I just hate to see things behave differently from one version of Csound to the next. I canât think of hand of any changes that were made to MIDI handling in 6.10.
AftertouchTest.MID.zip (1.8 KB)
Iâve made some further tests. I tested this with a normal keyboard with aftertouch to rule out the Seaboard as a significant element. I attach a MIDI file of individual detached notes (all channel 1) played with aftertouch so you can test for yourselves.
When playing live or playing the MIDI file into Cabbage (latest beta) via the IAC driver (using Reaper), there are lots of stuck notes. When the MIDI file is played directly by Cabbage/Csound using -F, there are no stuck notes. If I test this using Csound 6.10 from the terminal there are no stuck notes so, for me, this suggests that the problem lies with Cabbage (both Cabbage and Terminal are using the same version of Csound in this test). I can only surmise that using -F to play the MIDI file is bypassing an element of Cabbageâs MIDI interface that is the cause of the problem.
@alcomposer If you have experience that confounds any of these findings, can you post a MIDI file that will demonstrate it?
Iâm going to take a look at this now.
[edit] when I run that MIDI file with a stock synth in Reaper is doesnât feature any kind of modulation or pitch bends, is this how it is supposed to sound with a Cabbage plugin too?
It contains no use of pitch bend (I hadnât encountered problems with pitch bend) only aftertouch. The aftertouch wonât alter the sound of the Reaper synth unless it does anything with it (probably doesnât). The synth that you create in Csound doesnât even need to read in aftertouch (afttouch etc.), itâs the very fact of aftertouch being contained within the MIDI data stream that seems to cause stuck notes.
Iâll take a look. I might give you a call if I canât get my head around how this thing is supposed to work
Hey @iainmccurdy I never had extreme stuck notes like in your case.
However I just now did a test with running Csound from terminal- and there was a difference between PortMidi & CoreMidi? Is that possible? (basically no stuck notes with PortMidi).
Well, in my testing its the other way around. PortMidi works really well, and CoreMidi in MacOS doesnât. I also rebuilt Csound 10 just then from git with newest PortMidi on BREW. Donât know if that makes a difference.
However I am still hearing stepping when doing pitchbends in Terminal Csound 6.10 (git).
Even when I tell Cabbage to use either I can hear a difference, and notice stuck notes. @rorywalsh I thought cabbage took over all MIDI?
UPDATE just worked out that Cabbage sets its buffer manually - so added -b 512 to my settings and pitchshift is fantastic now (in terminal CSOUND). Now everything is working well on my system and no issues to report (apart from 127 AFTOUCH). By using PortMidi in MacOS there are also hardly any (basically no) stuck notes.
If you use -+rtmidi=NULL
then Cabbage will use its own MIDI IO interface. If you donât, then you may well be able to use Csoundâs, but this approach will most likely lead to all sorts of problems when you load your plugin into a DAW.
Ok, I think I may have found the problem. With the changes I just made both of those files run just fine. It seems I was dropping some MIDI data from any midi messages containing aftertouch, hence the hung notes. Can one of you guys send me a MIDI file that pushes the boundaries a little more in terms of MPE? Btw, Iâm using the synth posted by @alcomposer to test with. If either of you want me to test with any other synths let me know.
@rorywalsh Great to hear your making headway! And apologies for such a simple test synth!
@iainmccurdy this finding makes me think that there may be a difference between Rise & Blocks after touch update speed.
Hey guys. Here is a rendering of @iainmccurdyâs first MIDI file using @alcomposerâs simple synth:
http://forum.cabbageaudio.com:/uploads/default/original/1X/0c5cd8b3a3ca01247b2498280e5913b752b45429.ogg
Does that sound right to you? This was done hosting the plugin in Reaper.
This sounds promising. I tried the same as you: MIDI file imported into Reaper playing a simple Cabbage synth as a plugin with the latest OSX beta and got loads of stuck notes.
You must have missed my earlier post where I said
I have fixed this now, and that soundbite is the result of my changes. I havenât uploaded new betas yet however. I would still like to try something a little more complex. Any chance you could do another MIDI file for me?
Something in key of E-farp major, although Iâll also accept something in B-cat minor.