linking slider to a simplegain, the other way around.
-
i have a filmstrip of a vumeter on a slider, iam just tryin to effect the slider values with the value of the peak on a simplegain, iam using the getAttribute function ,but the console says function now found. i could have used a matrixpeakmeter with laf to run the filmstrip but this is just how i want to do it.
const var SimpleGain = Synth.getEffect("SimpleGain1"); const var vumt = Content.getComponent("vumt"); const var VUTimer = Engine.createTimerObject(); VUTimer.setTimerCallback(function() { var peak = SimpleGain.getAttribute(SimpleGain.Peaks); vumt.setValue(peak); }); VUTimer.startTimer(30); -
@Jeetender I don't think the SimpleGain has an attribute named Peaks
SimpleGain.getAttribute(SimpleGain.Peaks) // try SimpleGain.getAttribute(SimpleGain.Gain) -
@Jeetender Use a peak meter floating tile and look and feel.
-
@David-Healey i tried it, also took reference from a snippet, but the filmstrip is flickering ...
@ulrik its not reading .gain too..
-
@Jeetender SimpleGain.Gain, not SimpleGain.gain, it should have a uppercase G
-
onst var SimpleGain = Synth.getEffect("SimpleGain1"); const var vumt = Content.getComponent("vumt"); const var VUTimer = Engine.createTimerObject(); VUTimer.setTimerCallback(function() { var peak = SimpleGain.getAttribute(SimpleGain.Gain); vumt.setAttribute(vumt.Value, peak); Console.print(peak); }); VUTimer.startTimer(80);its reading the gain values and printing the gain value on the console as i move the gain knob on teh simplegain module,
-
const laf = Content.createLocalLookAndFeel(); laf.loadImage("{PROJECT_FOLDER}vumeter.png", "VUMeter"); laf.registerFunction("drawMatrixPeakMeter", function(g, obj) { var a = obj.area; var z_value = 0; var frames = 128; var zerpnt = 90; for (i = 0; i < 2; i++) { var z = obj.peaks[i]; if (z <= 1.0) z_value = Math.round((zerpnt - 1) * z); else if (z > 1.0 && z <= 1.413) z_value = Math.round((zerpnt - 1) + (frames - zerpnt) * (z - 1.0)/0.413); else z_value = frames - 1; g.drawImage("VUMeter", [i * 150, 0, 128, a[3]], 0, 80 * z_value); } }); const var FloatingTile1 = Content.getComponent("FloatingTile4"); FloatingTile1.setLocalLookAndFeel(laf); -
@Jeetender You can do this without a filmstrip
There's a working example here: https://forum.hise.audio/topic/13154/knob-web-studio/66?_=1777296953372