getTableValue and samplers crossfade issue
-
Hello!
I want to make a crossfade knob for controlling few samplers gain using tables but there is some issue with getTableValue. It only send values 0 and 1, so sampler gains have only -100 dB or 0 dB gain values.I find that in older version of Hise this code works as it should be, but in newest it works with this bug. Hope it's my code bug)
How can i solve it?HiseSnippet 1688.3oc6Z80aSbDD+bruzDW.AHdnuToUV8ASaHXe.gJPU3DGGTZIIV9fT5SnM2s1dUNu6o8VGHshW5mn9QfOJ889BeCZmcuy9Ve3j33XRIQIOf7L6Ny9amY14O1zTv8HQQbgUtEe4ggDqbWy18Plra8tXJyZy0sx801aQeGQzTPhrV6vPbTDw2JWt7OWsgbKVvR+2Ge1Z3.LyijxxxZWN0i7BZOpLkayZ+BMHXCrO4kzdF69g01ziypyC38Avj2thUH1aebGx1X01ly1J27M7oRtvUhk.VxUXMt+gtc4ukEu+coQz8BHJhpVtfhhYuAOvWgXEWq5coA9MGboir.k1L0DjO1DbG3F6SGxO0TbS8BnTILsG4laT3keD3U0DdULf2XfTNCHUHFR2x10SPCkoqD6Z1jIIh1XvraBk38ZM2+TvtNG1AStbO79jMD.wPIJuRkJKgf+4tOsXw6e+s170MZUDA9fHI5.r.4R6EFPTd4pneBoCJVtCQ1ncahmrbo3kQ50KApXrR5bBR5njzTz8Y6AQafTCvMHWcduPNCHJWJd4RwHFAPFUu0Nttar55MbKlpk5BdTTaUHFFr3UMTG12WyqboL6ozRnGsDxQYLFr2HhxbGRDRJIBrc89Y2c1dbB9GEQnRuk5K6V5IHmUprjhtKg1oqDXT8A.i2qf7QAPmI.fNv43rxTAQmSADor.JifZ2m4IobFhyhM4pCTvCJ6MvWrDbOB5StaQPyAbOb.pC3O2UwSauG0Hobi5Oo2P4xUWtB5dIZ.88npNOdY00Jqlb9DM4jQSZUXngApveugPoAqCbkTxsNwitGIHZCtPE7sA1CdtVNE2oHHQbmSi3N5i23Uix6rpTJn60WRJCu0F.J04X7F4n1WrBAKeDOfrbnfpdAnuvOAUB8CIlum9IaoytUi2f4MCU78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znpmvnQWH9IktTO0iyUS8b1m54ydn0LXRmYBF+rLcSkY7zMNWMcy+2wqyhIZNG.4YeJlyghJm0IWldHdIZZkO69oy1DJeY6iN6SkbdfxdXOA+Mdw+HtJrtflCfRl9+DTKZukhFM72.11txxUr5AcP9FOOUIr6AMjNdYblBYdvTHyCmBYdzTHyJSgLOdJj4GOVYTMuuZeIuWblMfQyFwAV4ZLLvJu0+cMoNdN
-
@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+1YlcdP1Hh4giiYQFlKrS+Prg4Esb6Gv6ToChDXrdUCy21ZSxCvQMhvwFq0ODEGi8MLMybGwDLWHqg72iu8ZHJJvCOhkgwtLhGdCRWBeD2FkuGgRqi7w6P5pM6kKutGKnBix5AfIiUQiPj2An13sPhoMmkg4Ep4S3rHWNhCXwL6ZL+9tcXGEnl+tjXxdTrfnjgKrPJ10YTeAhEbMpzgP8aL3PGa.KZiQpfLJUvUgSrOYH+Qph2UNf8HIz0GlykFdYRAuR5vqnF7l.jL0fTVEjtrkqWDIjOZDkoY8.NNZeDn10ghZtFy8GYspvfYDvWpK5.b8HfXnDEVoXwEsg+t1mmK20u9lqe+ZMyYC1fXt8gnHaWR2PJVXkKY+k1RmhkZi401eerGuPd0v1xwyCKwDkz4oHoiPRcQOHXOvaCjZ.tA4pv5FxB.hB4UCmWgXa.x1UZtsqa8UqVyM2nUoRDKNdegKFBz3kzVNjuujWg7iMm7KZeyEscDJiAyMFKT2g3HNAGC5tt20c6sljf+PNa67GQ74cx+Y1NqTbQAcGLocGNvnzM.FOT.4iCfNSA.cf8wYkYBhNmBHRBnj.r898B73DVfMKPoxEaXDiVvafsXQ3bP6guVNXkoLOD0tMXO2UvSpuSqjDlQ4SxITnPokJZ+IIqfv2YrUv4IVAmwVAknBeGkn96MbqqEzFNBh4WE6Q1CSiqyhDNa0Qdv0yBiv4ncNQbmSi3NxsW6VhvZrJmGQ1qGGW.taM.Th8Q6NwwMO0BBZ5XFEuTXDQ3wKOnelcd6O1dvYd7ozd2RpInexry8vQtIS9Rj.GI10JHJcOHbagwr2W6y07D1hwwaGTPXxWH2CyYO9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WSzH1fsqXgUn9qIID+j3rqZuX.nqSnIeUfux5GZzb66VqxNspu8FUq07gtUasSslMWcqs2c0VPEO9snLVXq1TTba1QsJtbqRNK2p9GtzQnCMp1KjR7.qjvVNCsw4bdabm2F2XswcgWPswcl3SW8FcGZNm2g1ydGZuZeQjYdi9EQd56D6XSf8K+3+7u+14chcdmXm2I14ch8JNh9yV2WyN7NuiqIzwU4StiqtPkR98m9dtdYni6h7hXs7TepbglddIGPGGHORKXsof1d3WZ2xp3REM5B0K2xySjv9Sf6vSVFmYPlaLCxr7LHyMmAYVYFj4VyfLe5IJinUkU6wYcUwnAFMpotVXVa30hLF+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.x1UZtsqa8UqVyM2nUoRDKNdegKFBz3kzVNjuujWg7i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.IP2G0ixGvMcHgMYArvNr.hWZmdvItcabjN1m3ABpuDtyMhyUK2DSwnXsaseT4MfBcQQouKepzEkN08wNQ606YofqsHNl8yhc6kpa1IlxKyTkx64NdeEj9KkYd9guDog86H29KYo+9BN1reevue8GUESQoTZeaRgTIL9txSH+35vsnHdCFEEMtJOyyK24rSseg3Hc1wOVDJBT4mk.rzk3rCfeWKHk8qAvsIqGGpCaPsPVPAStPQhdX8xllSTJlhtnfV.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!