Matrix controlling other widget

Hi,

I’m using a button matrix, and for some buttons, I want to set other widgets (faders) to specific values.

In the properties of the matrix, I have this script :

JS{{
var props = {}
var labels = ["Hannya Shingyo", "", "", "Rishukyo", "Three deep Monk", "", "", "", "Harmonium", "Bladed Drone", "Rainstick", "Quartz Rainstick", "Aum Mantra", "Bhajan Sheila", "Tanpura", ""]
var indices = [48, 49, 50, 51, 44, 45, 46, 47, 40, 41, 42, 43, 36, 37, 38, 39],
    index = indices[$]

props.script = "if (value) set('matrix_samplerRack01/*', 0); if (value) set('matrix_samplerRack02/*', 0); if (value) set('matrix_samplerRack03/*', 0); if (value) set('matrix_samplerRack04/*', 0)"

props.label = labels[$]
props.alphaFillOn = 1
props.on = 127
props.off = 0
props.address =  "/note"
props.target = "midi:virtual_midi"
props.preArgs = [8, index]
return props
}}

and in the onValue

//console.log(get('matrix_samplerRack03'))
var mtxVal = get('matrix_samplerRack03/13')
var mtxVal2 = get('matrix_samplerRack03/11')
var mtxVal3 = get('matrix_samplerRack03/10')
var mtxVal4 = get('matrix_samplerRack03/9')
var mtxVal5 = get('matrix_samplerRack03/8')

console.log(mtxVal)

if (mtxVal == 127 || mtxVal2 == 127 || mtxVal3 == 127 || mtxVal4 == 127 || mtxVal5 == 127){
  set('fader_samplerVocBandwidth', 0)
  set('fader_samplerVocGate', 111)
  set('fader_samplerVocAttack', 0)
  set('fader_samplerVocRelease', 90)
  set('fader_samplerVocDry', 127)
  set('fader_samplerPitchI', 80)
  set('fader_samplerRate', 75)
  set('fader_samplerLength', 15)
}

When I press one of the buttons, all my faders are set to the correct values. However, any button I press after this one will also set the faders to these values, even from another matrix that I have.
what am I missing ?

A minimal session could help understanding the issue, hard to guess with available informations.

This is it
matrix.json (28.4 KB)

Adding {script: false} in the set() calls from the button scripts should avoid this cross script triggering:

props.script = `
if (value)  {
  set('matrix_samplerRack01/*', 0, {script:false})
  set('matrix_samplerRack02/*', 0, {script:false})
  set('matrix_samplerRack03/*', 0, {script:false})
  set('matrix_samplerRack04/*', 0, {script:false})
}
`

Once more, perfect solution