Output Meters Function problem
-
Hello, I'm having trouble with my Output Meters code.
I am using sliders named "LeftMeter" and "RightMeter" and all I get after writing this code is "Unknown Function 'setValue'"How can I make it work?
//meters//
const var LeftMeter = Content.getComponent("LeftMeter");
const var RightMeter = Content.getComponent("RightMeter");reg timer = Engine.createTimerObject();
timer.setTimerCallback(function(){
leftMeter.setValue(Engine.getMasterPeakLevel(0));
rightMeter.setValue(Engine.getMasterPeakLevel(1));
});timer.startTimer(30);
-
Use the built in peak meter floating tile
-
@jantrafasmusic Also, you may want to check out my peak meter tutorial, which includes all the code for complete peak meter.
-
@jantrafasmusic - as a more general pointer to working out this sort of thing try doing this when its not working:
const var LeftMeter = Content.getComponent("LeftMeter"); const var RightMeter = Content.getComponent("RightMeter"); reg timer = Engine.createTimerObject(); timer.setTimerCallback(function() { // do this to debug your code... Console.print(Engine.getMasterPeakLevel(0)); leftMeter.setValue(Engine.getMasterPeakLevel(0)); rightMeter.setValue(Engine.getMasterPeakLevel(1)); }); timer.startTimer(30);
and then when you see the values being returned ask your self...."can I actually apply that to my slider?"
-
@jantrafasmusic Also, you've defined your variables as LeftMeter and RightMeter, but your're trying to setValue to leftMeter and rightMeter.
-
@Dan-Korneff that was it, thank you lots