Unsolved Gain Right After Sampler?
-
What's the easiest (and most processor-efficient) way to have a constant gain between the Sampler and the first Sampler FX? I have polyphonic ScriptFX.
-
A Simple Gain would do the trick, but that cannot be inserted before ScriptFX.
-
A simple (non-polyphonic) ScriptFX would do the trick, but that has to come after polyphonic ScriptFX.
-
The first Sample FX could be a polyphonic ScriptFX network with just a gain module, but that's a waste of processor, and not really what I want.
Any ideas?
Thank you.
-
-
@clevername27 said in Gain Right After Sampler?:
A Simple Gain would do the trick, but that cannot be inserted before ScriptFX.
why not?
@clevername27 said in Gain Right After Sampler?:
The first Sample FX could be a polyphonic ScriptFX network with just a gain module, but that's a waste of processor, and not really what I want.
it's just a few multiplications per voice.
The simplest and cheapest would be to add a script envelope and write a simple return expression in its on voice start function, but that'll be applied only on note start, i.e. you won't be able to change the gain while a note is playing.
-
@clevername27 said in Gain Right After Sampler?:
A Simple Gain would do the trick, but that cannot be inserted before ScriptFX.
why not?
I guess that's a question for @Christoph-Hart?
The simplest and cheapest would be to add a script envelope and write a simple return expression in its on voice start function, but that'll be applied only on note start, i.e. you won't be able to change the gain while a note is playing.
Thank you for the suggestion, I wouldn't thought of that. Is there an even simpler way— whereby every sample is multiplied by the same constant (i.e., the whole buffer/block at a time)?
-
@clevername27 said in Gain Right After Sampler?:
I guess that's a question for @Christoph-Hart?
ah I see what you mean, the polyphonic FX is always ahead in the chain. Good question.
@clevername27 said in Gain Right After Sampler?:
Thank you for the suggestion, I wouldn't thought of that. Is there an even simpler way— whereby every sample is multiplied by the same constant (i.e., the whole buffer/block at a time)?
here's an example of an add-on script envelope that lets you put in dB and control the output of each voice before it gets to the fx section.
HiseSnippet 1393.3oc4W0saaTDEdV6LIMtETKPDEItXu.jRkphhMkPkPh37masnNwJaZJbUzjcGaOJ6Nypcm0oFDR7Z.OEbKWfTdAPhGAdD3E.AmYlcs2M1xwwjRPBGoncNmyLy47c9cZGIbowwhHj0xGMHjhrtG1Y.W1amdDFG0bWj0aiaQhkzHaCosGDRhiodHKqxO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eE72lDAGCLwpZXqRVkyM7kI0QsBb+kTp18vMiOVw0k3iNV4fUaReK5pNFibQyfyfs0GjEBnJXzuq1ngHk0FIv3VU9sOEiXCrCUZK6Qs8N0lDaB5pT4PV2dRaWeFjMKE1.1x6R0hEo9BcEl4hXc0nTCbYr2o0zSYfFUT3HRTWpLNcpUN00DHoQflfcfwDOOzPvUQZIr4.Q4fb0cmsBjnEimcooYae8EsHu9RzdXcGIMzg8MZZ+3On98ya5bF8bCPqn9Et+xu18mVotxbxt3gGye9Wpee7EakHEAP5nF2Q4bdFsufaqBFjr2ZJ5i6sLxO8fMcOogX90BD.feLP.JCkCDxjqHHLrJ1j.gg8nxABkJnVnsEhyBH5BLuQekxTeBP4+27DfoOLELdq8+oeH26igwrqYqck12N9xCEIRFuaKBzJGdL.d+j.GHczMqIVbV+qz0qmkn5.cvzKTEFRYVUs1JkY0Ll+qbGAD2HwIo8ITEHtilBX2bc8lkwsTqsqh5e4JEAvK.Nw0s3QM1FqMua7Sl2M9j4cie57twMl2M9Yy6Fe5UuQ0CzRq3pxMfJ6s2SWX0xx7fUSun+Fcrmu.A
This is essentially what the simple gain does. Convert the dB value to float gain multiplier and apply smoothing. This has no smoothing so you'll get zipper noises if you try to automate it while a note is playing, but this should have the least amount of overhead.
This is pretty much what you're asking, it executes once per buffer (as long as you don't put any fix block nodes on it because they're unnecessary), once per voice.
Even cheaper would be to just do this in a script fx after the polyphonic fx: this setup that I posted is only necessary if you need to be setting gain per note, which you would do with the event_data node, but that's currently bugged as it cannot transmit a 0.
If you don't need per voice gain control in a network (which you can more simply do by calling Synth.setVoiceGainValue() ), just put the simple gain after the polyphonic fx. It's just a multiplier, it makes no difference whether it's in front or before the polyphonic fx, unless you're doing some non-linear processing in the polyfx node (but then you should be putting gain controls in there, so I assume you're not).
-
@aaronventure Thanks you - perfect!