One knob controlling two parameters
-
@Lindon Thanks for the code. How do I get the script to reference Knob1 so the parameters move when I turn the knob?
HiseSnippet 1329.3oc4X0sabSDEd7twE1MMUsUUHtAoQUbQBTRWuMsfTDjsIY2RTSZ1FmV3tpI1iyNJimw0dbZ2VUItfK3I.gP7LvEvK.R7BfDRbM7Fz2.3Li8F6swJc6VZQprW447yLemiOmu43serziljHiQVM1cXDEYcZa2gB0f0FPXBzFqirdO6t2F6fuoPtGtMtOIlf2klnvNK1ZwVnUGFQRRn9HKq52P6hUiYPleOckUIbhviVHBgtqj4Q2jExTER624lLNuGwmtKKrj0K0YCOoXMIWlBvqtcKTDw6.x9zaQzlUyFYcpt9LkL1UQTzDj0LqJ8G5NP9.Ql82kkv1iS0KbPtvFkItmj6qQr9YzZCXb+9iRCIHjkc+hjR8rjxEr2h4yNRdQx4rFE3BOJmOrpcRvyYJgmUI3MSF7NmsqWLKRUnQisYs2PnnwAD3UPYXkYKpFpl8ZRvBgZwPxAzdwvhi7X9q0p0kvWsUqEVdtly0DdQ.uxOjDi6daG7mhM0HKtOU0MHf5ol+hf3KtvxiYW6psqs1tlLAmIn3fTgmhIEXoXSo6.JOnWL89ZXEK4y6ICijB.fWB1RdJcglOtYiKeYt7A3Dss3.v3lM3ROBGSuu+C0PqE9CzfbwUIB+sCBRnJ7GZDn24kKac6irt8yZc6QVqcDDdckJlsWphNu4XFgGiAsOtAsKL3IKWJFukTQ2VLuINZ9jl3mUUPPk5xyGbZbkp0sMwmjiyKRC2iFWNKpMDpeFu.c1Iq.0KqpojgRwFBlZ6HZ95hRXstrndj1VniB1xhJhwxRMgVElUH53cHn7pZcuRt4foJSmxYx6Tb4LeZLhAX7sr0TaNHStIm84Ou8o+oNn6rw5DEYz1.6HbJQzXESmqrVmdHvkk0.1vdcZxAJYjw17hV3zdtG5CA5FqOCNwg5G5.OjnFpy3mxX.Jj46yo8kIL8azi3F+lesShhF4xdjAwO9B+3M9qG80qDVl+coNgjGV3wu2IIMHfoOPa7m+H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ZlmgcGWMd76oXh3HY7TarCDx2CaQDWT3ihASA4cMEjJJuqjoJU0KWqOFjk5iCSmnRqrsdnLQnmpRV0+kkOJcX0E9O8rzWb8wpNav8MLtesIXzgGFE.8DGCA3jGoX7ivQMR6VOQ5zuq2VJjQCkBtawK8cgwidVD6kFP37s3.l4Rtdmcg.fU7A7m0493COlZ6z4HlKtn0ryEm280mXmAWpIYj9tw7GUeGZ9i+AP4hnwwEwYDxbUxm3l8YGl2xePpDLtEo+aF0r21rld52aXaa96Uvo84Ow00P2eIxOk6S64vmaMG9rxb3ysmCetyb3yWMG970mqOllQqmnkgYohnfA8R+tOKqBiHQ9arPecv.
-
Hi guys, I have a similar enquiry and am well out of my depth!
I would like to control 3 parameters with one knob on 3 different AHDSR Envelopes (I have a Sampler, SineWave Generator and Waveform Generator in my project).
Any help would be hugely appreciated, I've learned a lot from the forum so far but have a long way to go!
Cheers, Dan
-
@DanH Can you write a callback that controls 1 parameter?
-
@d-healey Hi David, the scripting is super new to me so the short answer is not really!
I find the Hise UI very intuitive and have made pretty much the sampler I wanted in a couple of days, but the extra functionality afforded by scripting is currently beyond me and I need to learn!
I've opened the knob link snippet from the Hise website (https://docs.hise.audio/tutorials/recipes/ui/general.html#link-sliders) and got close but ultimately couldn't link the three knobs to the ASDR functions.
PS - I downloaded and compiled Hise for the first time on Wednesday! Following your video of course!
-
@DanH The snippets given in this page so far (with a little modification) can do what you want. Since that's a little complex for you at the moment it's probably best to start with this video and get familiar with the basics of HISE scripting.
-
@d-healey Thank you, much appreciated :)
-
@DanH I highly recommend @d-healey Patreon. You'll learn so much AND he's a great teacher.
https://www.patreon.com/davidhealey -
@dustbro Great shout, thanks for letting me know!
In the meantime, I'm getting my head around the script in the snippet you posted above @dustbro. However, in line 3, when I try to change 'EQ1' to the modulator I want (in this case the AHDSR which I have called 'ENV1') I get the error 'ENV1 was not found'.
My line is: const var ENV1 = Synth.getEffect("ENV1");
I had this before as well, I don't know if there is a special name / code for 'Gain' modulators as opposed to 'FX' modulators... FX always works, Gains do not!
-
@DanH said in One knob controlling two parameters:
My line is: const var ENV1 = Synth.getEffect("ENV1");
This declaration is not correct. You would need to use:
const var ENV1 = Synth.getModulator("ENV1");
The easiest way to to get reference to a module is by right clicking on it and selecting "create generic script reference" and then pasting that into your script :)
And that's only half of the story. Once you get reference to that module, you'll have to use setAttribute() to select the parameter you wish to control.
Available parameters for the module can be found in the Module Browser: -
@dustbro Thanks Dan, that is massively helpful. I've somehow managed to do it! No doubt be asking you tomorrow about something else
-
@DanH So I'm attempting to apply the same script to a Legato On/Off button for all 3 synth/sampler modules. In the Module Browser these's no value for On/Off for any of the modules (I don't think). Does this need to be done a different way? Script below:
//LEGATO
const var LEG1 = Synth.getMidiProcessor("LEG1");
const var LEG2 = Synth.getMidiProcessor("LEG2");
const var LEG3 = Synth.getMidiProcessor("LEG3");inline function onLEGATOControl(component, value)
{
//onoff
local legdx1 = 0 * LEG1.BandOffset + LEG1.On;
local legdx2 = 0 * LEG2.BandOffset + LEG2.On;
local legdx3 = 0 * LEG3.BandOffset + LEG3.On;
LEG1.setAttribute(0, value);
LEG2.setAttribute(0, value);
LEG3.setAttribute(0, value);
};Content.getComponent("LEGATO").setControlCallback(onLEGATOControl);
-
@DanH
.setBypassed()
-
@d-healey Many thanks David, what do I need between the parentheses to make it switchable?
-
true
orfalse
,1
or0
. -
@d-healey Thanks again David, so my script is: LEG1.setBypassed(0); which will turn the legato on when I click the LEGATO button, but not off again.
-
@DanH And if you set it to 1 it will do the opposite. Can you think of a way to get a 1 or a 0 when the button is clicked?
-
@d-healey haha, I will certainly try! PS - I am exhausting all avenues before eventually posting on here and am hugely grateful
-
@DanH I'll give you a hint, try checking the value of the button inside the callback ;)
-
@d-healey 2 hours later and I still can't do it! I'm hopeless