# Presets not updating modmatrix

**URL:** <https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945>\
**Category:** Cabbage Stew\
**Created:** [2 December 2025 12:05 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945 "2025-12-02T12:05:19Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [2 December 2025 12:05 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/1 "2025-12-02T12:05:20Z")

</div>

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:

> **[Cookie monster!](https://codeberg.org/mayaengel/master-thesis/src/branch/main/ModMatrix/ModMatrixCabbage.csd#)**

Here is the snippet that likely is causing the problem:

> 1. `instr ModMatrix`
> 
> 2. ``
> 
> 3. ` prints "ModMatrix initialised"`
> 
> 4. ``
> 
> 5. ` kSpeed chnget "Speed"`
> 
> 6. ` ; printks2 "kSpeed %f\n", kSpeed`
> 
> 7. `	`
> 
> 8. ` #include "output.inc"`
> 
> 9. ` `
> 
> 10. ` OSCsend kwhen, "127.0.0.1", 999, "SpeedOut", "f", kSpeed`
> 
> 11. ``
> 
> 12. ` cabbageSetValue "VolumeOut", kVolumeOut`
> 
> 13. ` `
> 
> 14. ``
> 
> 15. ` if kSpeed > 0 then`
> 
> 16. ` OSCsend kwhen, "127.0.0.1", 999, "VolumeOut", "f", kVolumeOut`
> 
> 17. ` else`
> 
> 18. ` OSCsend kwhen, "127.0.0.1", 999, "VolumeOut", "f", 0`
> 
> 19. ` endif`
> 
> 20. ``
> 
> 21. ` ;velocity of input`
> 
> 22. ` ;check the velocity of the input of the featexmod`
> 
> 23. ` ;if it is bigger than 0, sound is on (tho as a slider????)`
> 
> 24. ` `
> 
> 25. ``
> 
> 26. ` SCoeffs[] cabbageGetWidgetChannels "_type(\"coeff\")"`
> 
> 27. ``
> 
> 28. ` `
> 
> 29. ` kIndex init 0`
> 
> 30. ``
> 
> 31. ` kIndex, kTrig cabbageChanged SCoeffs`
> 
> 32. ``
> 
> 33. ` SUpdatedChannel, kTrig cabbageChanged SCoeffs`
> 
> 34. ``
> 
> 35. ` if kTrig == 1 then `
> 
> 36. ` kValue cabbageGetValue SUpdatedChannel`
> 
> 37. ` tablew kValue, kIndex, giModScale`
> 
> 38. ` ftprint giModScale, -1`
> 
> 39. ` endif`
> 
> 40. ` `
> 
> 41. ` ; ;for each channel in SCoeffs`
> 
> 42. ` ; ;kValue cabbageGetValue SChannel`
> 
> 43. ` ; ;tablew kValue, kIndex, giModScale`
> 
> 44. ` ; kCount init 0`
> 
> 45. ` ; kUpdateValue init 0`
> 
> 46. ``
> 
> 47. ` kCount init 0`
> 
> 48. ``
> 
> 49. ` while kCount < lenarray(SCoeffs) do`
> 
> 50. ` prints SCoeffs[kCount]`
> 
> 51. ` kUpdateValue cabbageGetValue SCoeffs[kCount] `
> 
> 52. ` printk2 kUpdateValue`
> 
> 53. ` tablew kUpdateValue, kIndex, giModScale`
> 
> 54. ` printk2 kCount`
> 
> 55. ` `
> 
> 56. ` kCount += 1`
> 
> 57. ` od`
> 
> 58. ``
> 
> 59. ``
> 
> 60. ` cabbageSet kTrig, "label1", sprintfk("text(\"Last updated widget: %s - Index:%d\")", SUpdatedChannel, kIndex)`
> 
> 61. ` ftprint giModScale`
> 
> 62. `	endin`

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [2 December 2025 18:24 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/2 "2025-12-02T18:24:18Z")

</div>

Sorry, i’ve never used that opcode, and can’t follow the code you posted as I’m not really sure what you’re trying to do. Can you produce a simple, extremely minimal csd file that illustates the problem?

---

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [8 December 2025 18:44 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/3 "2025-12-08T18:44:28Z")

</div>

haha, my bad, should have been a bit more clear. Symptom of staring at this code for so long.

Here is a simple version of the ModMatrix instrument  
[ModMatrixCabbageSimple.csd](https://forum.cabbageaudio.com/uploads/short-url/ovjTwYIZhWkiQQZG5KqfIDXcQgr.csd) (22.3 KB)

So: when the I update the UI, it writes to the table as expected. When I load a preset, either in cabbage or in Reaper, the UI updates, but the table does not.

Hope that’s a bit clearer \<3 🙂

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [9 December 2025 09:18 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/4 "2025-12-09T09:18:12Z")

</div>

Can you prepare a minimal example, this is still far too complex. As you know, Cabbage doesn’t save tables, but the fact that the UI is updating correctly means something is failing to trigger the table to write. The cabbage get value opcodes have an option trigger on i-pass parameter:

```
kValue [, kTrig] **cabbageGetValue** SChannel[, iTriggerOnPerfPass]
SValue [, kTrig] **cabbageGetValue** SChannel[, iTriggerOnPerfPass]

```

Can you try enabling that and seeing if that makes a difference?

---

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [9 December 2025 11:48 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/5 "2025-12-09T11:48:38Z")

</div>

> kValue cabbageGetValue SCoeffs[kIndex], 1

Is that what you mean? When I write the code like that I get an error saying;

> error: Unable to find opcode entry for ‘cabbageGetValue’ with matching argument types:
> 
> Found: k cabbageGetValue Sc  
> Line: 373

I also just now tried

> kIndex, kTrig cabbageChanged SCoeffs, 0, 3

but then the table doesnt update when I update the UI.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [9 December 2025 12:01 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/6 "2025-12-09T12:01:00Z")

</div>

What version of Cabbage are you using? Have you download the latest build from Azure DevOps?

---

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [9 December 2025 12:06 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/7 "2025-12-09T12:06:34Z")

</div>

the latest from the website, should I get the latest from azure devops? I’ve never downloaded from there before. Am on Windows

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [9 December 2025 12:16 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/8 "2025-12-09T12:16:36Z")

</div>

Yes please, you can grab them from here:

> **[Pipelines](https://dev.azure.com/rorywalsh/cabbage/_build/results?buildId=2800&view=artifacts&pathAsName=false&type=publishedArtifacts)**

There are 3 dots on the right when you hover over the Installers button, you can grab the installers there. Hopefully this will make a difference 👍

---

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [15 December 2025 11:14 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/9 "2025-12-15T11:14:42Z")

</div>

I think maybe I understand the problem?

With the code like this, when I load a preset, kIndex goes from 0 to 70. When I use printk2 it never changes. So somehow the index doesn’t update properly and thus it doesn’t write every nslider into giModScale table.  
Could that make sense, based on how the opcode works?

I’ll try and actually get a full .csd file that’s clear later:)

> ```
> gSCoeffs[] cabbageGetWidgetChannels "_type(\"coeff\")"
> 
> kIndex init 0
> 
> kIndex, kTrig cabbageChanged gSCoeffs, 0, 3
> 
> printk 0, kIndex
> 
>    
> 
> if kTrig == 1 then
> 
> kValue cabbageGetValue gSCoeffs[kIndex]
> 
> tablew kValue, kIndex, giModScale
> 
> ftprint giModScale, -1, 0, inum_mod * inum_param
> 
> endif
> 
> ```
> 
> i 5 time 7.26667: 0.00000  
> PresetName: C:\Users\mayaf\Documents\Projects\NTNU\Thesis\Project\code\ModMatrix\Presets\B.psts i 5 time 7.26933: 70.00000  
> ftable 107:  
> 0: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000  
> 10: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000  
> 20: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000  
> 30: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000  
> 40: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000  
> 50: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000  
> 60: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000  
> 70: -1.0000 0.0000  
> i 5 time 7.27200: 70.00000

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [15 December 2025 13:19 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/10 "2025-12-15T13:19:46Z")

</div>

You could be right, this all sounds frighteningly familiar! Would be great if you could produce an extremely simple example so I can debug it more easily. 👍

---

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [15 December 2025 18:10 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/11 "2025-12-15T18:10:26Z")

</div>

I _think_ I have it as simple as possible now without breaking it  
[ModMatrixCabbageSimple.csd](https://forum.cabbageaudio.com/uploads/short-url/e7gQdovgXJYAKlVWCqqtrO7e1Gh.csd) (8.0 KB)

---

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [15 December 2025 18:37 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/12 "2025-12-15T18:37:31Z")

</div>

I have hacked a fix lol  
I added a button that will trigger a loop that cycles through the entire list of nsliders, and writes to the function table. I have to manually press that after loading a preset lol

> **[Maya✨🏳️‍🌈 🍉 (@mayacomposer.bsky.social)](https://bsky.app/profile/did:plc:7f7onh3gj77rxz6jjgt4uoaj/post/3ma2budv5rk2s)**
>
> it works... sometimes?

> kPresetCount init 1
> 
> ```
> kWritePresets chnget "WritePresets"
> 
> kChanged changed kWritePresets
> 
> if kChanged == 1 then; once per second table values manipulation:
> 
> kPresetCount = 0
> 
> loop:
> 
> kValue cabbageGetValue gSCoeffs[kPresetCount]
> 
> tablew kValue, kPresetCount, giModScale
> 
> printk2 kPresetCount
> 
> loop_lt kPresetCount, 1, lenarray(gSCoeffs), loop; loop construction
> 
> kPresetCount = kPresetCount + 1; increase counter  
> 
> endif
> 
>            
> 
> kIndex init 0
> 
> kIndex, kTrig cabbageChanged gSCoeffs, 0, 3
> 
> ; printk 0, kIndex, 4, 1
> 
>    
> 
> if kTrig == 1 then
> 
> kChangedSliderValue cabbageGetValue gSCoeffs[kIndex]
> 
> tablew kChangedSliderValue, kIndex, giModScale
> 
> ftprint giModScale, -1, 0, inum_mod * inum_param
> 
> endif
> 
> ```

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 December 2025 09:14 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/13 "2025-12-16T09:14:59Z")

</div>

It’s not ideal to have to manually trigger the button. You never confirmed to be me what version you’re using?

p.s. the reason I ask is becuase this works as expected here with the latest build, although I’m testing on macOS.

---

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [16 December 2025 10:38 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/14 "2025-12-16T10:38:50Z")

</div>

I have updated now to the latest version from dev.azure. I am on windows 11. I do have linux mint installed. I can try there too. Maybe it’s windows being silly

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 December 2025 10:51 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/15 "2025-12-16T10:51:36Z")

</div>

I hope it’s not because I’m about to leave for Christmas holidays and won’t have access to a Windows PC until early in the new year 😖

---

<div class="post-metadata">

**Author:** ![mfe](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mfe/32/3522_2.png) [@mfe](https://forum.cabbageaudio.com/u/mfe)\
**Post date:** [27 January 2026 10:17 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/16 "2026-01-27T10:17:15Z")

</div>

Is it possible to create a kTrig that responds to a preset update? So when I change to a new preset a kTrig value becomes 1.

So “kTrig PresetChanged”  
or something.

I havent found anything (might be I have read over it)

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [27 January 2026 10:24 UTC](https://forum.cabbageaudio.com/t/presets-not-updating-modmatrix/4945/17 "2026-01-27T10:24:43Z")

</div>

Did you look at teh Newpresets.csd example file? It does this:

`SPresetFile, kTrig cabbageGetValue “presetChannel”`

where presetChannel is the preset button channel. It will update each time a new preset is selected.
