How to reach -inf in the core.gain node?
-
Hi, sorry for the stupid question, I just started using HISE recently. I want to use a gain node but how can I make the range of the knob go from silence to 0 dB? When I try to set minimum knob value to "-inf" HISE crashes.
-
@southfieldsound -100 = silence.
-
@d-healey that's originally what I had assumed, but then I noticed that if you put a -100 gain node, followed by a +100 gain node, you end up still having signal. I assume this is because of 32 bit floating point. My concern is that the end user of the plugin in their DAW can end up raising the -100 dB signal as well since their DAW would be in 32 bit floating point also.
-
@southfieldsound said in How to reach -inf in the core.gain node?:
if you put a -100 gain node, followed by a +100 gain
It's just maths, -100 + 100 = 0.
However if the signal coming out of HISE is -100 it shouldn't matter what the user does in their DAW, they won't be able to increase the volume - at least that's what I think, I haven't tested it so give it a try and let us know.
If you just want to prevent any signal coming out I'm sure there is another node for that. @Matt_SF @aaronventure @ustk ?
-
@d-healey in a perfect world I would want to set gain to -inf, so that placing any increment of gain (such as +100, even +1000) will not let us hear any signal at all. I will test it, but based on floating point theory the user should indeed be able to hear the unwanted signal in the DAW if they turn it up.
If it's not possible to set the min value on a gain node to silence, is there another way to achieve this using scriptnode?
-
@d-healey David is right. If you set the gain to -100, HISE will clear the output
HiseSnippet 1850.3oc6YzzbaSDckcT9pEFZokxMzANjxTxX635z.GrymsdnNwSrIsbJrQZs8hk1Uiz5jXX3N2fq8V+IvUNQ9IvPOxENw47K.3s5CaIKWGGmPBvT6Y738su2p22u29TUGtNw0k6fTludWaBR4lp05xDsVuElxPk2.o71pUvtBhilOn05ZiccIFHEkzOVBPYtoPdeNs3ZXSLSmzGDBsGmpSdJ0hJ5CsZoOiZZtE1fTmZEA67kJqyYqyM4c.9IsZFjMVuMtIYarDsTpnmfcagT9H0LOr.gr7RMLLvKsjQgBEV4Qqjekr3FYxiOHagUxmK+x4dzxMPJSuoAUvcpIvBhKbnqwM5VqE+Hl+CXOpK8.ShbQVTM3I6CFsdKpoQ0PkiKBonVsupJsup5NpUnFzdv6qxdGuMz5SQTklRpQwRYOGrjRDVZJeV5Vp0zcn1h96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RG3PtnYe7ZziQz8Ki3wskMj4HZ5oN640HAFDXbtBHu1SXcVQjm9yWbFbd0J.aPsM6hRb5CmGOs3U.aoptpgwjEIFZ+OGo1CI4M41eSt8vOQMuQculS0TNKkjsdYzkgsn5tKFteR+r9zNBOsOP8q53JzZvczbwMHhtZGAs1SzfaCHamG5D7LaKS18rI43v6CuA00FtIyZcfaj42oVLHxpALCxwgM0uIbuDC3N2djG1neLuc0qBqV8VND2Vsfq+OIVsw1MmOlt44+geqneg9UEBrd6AYpxuFe7xktBXp4.ebnluK4RiqNsXRaXowiqd4q9yeMn32tRGyDEVJNgEVFVAYTojEVNs3quvBjkhZP76EaxRFD6dNy3mY9iylIC5xOPHBoZ0a7GexIuNEWzVg7ZcancFEbClg1XzPIXfF1hQXXmMn0371VXua9egmA28727FpOCeHwaJ3d2J+tdqgLhVZOl.8RKm7U1QLG7eYbmCt8XOG7czE.KT2Aybs4tjrwLnDKZcNi3FC5.TjanTjKt6mnCK9Q6CJFVRUwVfpHBdyVJDXtn.qhYwNLXcrSphbrPgK+8haxvGXRpQ.I2XGWcPwfGH.pZGSWxynFhVYiRXev4hB9IXGCvFpGajioiOcqoFuoaEe5qQveHCCb5qgWSvkyHbuFmxbrQnNWHOViJ6iXS3pmlPXrGOda0fbPgPiGGVgy3gSwquUeWhvg1rIId13gIPA0V6A4NkBKr0CzGV5ov8owNU75IahzEm+2pyPsWuePq.ZxjGZ+28sCj9+0ucfwO5CxG9uaq38Tg7x4z7LkZWO1xqhWpvUwyvBq6v2OXvUxf9Y8f.xMK3pZUjq0xhNbv92rfRF6qqG+nRPXtIkvklTByOoD9vIkvBSJgKOoD9nylPYE8fYeHiMf1bpto+UYU76vw+cA72TtkzBG
-
@aaronventure @d-healey @southfieldsound Well, I am not 100% certain about this...
In your snippet, it seems to work. But...
At 16bits, the dynamic is 96dB, so effectively setting to -100 clears out the last bit, so raising up to whatever million dB after that will be still 0, rien, nada, nichts, peau d'balle...
At 24bits, the dynamic is 146dB, so there're plenty of bits full of information below -100, we just can't hear it... So raise it again above +100, kaboom:
-100 ≠ NO SIGNAL
The solution to this is using aMath.clear
node, or aMath.mul
set to 0 -
@ustk hm interesting
alright then, we can just test the db control with a compare node and smooth over to clear
HiseSnippet 2299.3oc6Z0zaiiaFlxNzNwS1O6tc6gVTcnEHawz.qLdyLC5g374tFcbhQbZlcNkkQh1lMRhBRzIwsn26s1SEXts+D50dZmeBEcO1K8mP9Ezsj5KKJI6XqIIcyhj.DDQxWxW99979vW9QGWpN1yi5BTpczHGLPYYX2Q1rAaO.QrAs1An7tv1HOF1UMnnsF4f77vF.Ekxetn.kkV.3+yUarExDYqiGWD.bLknieAwhvFWZml+Vho4dHC7QDqDstQyV5T6solzgb8oLrNvAoeFpOdejnYkffu.4M.n7qf0+r0w3m9jdFFnm7Di0We8m+rm234Znd0afNUa8m2XsFOcsm8zd.kJ6ZPXT2tLDC6ATVXKpwntCnWXGL.GS7HmZhEenA5xG4fh2iZZHlhhRAaOfXZzIxP4A.JvNiMakCLaeDrMwfDW9Xy266Wg5XIRZ.UJIqdkkTOsjpW8DpWNpjRBUZg.U5Cfc0cINrw0HzmGAaYy8l8Pb+TRUIns.k2.2lxafMaUKzY38b4eDKvJqWu9iU4+4S+M8FZqyHTaUp89TF9.6U9zZ+wZKU6OUSMcU85kachgwkZZhcysZAzvcZBth8PqSwtOV8bj4PbbC4SeYaJbx1zjtb8fYchFRsaYSXG3fsmDP.DZp3+2uq0NHFR3HBKi2NGrKiHTAkcvmyCCBbKKA2A6cFi5vCDx3y3nEpwPSDSFBIBzBqfaCj7aBmisGgMJYf3MFtZVUwO.1gvzGjuNVJGcjaotMzwvnw2AtaudXc1XEbA3de4cWnWsvPO9XJF7kC+TcuuTK2ft+LbL.2wE6fbwGQ6XhFshGxxwDeHWGer5olT8y5R9C3rQENApvVhVrh9.jsM1zqHAOUlYqh1zcJGRGxH18aiXtjK4Qg6OzpKmWWGucn1wKSojHFJ365huE3htXaC+O9N9OgUpI9VIrRsn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there's still something.
No matter what you'll do, if you don't use a pure mathematical multiplication, the limit of the dB scale can't be guaranteed to kill the last bit
-
@ustk thank you, your suggestion of using the Math.mul node seems to work best for what I'm trying to achieve.
The dynamic range of 32 bit audio is 1528 dB. Perhaps setting the gain node to something -1600 (just to be safe) may work, but that seems a bit clunky for me. Weird things happening with the analyzer when I do it.
Would there be a way for me to create a UI slider on my plugin, where dragging it all the way down will make the audio silent, and dragging it up would increase the gain (just like a fader on a console or in a DAW)? Would I have to code something where, if the slider is in the lowest possible position, the Math.mul node becomes engaged? Or, maybe I should start using Math.mul nodes instead of Core.gain.
Thanks all for looking into this and for your help!
-
@southfieldsound you're right about 32 bit and the test I have made confirm there's still not zero bits after -1000dB, and even batman can't hear that...
But superman could! After all, each -3dB just divide by 2 the previous factor, so you never reach 0 until the last bit can computationally handle it...Now to be strict, the math node does the job of nulling to death, so yeah, if you need pure mathematical silence, use this instead.
Just pair it with a smoothed_parameter node to prevent clicks and you're against any upcoming super hero!