vuuuu meter.... vu meter? vu meter master?
-
@DimitrisSP
Oh Thanks Man Will Do It Right Now -
@Natanr Happy that i helped!
-
@DimitrisSP Ha Ha Yes Man This One One Works Thank You οΈοΈοΈοΈοΈ
-
@DimitrisSP Testing this , what is that levelMeterLock ?
Also , any thoughts on how to change this to a mono meter , that is , see both channels on one meter ?
-
@lalalandsynth said in vuuuu meter.... vu meter? vu meter master?:
@DimitrisSP Testing this , what is that levelMeterLock ?
Also , any thoughts on how to change this to a mono meter , that is , see both channels on one meter ?
take the input values , sum them and divide by 2....
-
@lalalandsynth said in vuuuu meter.... vu meter? vu meter master?:
what is that levelMeterLock?
Since This Made By Sliders, You Need To Place An Empty / Transparent PNG Over The VU Sliders To Avoid Mouse Click / Drags.
-
@lalalandsynth Sorry for been late to answer...I just now entered in the forum!
In order to have a mono functionality use only one LevelMeter...
Delete ''LevelMeterR'' and rename "LevelMeterL" to "LevelMeter"
Very correctly as @Lindon said ...sum the Left and Right values and divide them by 2...Use this snippet
HiseSnippet 1611.3oc4Y0saaaCEVJNZHwcYqcnCXWRTzKb1ZSrS+YannKNw+T3sjZiXu1kcSJiDsMWjHEjnSSVP.1qQuauF6t7nrGg9FrcHojEsqiqgQawxp.BfIO+vuyGO7viTZEwcIww7HK6k6bZHwx9ScZeJSzuReLkY0npk80c1gbLweWhfD0gDKr19zPbbLwyx1N2SjZYu7hVpmWu41XeLykjMkk0y3TWxNz.pHa1Vk+IpuecrGoCMvP66WtgKmUg6yG.HJmSQqPr6Q3djmhkpsfik8mTyiJ3QsEXAI1xdws4dm1tO+kLs9OiFSOzmHGTxpM3H8z049dRDKm0pRepuWqzHO1xx1oUFOjSyC2zYWpGc37l7gT.JyBS9vdgoAuRlvq3rCOaC3snFd2vosaDMTjIQhsq4zfAaScwvVfIrz5Zsvm63TgCZvDqEfOhTOBFLzhBOrXw6fdPwhq9nUxuRdXiHVfNFGgx1+QOFkZeOhnBOHjyfAEtUlJ25xsdGt6QyfGjp8FdoElcolBxdC8aS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hHCIzUlT5uvQQ4Wk.rJk3pCfutrV4+Af6d7ABJqG7VGQpaceJbuDePjKAfJiAcSCyYufrEL83hxwR.0lv7TC9G3IQXI4X6DgkREZRI2TSIWy443iIpWFRwFeoZbWdT.5IDFIRxUkdW70RBm4uVRSWA.gNQXVbHOlTxzyiIaiQqMIFvFUc8TinkL7f2KIvPukJmN4FlSBoEi3LX7HdZWpwMu+8l0XXXSuMAhFulwtPvJ4NSlp0.3E7TmNJYZX1zaXN830FWb1pMdk9iD8gqujbyFbeKWntbJF02eVCtnyGdAhgUtUMFmN6nGi1ky3g84LpqYN0dD3zeudjQxalX.skPfglgGNyMKuGwmfiIlMDuC7B43nc08cOObQoYmKl190W4ngKRd1G8+i9Iy8QY+jy9ITn73GI2p9gXMBvtQ7Cb0epC4QukTy.wMS8eUXYmckiQkR+JGNNEWqn7U.oG35JyNtKvOS1lMlCat2bXy8mCadvbXyCmCa914vluap1Hu6bqABdfN+GlnUM0Wax1V2pf5nf0+h9zF.s
And as @Natanr said very correctly if you will not use an invisible image like "levelMeterLock" on top of the LevelMeter you will have problems with Mouse Click / Drags.
-
Its all in the algorithm....maybe a few guys here could help you out.
-
@DimitrisSP @Natanr @yall
Thanks a lot @DimitrisSP for the vu-meter. I modified it a bit to make whole integers from your png of 107 strips and set it to -100 to +6 dbFS. Also added peak values in labels for both L, R and highest of the two.
Here is that project (scriptnode 2020-08-20): LevelMeterTest--andioak-peak-values.zip
@Christoph-Hart Is there a pan-law compensation built into the Simple Gain module/plugin? To compensate for the increased value from the other channel? The values I get are steep when I pan towards one way, but it might be my programming here. (and my gain is +1, but at Left 40:ish i get around 5-6 db over the center peak, thatΒ΄s about what pan law should compensate for...) (and the gif below is 7fps :) )
Here it is:
Script of this thing:
Content.makeFrontInterface(600, 500); const var LevelMeterL = Content.getComponent("LevelMeterL"); const var LevelMeterR = Content.getComponent("LevelMeterR"); const var LevelMeterLock = Content.getComponent("LevelMeterLock"); // show values as well, via label with whole integer db values. const var Label_MeterValue = Content.getComponent("Label_MeterValue"); // the peak of the strongest channel. const var Label_MeterValue_L = Content.getComponent("Label_MeterValue_L"); const var Label_MeterValue_R = Content.getComponent("Label_MeterValue_R"); // ------------ const var Pan = Content.getComponent("Pan"); const var SimpleGain1 = Synth.getEffect("SimpleGain1"); //Decay Rate const var DECAY_RATE = 0.93; //Current Values var curLevelL = 0.0; var curLevelR = 0.0; var curLevelM = 0.0; //Timer Callback const var t = Engine.createTimerObject(); t.setTimerCallback(function() { //Synth Values var LevelL = SimpleGain1.getCurrentLevel(1); var LevelR = SimpleGain1.getCurrentLevel(0); //Peak Synth Values var peakLevelL = Math.max(LevelL, LevelL); var peakLevelR = Math.max(LevelR, LevelR); var peakLevelMax = Math.max(LevelL, LevelR); //Kick Left //----------------------------------------------------------------------------- if (peakLevelL > curLevelL) { curLevelL = peakLevelL; } else { curLevelL *= DECAY_RATE; } //Kick Right //----------------------------------------------------------------------------- if (peakLevelR > curLevelR) { curLevelR = peakLevelR; } else { curLevelR *= DECAY_RATE; } //Kick Max peak for mono out or label with max peak for strongest channel. //----------------------------------------------------------------------------- if (peakLevelMax > curLevelM) { curLevelM = peakLevelMax; } else { curLevelM *= DECAY_RATE; } //Decibel Conversion //----------------------------------------------------------------------------- LevelL = Engine.getDecibelsForGainFactor(curLevelL); LevelR = Engine.getDecibelsForGainFactor(curLevelR); var LevelMax = Engine.getDecibelsForGainFactor(curLevelM); //Set Values //---------------------------------------------------------------------------- LevelMeterL.setValue(LevelL); LevelMeterR.setValue(LevelR); Label_MeterValue.set("text", (LevelMax >= -99) ? Math.round(LevelMax) : -100); // use Math.round (round up) for all except minimum value, -100. Label_MeterValue_L.set("text", (LevelL >= -99) ? Math.round(LevelL) : -100); Label_MeterValue_R.set("text", (LevelR >= -99) ? Math.round(LevelR) : -100); }); t.startTimer(30);
UPDATE: this code does what itΒ΄s supposed to, but using labels to be updated by a timer seems to crash hise and the output plugins/standalone exported instruments. Read here about it.
-
@andioak Apparently there's a 3db compensation law but not sure...
float BalanceCalculator::getGainFactorForBalance(float balanceValue, bool calculateLeftChannel) { if (balanceValue == 0.0f) return 1.0f; const float balance = jlimit(-1.0f, 1.0f, balanceValue / 100.0f); float panValue = (float_Pi * (balance + 1.0f)) * 0.25f; return 1.41421356237309504880f * (calculateLeftChannel ? cosf(panValue) : sinf(panValue)); } void BalanceCalculator::processBuffer(AudioSampleBuffer &stereoBuffer, float *panValues, int startSample, int numSamples) { FloatVectorOperations::multiply(panValues + startSample, float_Pi * 0.5f, numSamples); stereoBuffer.applyGain(1.4142f); // +3dB for equal power... float *l = stereoBuffer.getWritePointer(0, startSample); float *r = stereoBuffer.getWritePointer(1, startSample); while (--numSamples >= 0) { *l++ *= cosf(*panValues) * 1.4142f; *r++ *= sinf(*panValues); panValues++; } }
-
@ustk thanks. whoah.. math is beyond my scope atm, but pan law I thought would remove the 3db. Not add it as suggested there. I got that wrong though, as pan law is the opposite.