How to bypass a mod container when a parameter value is zero?
-
Hi,
Big scriptnode newb here.
I'm trying to piece together a reverb with pitch mod.
How do I bypass the mod container when the modDepth parameter value is zero?
I'm trying to save every possible bit of cpu processing power. It would be great to have the modulation container "turned off" when it's not being used.
I could easily write this in hise script, but I don't know how to do it for a script FX.
I put the basic idea in this snippet to get you started.
HiseSnippet 1728.3oc2Y8zaaTDEeVauNM+oUsPKTtYg3PpTIJ1TJUhCwIwwsQzjXEGR6sxjcGGO3cmYY2wIwf3DW3FG3TQbfuFHwAthTqDR7E.9.fTOwU3M6r16rd2jX6ljJpiTjm26My7682Ylma3ysHAAbejwz6zyifLlyrYOln8pswTFZ8ZHCSSWtMZkdd3f.hMxvH+8krLlt.J7yKVZErClYQhIgP6xoVjGRcohXpMp9ITGm5XaxNTWMouS00s3rU4N7t.LxatHxCa0AuOYSrTrblHihqYSEb+lBrfDfLJrB2tWy17CYJ42kFP2ygHGTF0DVHE45bGaIhkeGsZapici9pa.BTrFwJedkxecyMn1zAziMBWMjQo3YnaOLxkDd4S.uxGG7x.RFZPpfBRWyrokO0SDyQhmYMWmIH9svfYWGJJYQF+p4pbP.lXAWbGRceXvfIL+cWbwaWB92s93VcYVBJmUhy1jKHawl+Vy7UyL8Le8LkFlUqVYxStM9bGGhelrkdZ+SZhyy55tGw+1kN.6zkLPPP8SZSKNZ1TKkVqIHmsNiJ1xiDMNNnnbFd.TjYC91mtdMr.KcJQz.47H9BpDNF0HG.Q3JWzzl0HAcDbOHFOk+Chb31ccvhjgSxbnHFf8HgOT5nXATQO8brgiwJb71iEyLEHSscDg60LaPEVsyFu4x.ufU67FuQYrW1bsVsHVhXvVvr9iOwzyBiVnzoT8HiT0YhRUg8WBj4hFVp9iKmYR52ZFmP34S7v9jc3Mbv8lO.654P1Fv6sKsmC2pSS5WRRmE4ofvJRIl2pMlwHNASRxVwynBXns4cET19afE9zifRra10sITV2hrZD5.ZF4j4YpwKJGKiWZRX1gC9W3SDyxxwFQLK2moVJ5lDwgb+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zhNZz0IfDltWVehwjqnS9AXeavuXknQU4mntCkr+cZxmQqhJdd0n4Kzl.9x2yx7iFbOklsMceL1jJuA0ZrCHNPZZHFeCHurEtqinO0j4YavY79M7INBXahvmt+9jjEyyRgVVHvVchob8paSbHxmCLfz6U8gvK5w9guTbxrEi+uQPl9qaZpfaIYwgRudzq47uF0q4yiLTn94+e7zusITSuRoP2coW896KhVWeQrGtXKe9SrTc7WVv3RgT.8lE96oNs4FxwkJiNX3ap4BG87DKqjKUpIVYRm3GLoS7NS5D+vIch2cRm3GMoS7dm9Dk2LH5sjx7D35RMVS0..C0MkBSYP+mKj3zD
-
You could wrap the effect in a soft bypass container and connect it to the knob.
In this snippet it switches off when the knob is below 0.5, I assume there is a way to change that, but I'm a scriptnode newb too.
HiseSnippet 1759.3oc2Y07aaTDEeV6LNMeTnERo8nOvgTopnXSoTINDmubaDMIVwgzdKLY2wwCd2YV1c1jXPbhKbiCbpHNv+FHwAthTqDR7O.7ePOwU3M6r16r1No1ljzVbjh77duYd+deNe3ZABaZXnH.YM0ts8oHqYw0aykMWsIgwQarFxBi8DNnUZ6SBCoNHKq7OPwxZpIPwedwRqPbIbaZJIDZOAyl9HlGSlRsVkOg45Vk3P2k4YH8cqrgsfupvUDAvHOdQjOwtE4P5VDkX4vHqBq6vjhf5RhjFhrlXEgS65MEGy0xuGKjcfKUMnDpNrPZxUEtNJDqnhVsIy0oVGyMDAFVsTiOu13mCuIyg0kdpS3ZwLJlNCS+gUtrvKeF3UxDdKZ.uA.IKCHMgFRWGW2Nf4KS4nvyL3M3RZPCB31MghVVj0uhWU.BvkK3QZQqF.C5Ng4u2hKdmhv+t8G2HhaKYBdQAeKgjtMe9aO8WM8TS+0SWrWVMZLPdJ0DHbcoACjsJRGbVSbddj2Azf6T7HhaDsqff4m0mhOcepYH2Va0FBJ3avYxs8o7SKQ.k3pfu8oarFQRTAhDZfb9z.ISAAq0nGAY05vxT30ngsjBeHutuXFjsHbhbIxroPp5lDFfOHSbSEb3g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37IRj+huNEt.OboL3.m85K9yKmVzOl4.9tWE5t.NV1yP0mckg9QAgFMnye702TMadEijA1KK6wCyzPKYCIzoLOyK8jYdSi6lJi505KfUWk+hz7+E42eqI96+pOy2ZTMeyCkgVQHZ4Qhuf8+4m55FZlyfeL4HZ7SFGe62aDOtgHvq3Cnv0FzP5ze83eeXe8X+g90i21VBPX2.BOzWDRKYtx8vqrIu0nxHdVw0jxHkx7pBlmgbWoRGhkMIVivyrXv3LqzlpWTIs7acN4.WZcJXMNamdYFiriZQtgz39FkLmXJ4xljeHIvAhK1Ydst7m0CoWZLeH8Bu18P5uA7lrYdvwo5fw5L0ItVmeD0EpFiw36.keMHQtxNTyVNsofK57nWoA5cnx.1gGRy17ePFzxRIwtUJk4prC0kpt9PWRuekGw3TRP7MKGOeQoQ9wWGX75VXMbKp5AT7M22RO++qeK8gu5CZA95cT7lXnUb4hwgxhuZhkWFOA+kgN7H1Ah8s0+xEph9qDSArad7uy6T3MUiKVBcTuGpxC1xXea6rKUeSr73NwOXbm3cG2I9gi6Du23NwOZbm38e4STsidx8GU0FvIapst9R+V5C0DWlf9W.8amewC
-
@d-healey Yes, that would do the trick. But, I'm hoping there is a way to write it into the script fx itself before I compile it dll. Otherwise, It turns into a bunch "if" statements and inline functions in my project's interface which seems impractical from the standpoint of reusing the effect. I'd like to just write into the fx itself and forget about it.
-
@RastaChess I don't understand, the soft bypass is part of the effect
-
@RastaChess I'd just script it Really not sure how much CPU you'd be saving...
-
@d-healey Sorry, I didn't explain correctly. The soft bypass switches at 0.5, It needs to switch on with any value > 0.0
-
I know it really isn't much. By my laptop calculation between 0.3 % and 0.5%. But it all adds up in the end. Could you share your script please? I'm really struggling with scriptnode scripting.
-
@RastaChess throw in a cable_expr node between your parameter and the soft bypass target and use something like this as formula:
output = (double)(input > 0.01)
-
can you route the cable_expr node to the soft bypass power button though? Doesn't stick here
-
@DanH @Christoph-Hart Doesn't stick here either.
-
@Christoph-Hart I tried that (and pma) and it didn't work for me either.
-
@DanH
You can attach a macro to the power button on a 'soft bypass' node.
I'm not sure if that's what you guys are looking for. -
@CyberGen @d-healey Can't you use pma and add a value of 0.49?
HiseSnippet 2058.3oc0Z8zaibaEmijo10d2jrI0YSNpC8fCvBCKksIAHGrrsr2XzHaAOtNAAAvgdFJKVMyvoyPYa0hdpWxsbN8TuzOD8TKZO2dIGJJPAR+HrWJ5wzGGNRC4nQZkzZqj3EXWOO9He+d+kORtsi3Nz3XdDxZ0SGDRQVODaOHPzcutDV.5vlHKL1m6h1cPHINl5hrrJ+L4PVqtBJ4mmu8tDORfCMiDBcFm4P+XlOSjQscieNyy6.hK8TluF2OswgN7f83d79.LJi2BERb5QtjdDQxVILxpx9tLAOxVPDzXj0J6xcGX2kecfh+yXwrK7nxOpgrgERQ9.tmqDwRpn85x7baOTciQfh0NS4KqT90wsXtrQzyLBOJYfpYyP2dXUxDdkMfWMc3skF7J.RVZPZEEjdcrsSDKTjMhDOO.eXffF0g.lccnn3EY8Wv6wAFBDa5S5QOHB9XzD1381ZqmTE9q24C6zOvQv3AU4AGwEziC13cV62r1pq8aWqZ9g5zovwjhIh64QiJbXomNZZSbif99WPidR0qHd8oiXDTeSaJdx1TcWtiRq0XjGbX.SbbHMXRABnTSE7a+hCaRDDoiHkFvWHMRvjPvpI8JHpV4VVE2jF2SvCg35w7YPzB2suGQXFBIyaRG.rAF9MoyIHlIFnmWcqEWMqP70wsYBmtEiwREfQvRcWfwzrwWAuemNTGQF.WAevmt7R8VKM0CjoT3OL8ypG7o0JLo6KwYA3gQzPRD8TdaOxfMhI9gdzS.L9jpW3wc5Yy90zwyJBUPXWIGa3zkDDP8hWjjmJyrUo1zcJmv6KXAW1hHhX2.YgG022FJS6P2KEc.MqRxbH02aI+VFWXSCbS936feRGrl7aqzAqMbPszuinhq4Q8RbGo+Nx5dp5cPPoxli1wyie8db+PVZPJ3BRn0l6MHrKOf4HIo3XHP2wm2GjQJZ+HR7oDlmLp1teLTav83.af4jcwrJeFMJNYguGdqMg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