Roli Seaboard MPE with Cabbage

Just read this thread: Aftertouch problem - #3 by iainmccurdy

@iainmccurdy I made a test instrument that uses midiin like you suggested:


<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

massign 0, 1

;instrument will be triggered by keyboard widget

instr 1

kbnd pchbend 0, 48 
kbnd portk kbnd, .01
kpchbend = semitone(kbnd)

iInstrchan midichn

kstatus,kchan,kdata1,kdata2	midiin
if (kstatus==208 && kchan==iInstrchan ) then
kAftouch	=	kdata1
endif
 
kAftouchnew portk kAftouch/127, .05
//printk2	kAftouchnew

kEnv madsr .01, .0, 1, 1
ares pluck p5, p4*kpchbend, p4*100, 0, 1
ares2 oscil kAftouchnew, p4*kpchbend
out (ares+(ares2*0.5)) * kEnv

endin

</CsInstruments>
<CsScore>
f0 z
</CsScore>
</CsoundSynthesizer>

This actually works better in Cabbage than QtCsound for me. The Seaboard in Csound is now starting to feel like a real instrument!

One question regarding portk is there a better way to smooth out the k signal, so that swells are nice and smooth? I have tried interp but that doesn’t seam to work. I can just set the k-rate to 1, but I would prefer to have something less taxing on computer for live performance.

@rorywalsh after reading more about Geert’s github I found SendMIDI. This looks like it can easily generate virtual MIDI streams, with lots of control data. Possibly this could be used to make a ‘virtual’ Seaboard (lots of MIDI channels & pitchbend, pressure etc…):