Value output from scriptnode
-
@Christoph-Hart You're a legend man, thanks. Having a lot of fun with this. Have a great weekend!
-
@Christoph-Hart this is interesting, I was following the docs and using a timer to get the cable value and update any elements of my project - works fine but this seems a more efficient and accurate method. How can I get .setRangeWithSkew into these callbacks for use with Frequency etc?
I've tried
Knob1.setValue(value.setRangeWithSkew(20, 20000, 1000); Console.print(value);
No errors but no activity either!
-
Am I being super dumb about this?!
-
Ok a bit more context, snippet below and callback too. I just want to convert the cable value into Frequency (or anything else but using the setRangeWithSkew function).
inline function onSync(value) { FREQ.setValue(value.setRangeWithSkew(20, 20000, 1000)); SimpleGain1.setAttribute(0, Engine.getDecibelsForGainFactor(value)); // GAIN };
HiseSnippet 2059.3oc2Y8zabbaEmiVMxQRoBIAFAo2XT6gUEJJZcbSBfQgW8u0dQsjWqUVN8jA0Lb0xnYImxgij1TTfdLHGRNFja4yPu0a9CPOTfVfdoeHx2fz2iblclQZkxFYGgnHAHs7w2i7Ge78Wtczp.dRhRS7lcugwbh2q62cnzzei9LgjzdSh2B9ayRLbM0QZ8gwrjDdHwyq1CPBdyNMw9y2c+0YQLY.ufDgruRDvejXfvTPsSy+nHJpEKjumXPItuay1AJ4FpHUJfmZ9qRhYAGwNjuCCYaJeh2LaEJLJcWCyvSHdSutJbX29pSjN92WjHNHhiCZP5BKjibKUTHhXjJYi9hnvN4m6DBwyuSgVnlSKba+sEghQzKzFugcBZgDk0GdSUEd0p.uFkg2pkf2XfjWIHMsCRuoe2.sH1TLChm48aKgKmdLPsWFJNdIS8E072PAbHMqLfcDukFFLRh5e3pqtLE9yR2at4.UehgdLSS0Cn+A5VxCER9JGxMOHRc.KZWUpQHObalDtPz0AIJDH.3WO.4cCFb9pu3fgOO.+zhUW3thAwQbzpoAHg0NCEZqd83Al5K5llZmewJaPqc25IfD4mDbiTChURXP8EwIsazbu+6S2quHgdBXdQOfS4mxCRM7PZxPYPe3nqRShFRURpoOmxRCEJ3SZNKbNgLBNtzdox.i.XPIA3ET+XVTJeo49K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UBFYNWAqksSvkHumUmVBf3.awOPGq4lmPVpZkpcx0gGNB7Alxs9sS1GmMfEQ12UHFbnvU2o4bHEYcNenjGGxp.7aWB3i335GpYJUej0Y7gh1hqBy4AXp4qXmXxQmMozHLQJhrrGSCsOkjUipjG3Ldrn.KUbA+CsMv55HkzobYj2x2Aebm.W4SyK1cSQRL3guNTUH20OdEJndPFxOM2XeKveMDzcVwyc.FsQn70FMBzIaKj6WpR6u8a9l+w82lcZYZDRyupY2pEpZ4CayzoMKG6zcqzgqEpP6apTZsR+O+yu8KaRtD.X+4b..V1tmqRYvK+BAv79ORohgnSZC4bK+0v9OCjX2vImaUHkbcNiwPE6x21W6hKtREdtHSzYm4u+P42+R3DUxZMCyfic1CmLVC7plTdkzn25mFMZt6w4Vl0RMpAfx11dPEXUcv5J0QCX1X+WoVIKm9dA2jy62EBvYe6nrZPwwzmwNlSe.GB8gUgbYUh+ulzmoLdhelxGGXfseOMSlDqRppb4CD6A8BmTl3SS3Xsb6hWukoughoG6Te28aAGxwJSWlIUasSxyEVpifZujMF03Gp6fWoOW50Z4ou7cn+p40cmMGit2SaK4w7Hvuvhw2BbD5wRiL4TqZWusRpxKLp3ReWNTU2gGxq5MOtCzZFCK3nBJ2t4t7HNqrA7us4i.COltZqo+nzEM9Q+R2i895c7cvkhNizeY7xJ0to8xJuZL4esQeSSidB4rNFK+M.bggvWZ369hM4PwXkUZOSDh4vyI7mZVMHO8u8t+lWzF7hzlNXuzmUkW659oSto8JDXnHPkeSBvVShaN.9M76v94fAw0wiC7Kk8X.KPqddf6caP2+WyRAzsR6WY8r9aiioMx+pU7wWd.+9EDOOH.C39dvcv3k4NWAY9fqfL28JHyu+JHyGdEj4itBx7wWpLX4nYcuf9X.gNa4Za2aKI14k0ci7+AZE2.dC
Someone throw me a bone!
-
@Christoph-Hart still trying with this... How can I convert a GlobalCable's value to something else (frequency for example) whilst using the Cable's callbacks? Or is it not possible?
HiseSnippet 2057.3oc2Y8zabbaEmiVMxQRoBNA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NfYi8OQs+UN88BtIm2uKDfy9BQY0ThioOgcDmdOND5Cq73hpr9ebYeLx3K8iQ9v.Cr86pYxjXURUkKefXWn+0jxDebBGqYaG75sL80UL8Xm56uaK3PNVY5xLoZqcRdtvRU3W6hdTzFS3ihN8UtGE8UfNnq7tsyliQ2qiso7HdD3KXw3aBF+8XoQlbpUsk2RIU4ECUbQuCGpj6fC3U8fG2AZUigEbXAkazbGdDmU1n8W17AfwFSWs8xeT5hF+neC6wde819N3RQGP5qtu7Qsed+xGkuNesQ+VQid32rN.K+F9ma34+50+Ue2FbnPqxJpmHBw7y4D9sMqF.+Yy7u276ZCdKZSGre3Sqlq8x9YNdN75ASe4tLt3H0WVaWLjCnxeUBvVShWc.7086vtJXP7xnw+etrGCXAZ0SCbuIC59+ZVJftUZ+Qmm0eKbLsQ9O0gO9pB367KdZP.Fv8cg6fwKysm.YduIPl6LAx7al.Yd+IPlOXBj4CuPYvRMy5LA8w.Bc1z0Rt2lRrqJq6F4+Avcm42F
-
Yeah, you need to ignore the function argument and call
Cable.getValue()
to obtain the scaled value:inline function changeFreq(value) { // FREQ.setValue(value); // won't work FREQ.setValue(freqCable.getValue()); } const var freqCable = rm.getCable("my_cable"); freqCable.setRangeWithSkew(20, 20000.0, 1500.0); freqCable.registerCallback(changeFreq, SyncNotification);
But this is counterintuitive so I'll change that so that it will call the function with the scaled value once you've called a
setRange()
function (because chances are high you'll want to use the scaled value and you can still get the normalized value withfreqCable.getValueNormalized()
. -
@Christoph-Hart aha, excellent, thank you :)
-
Alright I've changed this so that the
value
argument will be converted using the provided range, but this will obviously break projects that do not assume this (eg. your snippet will totally blow up trying to set the gain output to +20000dB lol).Given that it's a rather new function and nobody seems to have complained about the range not being used correctly until now I think it's reasonable to just introduce this breaking change.
-
@Christoph-Hart Great, would you mind updating how the function should look with .setRange() please?
-
inline function changeFreq(value) { FREQ.setValue(value); // will work // FREQ.setValue(freqCable.getValue()); // will work too }