Scriptknob wont update parameters
-
Hey there,
I made a script where one knob controls two other ones. The problem is that even tho the knob values in the interface change, the values in the module tree don't.
Content.makeFrontInterface(600, 600); const var Knob1 = Content.addKnob("Knob1", 10, 20); Knob1.setRange(0, 1, 0.01); Knob1.set("text", "Main Knob 1"); const var Knob2 = Content.addKnob("Knob2", 10, 70); Knob2.setRange(0, 1, 0.01); Knob2.set("text", "Linked Knob 2"); const var Knob3 = Content.addKnob("Knob3", 10, 120); Knob3.setRange(0, 1, 0.01); Knob3.set("text", "Linked Knob 3"); inline function onKnob1Control(component, value) { Knob2.setValue(value); Knob3.setValue(value); } Knob1.setControlCallback(onKnob1Control);
HiseSnippet 1144.3ocyW0raabCDlqjVmHkZmlBihdbg.JfLfggVozjBXDXEKY0JDKGAKGidKfdWtVDhKoxtTIVsn26qPt0Wj9TzSsm5iPeCZGxc09isrrhZaP4AgkyvgeeyPNyPMHP3PBCEAHixmMaBAY7IlCmwkiZOBS4ndcPFaY1GGJIAVQhNb1DbXHwEYXT7aTBLJWBoG+4AGhYXtCIUDBctf5PNl5SkoRGz5ETFqK1kbF0OypebqdNBdaASLE3SQy5nIXmw3KImfUKqfIxXiiboRQvPIVRBg0bnvc1vQh2wiV+4zP5ELhZhMZHrQQhQsGQYtCl6qgHjQoAoddwHOeay9TWZh7zHvmpUXkZQ1XfQgkQI6O.JYjgRkhnziLG5DPmHS0n3yCL6wgCDOLDpyRkn0hJ7KELaKfUvk64iGS5F.SRrn1SpWeWK3mc1uRkJP7NTZ8Vbf0K3hKrsdl0bKwttJQ0ppUTcWKavrFJqzB1KjHOEyujTCDauqU88pauy9VoJqUURtRB1UsODG0aukc0E.ZiaCzFwf9z4f1XYf1HOnGS4iItQv1PCadTadan1LFU6Des4xfs4sCaSMrTNixIVdS4NRpfaI35PjB6.AqlivehfCrXWfZrojcp7CUrfQhKctRZsHc.ly00bA59QH1lD+iAnMlwt.xhpkG2c1OCgNQHIujWSAcYXSrttJOuEpKdqXjfEpVkaGrLCqwm5eAIHiiqWHb4OeF0FqVFkSzoYlEJ383T4KmPhm2UvbUYJpuuY9GJ95.jIVLlgvWRcd3Vw4gCYTWR.hBax8L0wSjl7w0v94IO62O.sxF23ehwMWfwupWGrDqJkD6Kf+MgDHopvnQGxagZwQEVJa1gDNVJlnc13qfPkk6zcuBYXZTAPbl5isgOBkyTGFanW.xm55xHCDgT0gcZs8+3fvoddzqTQ+uD4QY9gR.hd9P4cjwmY9pPhkKwCOkIsBGCEdY5LoyD5599BWXUet4Ih.eLi98D2Aj.GfxJqU4dHiMMyTmQcXl3TadmGC4cptejbpIyu70Cnx8gCDFdlMzxK.51AEqUR2xrKg3pxeOl3IWkvvCMyU46CJPz7ZAhq9+Sf3gIAhSoWNZMhDMgmcbi1qPicg6TFVluau5YMwJTdY1Vrp1nbv6mk8YOW+I.kt8BV0yTv5NJGshz8QlCnRmQKluEV.egxC+Wy23GTso4QddDGYJYKY186V5qmJsZ05Soxc9RpGDwk6EcsRyhjqXYYhVjpmkNSKIZ8EsRTDcyKQy1sxkaFWG98u+2NH+U0LJNV7tA.fcCHuIYe9oes02RugTTmV8UoSoIXmQf7X3o4N4t4U7eoGehNULUR4W1GC4spp.mL0eH7LbGBb3w4DVnpfPAUWxn40UyUjXHg6pm7WvHVosZtQrR64J+nfgO1IP7Zmntnp6B2WKA7at9OQTFZS.ysx23VOfhazW63jeqtggMVWCattF9300vuZcM7IqqgOccM7quaCU+GrmOUJ7ipxgP8Gbj94NFFGwwvsbcZL5uAs4KGCC
-
@elemen8t You need to call Knob2.changed(), and Knob3.changed() after setting the values.
-
If you want to control UI components + Module Attributes, you will need to assign both in your callback.
// Open and right click on the Delay module, // then create the generic script reference and paste it here const var Delay1 = Synth.getEffect("Delay1"); inline function onKnob1Control(component, value) { Knob2.setValue(value); Knob3.setValue(value); Delay1.setAttribute(Delay1.FeedbackLeft, value); Delay1.setAttribute(Delay1.FeedbackRight, value); }
Keep in mind that whatever you assign in the property editor will typically overwrite what you are scripting. In this case you are fine, but in other situations you may need to script them.
Example:
inline function onKnob2Control(component, value) { Delay1.setAttribute(Delay1.FeedbackLeft, value); }; Content.getComponent("Knob2").setControlCallback(onKnob2Control);
HiseSnippet 1244.3ocuWE0aZbDDdOiuFaRiSiTTerZkkpDtxxA3.rqrpriMlDTLNHiqUeKc4tAXkO1kd2RhoU889qoO2e.8eP+Cz9Peu+CZmcuC3tXvFiRy8fE6L6reyL6Ley5lARWHLTFPrxdwnA.w5SsaMRn5cbOFWPpWkXsgcCVnBBnQhNZz.VXH3Qrrx7Bs.q0WkX99mCNh4yDtvTQDxkRtKbJuOWMUZyCeE22uFyCtf2OwtKcXcWo3XoubH5OYrySFvbuh0ENio21J1jWxB6Qr9J6Jtec47sg7kKuWIm8JUpRoJky2IuSm16UoTamcK43UpbAWGh0mbhGWICZoXJHjXs5QRuQs5IemHBfK4g719fdQARKD4Hw0j9d5PTKkbbOtuWywIpPBdJMml1xDk1dpcCtGeh7oouOynfN0hjIPqUR6dYR4dER5d4S3dyvkrR3RqF4ROwtka.efZpFs+7P65B71rCCumR5JQ6krxumw9XItCgZm9rqfZA3hIVjqR97aSw+r09YylEurBUz2xBnuRHaWf9MzwVx77zhxsoQwlaSKflUTakQvNgf5blnKjCEWXaZ9cxWXq8oSUlaSEbsBsayFXdzb7zBaNCPKNOPKFC5tiAs3sAZwzfdJWbE3EAaQCroQ0Ydn5DiZgIwpysAqy7g0w.6ydF80C.AkI7nA7t8TTWet6UTofp5AzpfOaDsuzanOrMUuaTpf5F.X4jYGcAADvcoglaWZ.zAB.rE0bhCz80Tth1CElHDMGq95zvDrSWPcRmNfK5oQZLtFW3yE.syPgqhi9iTXt8zok.oeNWY+ARAlf1FOR+gvVY+orT7aR19RszbQ5vzwXcNyQWDxZkOWoB3sGpfbwxpAfWajn3TnyDz1eQM5bcVcpU+LVgMoJLNVNl46q2ZtzgHt6DA+YRE7ZQNcXtNdJz2WUmNyTW7Y4CAyTsleL31LLmXX+1PPhjrYiHGPZhE64Srjj2yMpnNwFkh5BtRWDNO1PRbm.RBkI1qveoLTPaDSA0xm6AADNxz7.aSRjXb3Xt+u+29h+9.xBabwTFS+0W7W2CiclAxea8pLESyhFGKX7M.BTbcpypJ7VbFVDm551UgvqTxAlfMtDmXs1cFtWi2AVYQDGo+wSwezm644CMkgb8U5zof+4AgC6zgesNe+kDr4FO3O29LYPelO+GAulPfKBJNVjnINHVOxNAIo95Xhak8NSjocqZKraMXbAPc7vVyNpoBGWGfSpwYEZoaXmrwbQBjGamh38dEJNuWnb8GxP4w1onKt+whC9nmaLeFeYfl4loR+bA8iphUn85jyn0ygEXzLJ4it9f8FhE0EehcStxs2r8wUlgOhMV+e3iwu75Q1QSml5fqZW669H7LqGFg+ChJYLHOo7II5FQZlbSePhrxDEQUUIzjpyIAMW5xvDTXmJeWSDvZAvOL4b9k+3vWxugTR0CanK8m1LbAfcY3nd2TUUYV3TVga+F6b4PEWzsACm.q6QOaX+V3C7cA7BSH.e8zIqUzyQhVmWuV6Ds.gmYw+hewJKnWaEqrvXkeTvnOyMP9F2n4L5Zg0LRv3VX92SVGogw0zzi1LeHQD+MttoOpaXXwk0Pmk0vRKqgkWVCqrrFt6xZ3d2sg5+AsmOTI6GwlQHMZdh4AAVVmHXXUtoMl7ev5G8rN
- Edit: I was too late, @d-healey 's method is better !
-
@HISEnberg said in Scriptknob wont update parameters:
you will need to assign both in your callback.
You can use a value broadcaster instead of a callback and keep the module assignments.
-
@d-healey @HISEnberg
thanks a lot guys that fixed it!! -
@d-healey You're correct and this sounds to me like the cleanest solution. I really want to dive into broadcasters and rethink my scripting approach soon since they offer so much.