Using LFO in scriptnode best practice
-
Hello, sorry for asking, is there any code example of using global modulation with a scriptnode? How to connect LFO target using dropdown or some UI component?
Thank you! Have a good day. -
@ForeverLive To use a global modulator in scriptnode you need to use a Global_mod node. Like this:
HiseSnippet 2091.3oc6Zs7aabbFeVRMzhx1AxI9PPPaAARN3f5pJJ4j1fdPqDojKQzCVSU0.TfXOZ2ghCzt6rc2kxhIo.FH4PA5gbq.A8P6gdq.8TOzhhB66MEvH9bOzSoWBP5eAseyN6iY4KQtllNMnj.D679226u4iaSOtA02m6gzJeXOWJR6J3V8bB5TqCg4fZTGo8B38H9ATuJxt1pmKw2mZhzzJdaQGZkW.E94K2XKhEwwfl1EBcDmYP2kYyBR6so9ayrr1gXROjYqL6ao2vf6Tiaw6B3oHdUjKw3TxIz8IhoU.izJssIKf60JfDP8g4rE2rWqN766Hm+QLe1wVTQipnVvFI6FUqCyxrYLs5ifMpYJkWTR4WGuGyjkzeJGX4vApjtBUdfVgwAopSAjzTfzBRHcMbKCOlaP5HB7bYbCGPfzl.rZUnHmKR6Q3ZbXBNAqXSNktiGzHYA2X8UW8lUfed8eP6tNFALtSEty97.5AN230W58Wp7R+7kpz+PsaOzwDGiG2xh5MzgERWuwsva3z09Xp2MqbFwpKMYh.4mkmVZx3oFRpVYhbmFNrfCboQs2gaYJ3UhmGTBfhXafrnXDBgmBBkDuPjjnkEyj5gXvlbI7a6vOtJJD7QZw26O8s9hGh5ewKGs3Zb6i4awOOb4WFG2L6VDZIglfyeQbstAfnIypev0+Ce9Fnebi5j.hPmJhj.xzk5EvDbSs5zy.iRoFVYbcp+oAb2PZ11k6HX.ZkuPp97T3dndujFOnstMyzzh1j6yDRaUmA1YbW7v.54vQsDdOtYcpaPGjarvnAbPubzY6vMoUD9jn9LepWUvofG3O.zmEyRY0HE7u3Dx3GAUneOcaBLFVq.zhEPsA91Uw6tyAUptj320xCVur.qs.mafcqJXKcwh3QfSz954.GI6JZPONKKvXWKRPVGfBO8QCHjopdcDtVb.YcOU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cOlyQY+2E.xfbde8spt3tVsXuWlnSsNkdeIqLSLv5BZQhoA15M6BWhCLKMSDTQxGICIif4pg5UPRXqHFZJDJEysPw+r1YEJWFmdy5rbwhSOWD3XCvEAW.igKJ2fKfKNdf7kO7oGHKg2CxNh4Z0KEKO3K9fMdi282swzfkYASAi2zzLEFGu767V+w+0mswHUrtBl6a.WEPDMYnF9JCmacrm0lrkT3qklL95xSoIaIbXxmCHct.Q5szG3n+EOo+i929IexedviV+Cs+6aH+CqSMxxtUO3TcUAawKRWeimdWWWIDLUtiviwfbiQhlR4Wae7RkaCm13kJkdV48Ir7cC58YNb1kBu03PH6LQLDdq6KhQalkvjYEwPyJq4cj6Y5ii29E1uQa7lWKngyul.KH8OVejdn6W3ou95OoeKnG8oe5qNYfA8p+6GGBlh3ezTqvt1iFToYM8YgRyyR8068R0eRD+Ooz3YNe8+468Q4wVc137dlQ5i6nKiiK7+Xj48mvTIISK88cX5SCEC2Io5HzFFXqTS3az4+k4NB8katzfG0OMn79kL6S8JYoO527Je2+wq821XxHigb2BkD3FfDRdcOl8txSV5up1uz5y+0OI+DfLqOzVb9o1jv6EmqWho4xs3sIFd76Fc2EAUtXXOfEfS3KpXY7dh1URdutDpxqhrYlr6ZXHJOz2oJBM70rVNVy54XM2JGq4MxwZdybrluWNVy2erqQT77nnjBMQnilaKClqk7uZBo68egtcpAF
One important thing to note is the global_mod nodes index parameter has a step size value of 1.0, meaning it will increment from 0 - 16, ignoring the decimal points between. However, when we patch this up to the parameters in the network and connect our combobox (dropdown menu) this doesn't work as you might expect as the combobox ignores the 0 and begins at 1 by default.
You can fix this with scripting , or if you're lazy like me, you can change the step size of the parameter controlling the index to 0.1, like this:
-
@modularsamples ok, it's very good solution, but in my situation i feel like it would be easier to not use scriptnode, but just connect a slider to LFO directly with some scripting. How i should reference the LFO? With some callback to modulator? Sorry, just want make it so user can change the LFO target with a dropdown.
-
@ForeverLive Add
NUM_HARDCODED_FX_MODS=6
to the HISE juicer file and recompile HISE. This will add modulation slots for up to 6 of your scriptnode parameters and you can just assign a standard LFO modulator. -
@d-healey Hi, wow, thank you. You as always just crushing it. Can i ask for any reference about assigning that modulators to target using scripting? Thank you very much!
-
@ForeverLive said in Using LFO in scriptnode best practice:
Can i ask for any reference about assigning that modulators to target using scripting?
I'm not sure I understand the question.
-
@d-healey i mean how i possibly can do the dynamic target for LFO so user can just use a dropdown and pick where LFO is assigned to. Thank you again for the priceless help!
-
@ForeverLive I think the only way to do that would be to add an LFO to each parameter and bypass them all, which ever one the user selects you unbypass
-
You could also try and use the new modulation matrix object like shown here:
https://github.com/christophhart/hise_tutorial/tree/master/ModMatrixTutorial
It basically lets you define mod sources and targets and then make the connections dynamically. The targets can either be modulation slots for sample accurate modulation or any knob on your UI with a block-based modulation which isn't as accurate but should be fine for most targets.
-
@Christoph-Hart , @d-healey wow, sometimes i cannot believe i living in same reality with both of you. You are just superheroes in real life! Thank you very much, God bless your families.
-
@Christoph-Hart I just got this error all the time. Using late july HISE version.
Function / constant not found: Synth.setUseUniformVoiceHandler
-
@ForeverLive That function was added in June, you sure you're using a version built on source code from July? Either way you're out of date, update, update
-
@d-healey isn't july is after june? July month number is 7 and june is 6. I loosing my mind really. Ha ha
-
@ForeverLive January February march April may June July august September October November December
Who else sings the song while trying to recall months, or is it just me..
-
@ForeverLive Lol yes you're right, that's why I asked it "you're sure" to check if you had made a mistake. Perhaps you built HISE in July using source code from June or earlier.
@Casmat I didn't know there was a song...
-
@d-healey yes, you right, i updated HISE using your fresh awesome script, and it was so refreshing that i almost started to jump around and scream of happiness :)