Hi!
I am using the modmatrix opcode to make a plugin to control other vsts.
For some reason, the table doesnt update properly when I load presets.
Both using Reaper presets and the cabbage preset system dont update the table. One value it can handle, but somehow more just doesnt work?
Any ideas?
I’ve been trying different things all day yesterday with no luck.
Here is the full csd file:
https://codeberg.org/mayaengel/master-thesis/src/branch/main/ModMatrix/ModMatrixCabbage.csd#
Here is the snippet that likely is causing the problem:
instr ModMatrix``
prints "ModMatrix initialised"``
kSpeed chnget "Speed"
; printks2 "kSpeed %f\n", kSpeed
#include "output.inc"
OSCsend kwhen, "127.0.0.1", 999, "SpeedOut", "f", kSpeed``
cabbageSetValue "VolumeOut", kVolumeOut
``
if kSpeed > 0 then
OSCsend kwhen, "127.0.0.1", 999, "VolumeOut", "f", kVolumeOut
else
OSCsend kwhen, "127.0.0.1", 999, "VolumeOut", "f", 0
endif``
;velocity of input
;check the velocity of the input of the featexmod
;if it is bigger than 0, sound is on (tho as a slider????)
``
SCoeffs[] cabbageGetWidgetChannels "_type(\"coeff\")"``
kIndex init 0``
kIndex, kTrig cabbageChanged SCoeffs``
SUpdatedChannel, kTrig cabbageChanged SCoeffs``
if kTrig == 1 then
kValue cabbageGetValue SUpdatedChannel
tablew kValue, kIndex, giModScale
ftprint giModScale, -1
endif
; ;for each channel in SCoeffs
; ;kValue cabbageGetValue SChannel
; ;tablew kValue, kIndex, giModScale
; kCount init 0
; kUpdateValue init 0``
kCount init 0``
while kCount < lenarray(SCoeffs) do
prints SCoeffs[kCount]
kUpdateValue cabbageGetValue SCoeffs[kCount]
printk2 kUpdateValue
tablew kUpdateValue, kIndex, giModScale
printk2 kCount
kCount += 1
od``
``
cabbageSet kTrig, "label1", sprintfk("text(\"Last updated widget: %s - Index:%d\")", SUpdatedChannel, kIndex)
ftprint giModScale
endin



