getTableValue and samplers crossfade issue
-
@problema can you not simply scale your output as required?
Console.print("value: " + ((value * 100)-100));
you get your table value out of
local gainValue1 = CrossfadeTable1.getTableValue((value));
so your call back
local gainValue1 = CrossfadeTable1.getTableValue((value)); Console.print("Gain value:" + gainValue1); Console.print("value: " + ((gainValue1 * 100)-100)); SimpleGain1.setAttribute(SimpleGain1.Gain, ((gainValue1 * 100)-100) );
-
@Lindon thank you for your answer, but i couldn't make it work.
local gainValue1 = CrossfadeTable1.getTableValue((value));
The issue here is gainValue1 has only 0 and 1 values, so the result would be 0 or - 100, or am i missing something?
SimpleGain1.setAttribute(SimpleGain1.Gain, ((gainValue1 * 100)-100) );
Here is a pic of my result with code from starting snipet
-
There's a function for this something like Engine.getDecibelsForGainFactor
-
@d-healey thanks for answer.
I already use Engine.getDecibelsForGainFactor
inline function onknbMixControl(component, value) { local gainValue1 = CrossfadeTable1.getTableValue((value)); local gainValue2 = CrossfadeTable2.getTableValue(value * 127.0); local dbValue1 = Engine.getDecibelsForGainFactor(gainValue1); local dbValue2 = Engine.getDecibelsForGainFactor(gainValue2); SimpleGain1.setAttribute(0, dbValue1); SimpleGain2.setAttribute(0, dbValue2);
Because gainValue has only 0 or 1 value, dbValue is 0 or -100, but i need smooth gain changing.
Why gainValue has only 2 values and how can i change that?
-
@problema What is the end goal? I might have some suggestions.
-
@d-healey the end goal is a crossfade slider between few samplers with ability to control the behavior of gain value changes with tables.
-
@problema But why do you want to crossfade between samplers? Is it for crossfading dynamics? Is there a reason you can't use a single sampler and crossfade the groups?
By the way I made a video years ago about crossfading dynamic layers using a few techniques that might be of interest to you.
-
@problema why multiply the table values by 127 ? The values goes from 0 to 1 (displayed as 0% to 100%), so just remove that and it works just as expected :
HiseSnippet 1817.3oc6YszaaaDDlzRL0VMMnIHG5ghBB0dPA00Qhwwonuhr0iTm3GBhttomDVStVZgWwkfbkcTaCJP+kzeB8ePyef9KnWZu1S4RQO1N6tTRKUjcjUd5.qCBblcmc+1YlcdP1Hh4gi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IzwU4StiqtPkR98m9dtdYni6h7hXs7TepbglddIGPGGHORKXsof1d3WZ2xp3REM5B0K2xySjv9Sf6vSVFmYPlaLCxr7LHyMmAYVYFj4VyfLe5IJinUkU6wYcUwnAFMpotVXVa30hLF+O.CjqWN
-
@Matt_SF said in getTableValue and samplers crossfade issue:
@problema why multiply the table values by 127 ? The values goes from 0 to 1 (displayed as 0% to 100%), so just remove that and it works just as expected :
HiseSnippet 1817.3oc6YszaaaDDlzRL0VMMnIHG5ghBB0dPA00Qhwwonuhr0iTm3GBhttomDVStVZgWwkfbkcTaCJP+kzeB8ePyef9KnWZu1S4RQO1N6tTRKUjcjUd5.qCBblcmc+1YlcdP1Hh4giiYQFlKrS+Prg4Esb6Gv6ToChDXrdUCy21ZSxCvQMhvwFq0ODEGi8MLMybGwDLWHqg72iu8ZHJJvCOhkgwtLhGdCRWBeD2FkuGgRqi7w6P5pM6kKutGKnBix5AfIiUQiPj2An13sPhoMmkg4Ep4S3rHWNhCXwL6ZL+9tcXGEnl+tjXxdTrfnjgKrPJ10YTeAhEbMpzgP8aL3PGa.KZiQpfLJUvUgSrOYH+Qph2UNf8HIz0GlykFdYRAuR5vqnF7l.jL0fTVEjtrkqWDIjOZDkoY8.NNZeDn10ghZtFy8GYspvfYDvWpK5.b8HfXnDEVoXwEsg+t1mmK20u9lqe+ZMyYC1fXt8gnHaWR2PJVXkKY+k1RmhkZi401eerGuPd0v1xwyCKwDkz4oHoiPRcQOHXOvaCjZ.tA4pv5FxB.hB4UCmWgXa.x1UZtsqa8UqVyM2nUoRDKNdegKFBz3kzVNjuujWg7iMm7KZeyEscDJiAyMFKT2g3HNAGC5tt20c6sljf+PNa67GQ74cx+Y1NqTbQAcGLocGNvnzM.FOT.4iCfNSA.cf8wYkYBhNmBHRBnj.r898B73DVfMKPoxEaXDiVvafsXQ3bP6guVNXkoLOD0tMXO2UvSpuSqjDlQ4SxITnPokJZ+IIqfv2YrUv4IVAmwVAknBeGkn96MbqqEzFNBh4WE6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AvsIqGGpCaPsPVPAStPQhdX8xllSTJlhtnfV.HWbfuj3+feICVZPMVhAKMXvoUkbojRgsgSXD+0b62EsjEuYKp09MYam2fkBNaIOKeg.lYvAhhGk8xQgJuo5QXig1HDPR7FDhkF0tPcnvTUDPRglLQk9VleAL6MX2C2e.wWSzH1fsqXgUn9qIID+j3rqZuX.nqSnIeUfux5GZzb66VqxNspu8FUq07gtUasSslMWcqs2c0VPEO9snLVXq1TTba1QsJtbqRNK2p9GtzQnCMp1KjR7.qjvVNCsw4bdabm2F2XswcgWPswcl3SW8FcGZNm2g1ydGZuZeQjYdi9EQd56D6XSf8K+3+7u+14chcdmXm2I14ch8JNh9yV2WyN7NuiqIzwU4StiqtPkR98m9dtdYni6h7hXs7TepbglddIGPGGHORKXsof1d3WZ2xp3REM5B0K2xySjv9Sf6vSVFmYPlaLCxr7LHyMmAYVYFj4VyfLe5IJinUkU6wYcUwnAFMpotVXVa30hLF+O.CjqWN
...exactly.
-
@d-healey wow! It works and it's so simple and don't needs any scripting.
Thank you very much!