Gain Value Curve



  • How can I counteract the standard value curve of the gain knob.
    I am sending values (from a panel) to 2 simple gains - one for the wet and one for the dry signal.

    The idea is that as the panel-value increases, there is a smooth/linear crossfade between the 2 simple gains. But the dB curve is logarithmic I suppose and my values go linear.

    Probably ridiculously easy for you guys but new territory for me... Thx for your help! U



  • @UrsBollhalder

    Math.log10(someValue)



  • @Lindon said in Gain Value Curve:

    @UrsBollhalder

    Math.log10(someValue)

    Thanks Lindon... I was on the right track... but does the value have to be between 1 and 0?? Mine are ranging in between 100 and 0...



  • @UrsBollhalder so scale them...



  • Are you trying to crossfade two samplers/synths?



  • If you are trying to make a Dry / Wet knob, this will work.

    In this example, Engine.getDecibelsForGainFactor method is used by a knob with normalized percentage scale mode 😉

    HiseSnippet 1058.3oc6X81ZaaDF+jiutXu4RaYrsWJBLvARCxsccCFi3F+mhYyIh51zNXP3rz43ib5Nizoz5UJzOZ8k8s6Sv5Gg8p81smSmjkblRvyvJKPje0872e2ycO+zikanziFEICQV0d57YTj0mgGMWnl1YJgIPC5hrtIdHIRQCsMh1e9LRTD0GYYswi0BrpUEk77G6sOgSDdzbQHzQRlG8mXALUtT21+Hiy6S7oOkETv5GzdfmTzQxkw.d1.6flQ7NkbB8.h1rJXj0M54yTxvQJhhFA1ruze9noxWJL1eDKhMlS0KZgFAAxHF0YJi66lsWiPHqpt467ML67OGOj4yVHOuBbqDE14dTrFXUYYHUcIH05hfTeI2WGfK.dVEfWUC7tMdjWHalJWiFaeJdf.NblPfxdQXYrEU42pf6HAKDpcCHmR6GBKV3Qy663ri88bb196aTW+CJ+QJ6yHg1cCme7yopiGxdk8OXmEhSnpNxfYRArn4VErYKcDVx6CiUfiI2kzt0axDpmwGPy4LGBxEXtQyVY3iI3LA0dRrvSwjBaon.FzfLTxa5kgvcffyioa2n9qaTuFW5Q31u7HsHHU8Dm.gRmqtTO1XJOpuLTegtOwCNNaZbExaMCF1MhpdjRExFGqnMSkosemzXZvXsEYxeUyTqccruqcd9LknkyWpLS97Wju2jjyU3zQGsz5SGBmOF5qZVVwKqP2ndgZ7ARE8PQysq+550p+l51mW0jIkpKMjbZXop089gWliMEwAiogYmhYFBMDK2wciUqiyyTkJXnTLPvTGNiltNumrUI8jnzxrt6LEgfopjdyal1aNhy7ogHFDjF3BUWTxVHioa6e422C8rAcIJRVvf3B4ZFMTwzaIqtzy.dSSieMbWZzoJ4rDaSOeQVexJl5Wsff8sOq87EKd2SZGH8g.7E3CjgADN6Wo9tzPOH3.kKJJdxDvanX70n.luOm5JiX5SnbB6OrG5exSArkR+XNQsLEp9papBcLJxUo4iDPrmW7cI+K3UcJkWszyvUDt2F6xTdSKGuUJAuv43+03M8sTMvFtwbvVE2+EeDdkTkBXYyEyJvBlwoONCJahMDUWzTBu8O8+x20kxIKU5dNyWMMWvO2tj4HFHNCZNbkbR34K7abYyDzZMmI3xucn2R1WYtMeGbRI+pDfStRb0Av2B6R9+vEhmHiULwICIvbC.2M9f3fQvvzdT.pBAL4AHyph9cYl0N50Z.MhJ7SV7WvSpxV50VoJakoDsRz.l4itHZfO792+UWSCbMMv0z.WcoA9Xji.hWn7XOyv15VyMSj.6aQxWDnFdndscqr4qwXmccziqxN1ySOYzcg5S49bu0vm6uF97f0vmuYM74gqgOe6Z3y2co9n+PIOJVICL2+AAt8R9eNVV8DD3lbRq.5uAXDfO3J
    


  • @d-healey said in Gain Value Curve:

    Are you trying to crossfade two samplers/synths?

    No... I am routing the signal to a bus (3-4) and depending on the value, the signal should go 100% through the convolution or 0% convo and just dry... So I set up the chain in the fxsection and have 2 simple gains controlling the wet/dry. One is channel 1/2 (dry) and the other 3/4 is for the convolution.

    simple gain1 --- dry -- channels 1-2
    simple gain2 --- wet -- channels 3/4

    So when the value (panel data value, event.dragY) linearly goes from 0 to 100, the volume crossfade between simple gain1 and 2 should do the same...



  • @UrsBollhalder Then you should go the @orange way. Engine.getDecibelsForGainFactor is what you need. But a linear gain factor is a 0-1 value, not 0-100...

    so one is doing => Engine.getDecibelsForGainFactor(value)
    and the other => Engine.getDecibelsForGainFactor(1 - value)



  • @ustk said in Gain Value Curve:

    @UrsBollhalder Then you should go the @orange way. Engine.getDecibelsForGainFactor is what you need. But a linear gain factor is a 0-1 value, not 0-100...

    so one is doing => Engine.getDecibelsForGainFactor(value)
    and the other => Engine.getDecibelsForGainFactor(1 - value)

    Thanks a lot for the help guys. Appreciate it!!

    It's getting a bit messy here with different kinds of values that should then go into fx modulation and stuff. But I think it's more or less working now! The fades are still a bit uneven... Thanks guys...



  • @UrsBollhalder It is not a panel but it's the same thing since the slider uses a 0-1 linear value:

    HiseSnippet 1433.3oc6Y8tbSaDD+TbDEaZX.FnkOpIS+fyLPFKWf1Y5zIFriodfP7DEf1OQuHcN4HR2od5TZLL7s97zWg1Gg9Hz9FvaP6dmjsNAhfqKsPRSxDFt8e2t6s6d+tQCEbeRRBWfrpu83XBx5is8Fyj60cOLkgFzCYcd6MvIRhvIizcFGiSRHAHKqZ2UQvp9hH8Oubs6fCwLeRAID5QbpO49zHprf5vN2iFF1GGP1lFYH8M5Lvmy5xC4of+TytEJF6uOdWxCvJwVvFYcl0CnRtvShkjDj0h2gGL1aO9Oxxj+QzD5NgD0BWjGXnLx84gAJOV8+Qc2iFFLbRbmf.iNrHKTKKKbY6MnAzozKxFWPyvoPCy7g0BGk64Nmtmkg6sXl6cQaOeAMVVvQ4amyd.CNnFggi.S2JSVzBOcA6tbPBlb0H79j9BXwTMZdqVstlyMa0ZkuZoFK0.NHRjNGfENdzn3Ph5n104qczEGqtKQt9nQDeYykyX6n4urR2pzr8aQy1KmsqpeorPJi3LJk4KoblCmcOFeGWkmK3gM84QwbFDCWC1ivTxJK034K0ntgWtZBQdaoTP2IURZZxP8uWyYc1tvFn7jdDe5Njvj9bghUerOb30LyrJGxvpseSVs8LZUWmq6TX4W.+M4r.To6jfp4x5fc4UTaWdH2EGFtCzHzrblPYFijzC3Rxlrlqz34Mp23EMbdUViFUIubiERDUxV0fJNJEaxRi1gHlbXLQPnRsbqv4lsVA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dC0ZmoeCIa6Vq1R8ManOw2WcC20cQnp0o8bnymOG5bi4PmaNG5bq4PmuXNz4KORcT3+ucpjGkU+CDFtt9a4YYk8dHcq.5unECbKA
    


  • @UrsBollhalder And this example is the same thing except it uses twice the same sine generator, so you can hear the fade is even as it should be...

    HiseSnippet 1229.3oc6Y01aaSDG+bRLrjRq1PCTeoUEuHUpqJIrMPBgZZyCnns1F0z0AuZbw9Rxsd9Ny4yEhl12M9HvGA9HruAv+y1I1Y0qMXFvZIIJU89+vc+t+O6j9RgMw2WHQFkOcpGAY7IlClxUSZMAS4ndsQFaXdH1WQjVQjNXpG12m3fLLJ9cZBFkKgBe8l8N.yvbaRBID5LA0l7TpKUkPseymPYrtXGxoT2TR+vl8rE7VBlH.vSQyZHOr843wjivZwJXhL9nNNTkPNPgUDejQoCDNSGLQ7y7H4Oi5SGxH5E0QCfMJhbWAyQiX8+iZMgxb5O6d6ifMsehUnXjU39lGRcnyomXMtaHCqDMRaOLJbUvqdNgmQJ3UJBd2ybfsj5oR3nw1Zl83fiZDFbAogUjrnBurfYKAHAWsqK9bRWIrXtFUebsZ6X8nZ019aVux5U.Ggux5BrzZ.00iQzt55VeqUXvwtiIpNiFQrUU2JhsUH+sz5lklMtFMarUzopeS4LJmXMJfaqnBtkf+DtXXcMxkBVUagqmfC2gcfyfEP1d8JuZ8JkSgxc8Ip8UJIcXfhTMMC8e2wpCeLb.ZjzlXSGRX9cERMqtXav4UMZa0.J0t13csqMVxcst0CrR14WCel4K.UZM6RUcqvK6VaqOt3qbKLiMDRDptnkPuMoLRGITji4U2txqpTtxqqX81rFMJSdwaFiHyjsNAUdUJVkG3NjHm4LlIHDotXpvZKWpfcjMIkfBdONUcrGIdcRxhlWzsdF2Zn4W1zjRtiooFd0xPrDRWNWDE6yzYkwhChpByI2HNmb.i5PjHJfwO1LzggBsMI04988POqWarBOaafcDNEOhTQ01Ji1jKfplQo5kMaS7OWI7BkMNLAYXdsG5uL+.+QVyoyWX8xlNjQ3.l5rKgpKWnAJ2IbBXX0h0.0w0wLfngEJ1nKnv8opooaL7WnvXsLKLVOKmwRB26Y1mprmjMdKjAdA2x+z3MtMy5lQECS.aIyteed6ojOnrQDTVyb.T+JrHcHP97v0VOGeAThlvIRsQs9Uz9+2V11+dKc6+isUvwepDy88D9KrwCHtzSgbA+zDelOzTi7Smn8xoo2RfkYx5M60EtjYpy.rJPFFtruqHfqVH7nXt5yuXVSJ4ynoeo+ClI48ep2e+JEEWN3dMiMUdFFi5a2geAgA0aCw3mBEXCqGNi5hA4GJ3BuIBN0NcDvIDXRfwiIxzXOyKDLy.z6Ngx8adBgQvoil+hlOEhBwRvNQxosn9xaKtJ+0llQv0RmYZc6nBewaQU3y4SMbm4OZ27wVieztzSu+tps2byOayesMggWv.9bpCzoXNgenYFU+6AYTRUeACKeayew2Wg1kV5XD8U5lSLstrDXxuIA3vPhaN.9tl8weHDPbhHPQ4iODCsTfg1MOJvc.LBjMAfJmCOHIPynfdLln00zqilAh6Dt3OfWwLqqWaDyr9Ll+qbF4blxFqlob0Lk21morwpYJWMS4++lorwpYJWMS4pYJWMS4GxmgK1VJdgczWmuN8+NgT.aKO72crr4g50Vy+d7MMqsaMjKLezKrs0Eee.3CxVmF4PmuLG57vbnyixgNONG57U4Pmu9J0QOZ59AJgaTNFPnemveOECiNbLjsDltg9SD46AwB
    


  • @ustk said in Gain Value Curve:

    @UrsBollhalder It is not a panel but it's the same thing since the slider uses a 0-1 linear value:

    Yeah... That's how I set it up now... right?
    Still, it sounds a bit jumpy... But the convolution fx is a tough one to control level-wise... So maybe it's also there that I need to solve that problem.

    inline function onPanel1Control(component, value)
    {
    	WetGain0.setAttribute(WetGain0.Gain, Engine.getDecibelsForGainFactor(param3/100));
            DryGain0.setAttribute(DryGain0.Gain, Engine.getDecibelsForGainFactor(1-(param3/100)));
    }
    
    Content.getComponent("Panel1").setControlCallback(onPanel1Control);
    
    
    


  • @UrsBollhalder That's exactly it. Effectively you have to manage the gain for each convolution file since the difference in level certainly comes from it...


Log in to reply
 

10
Online

1.3k
Users

4.3k
Topics

38.6k
Posts