dB meter
-
const timer = Engine.createTimerObject(); const var Input = Synth.getEffect("Input"); const var Label1 = Content.getComponent("Label1"); timer.setTimerCallback(function() { Label1.set("text", Math.round(Engine.getDecibelsForGainFactor(Input.getCurrentLevel(1))) + "dB"); }); timer.startTimer(100);
Hi) I have the code and this indicator. How can I make it disappear over time?
-
@udalilprofile I wouldn't use a timer and label for this. Use the built in peak meter floating tile and look and feel.
-
@d-healey Peak meter floating doesn't work for me. I can't start it. No reactions.
-
HiseSnippet 1290.3oc2Ws0aaTDEdVmrUXWnPQUHdbzJdvELQ1k1BhJTct4JKhasx5zVopppI6d7lAu6LKyNNIlpHwOQ9oz+AkyL653carBoV.Ufevxmay7ctNGOTICfrLoh3TezrTf37wt9yD5i19HFWP5uCw4FtCXYZPQyYs0rTVVFDRbbV6QFFN0WmX+7lGtEKlIBfErHjmJ4Avd7DtdA2gc+YdbbOVHLhmTR661sefTrsLVNEwyZtsIorfIrH3wLiZ0bINWa2PtVp70LMjg5rkLbl+QxSD45+TdF+vXvPzg3iGTNax1GwiCGN2WyHDG2gK770x87a4NfGxOm+hHvmYEPWXQ4XfSsKCRcdOfjSIHsdNjtoqefhmpWHwfmq61WfIjwLLTWFJ45RpMpl61RTCgdiD1DnmBIN2hl2uc6VT7qa+fFMvvcllFyFS+I5bSBT.5I6ICXw6IkS1TD1Cf3lF0QE2PAQbS4Puoh.MWJZ5EpXmLfoU7SGBrIC.TnWK534xiZQkG9K2twqaT+XlhxvqBo2fgWyCZTuQ8nMx.cdRuoQfFNsfzbkVaB2BMZWQDW.aDA5cf.9gPbVOoxTA1iEfweqsoH.xdQ6WhVhmqAXaFyiDP3H7PaVbBgxoXBYjzGgrHpY3VsnctM8andgag3l0h5EfwAED5gGyYFPTDmLPoWrjoQyFwigNkhZQFeHIUJPhldUzxbLUXXb3KDewXq4plG1nRwikZ3Ihl1HWiyZPeWQiGuTYFDojwwfZohMsbpKyvlhoIGBpVn6FOENWQrlrZg90tZE5A4AnRJJE8Eb8SRgB5dx3PSAr42WrsfTDgwecP+cXZloSofGpWJnzbCbb1ANFG0j22T2cGHahVlZ0sHsfMN5hF87NkxIEBGQvm5VIOQN87YS+93tyVLnh2s..y6RemxexgQymhU+ZymDx0PxBtGbvAusJ26XX644YYaczZesi6qaPodmGO5G58iTOerJl9L1w.8Qf.TLLozwqkQw9hP3TTkusikDirwxSdlTMICmjBnfwr3LvJyGhRPOXOHzm+aFQs2nsUvAoX+EaloNA4du1y4uCl.WtjCx.ezAB.bjoPfMlUunIvI4snH6NElLjEFhg4hqdNWSQx.lMNVhawoZ8Mvb1u.4RoVgTZG76W13LxhwF4A82Zii8v7j4RVj652kbw4r3DdY3zXSjr7XeyzkBAXKRkYsl4ohLtdV42+dOdKn8k9VvUEh2zcHWGbzxwXskfQr44eBLV7B5m3t63wPfdA.W2s2yW0mKu5W+Mxu9q6Z5LrquXu7uvcYcJWxFL+wUcClzq7FLOIPiW+HESjkJypbv9PBeDNYJqLSrWpmB908MYyx72VxTKUzadXOzIWpM9L8TksrXyD4TgtRYvZUyCqe0llWsinj9KYel0+.rh0eOsUe.67qrEX84XzmmjFC6JNFhwW7rX7ywm3FylFqmysZg8.oPldjTvCJm02Gv2ohh.UYruTGZSsF28dAma0ceHFXkqf+pt6gUdLEFmfULV79uQ7RyWeoaNboltQ5+cmXu1+umXuubpY2p7kkv+B1imlTcuAjmSMyvtb51F57IkhPKwawOEB6XncJD1Ytv+UtiDVfR9pf70kM0oejkC52B6eTsNtOHRS6PrqPWNWlfS4dUPP0i5BFdmU0vuaUM7tqpg2aUM79qpge+pZ3O7Wan4QnMmpkI4slDxfg6ZWE2wYWACqxscDj+jEO069
-
@d-healey super! Thank you! How can I make the indicator invisible? when sound arrives, a meter appears; when there is no sound, the numbers disappear. The number -100 is always displayed. But I’m trying to figure out how to make it appear when there is sound.
-
@udalilprofile You could change the text colour alpha value in the laf function based on the peak value. Or you could use an if statement that checks the peak value and only if it's above -100 draw the text.
-
@d-healey Can you help with this? Please.)
-
@udalilprofile Do you know what an if statement is?
-
if (dB > -100) g.drawAlignedText(Engine.doubleToString(dB, 1) + "dB", a, "centred");
-
@d-healey I'm just learning. )
-
@udalilprofile Cool, start here - https://docs.hise.dev/scripting/scripting-in-hise/javascript.html
-
@d-healey Thank you. I'm only 11 years old. I want to create music software.
-
@udalilprofile I think you must be the youngest member here :) you should pick it up pretty quickly I think.
-
@d-healey I'm trying. Thanks for your help
-
@d-healey Can I ask you again? I already used const laf = Content.createLocalLookAndFeel(); to configure combobox. Can I use two functions? Or how is this problem solved?
-
@udalilprofile You give each variable a different name. Something like
const comboBoxLaf
,const peakMeterLaf
-
@d-healey I couldn't get a numeric indicator. I now have a vertical indicator.
-
@udalilprofile Post a snippet
-
This post is deleted! -
This post is deleted!