Help a newbie, i need a solution that a knob (slider) shows both values/modes Frequency and TempoSync
-
Hi to all, i am an absolute beginner in HISE and i need help with a problem for which I have not found a solution anywhere.
I have an LFO Modulator and a custom Filmstrip Button linked to parameterID Frequency.
The Problem is, i need a solution that this knob shows both values/modes Frequency and TempoSync, if i check the TempoSync Button on or off.
Like the original LFO Modulator self.
Of course this problem exists with "all" modulators e.g. LFO/Filter/Pitch etc etc, where I can switch between hz/sync.
On slider shows ony one value "hz or tempo sync"
Building a synth without a solution to this problem doesn't make much sense.
Because this problem pop up every time when I create a button for a LFO.
I am completely "new" to this subject and need an example script based e.g. on a pitch modulator, which i can then transfer to all the others.
Many thanks in advance if anyone can help me. -
@Xearox73 Most of us use two sliders one set to tempo sync and one not, then we add a button to turn tempo sync on and off, in the button callback we hide/show the correct slider for the button state.
-
@Lindon
Ok, understand, but .....
do you have an example script, as i said, i am an absolute beginner when it comes to this kind of thing. -
@Xearox73 found this by searching the forum posts, might help you:
-
@Xearox73
thanks to you, but that doesn't really worktotally buggy?
-
@Xearox73 works here - what are you doing to load the snippet?
-
@Lindon
apparently didn't copy the whole snippet
it will still not be easy to integrate this into an already rather large project.
I'm struggling with it right now -
@Xearox73 You can set the mode of the slider (either Frequency or TempoSync) based on the value of the button. This may be easier to integrate into your project.
HiseSnippet 1354.3oc0X8taiSDDecR8IRtiBENg3iVQ7gTQUUx0xAHTooMs4Hhl1n5dEP7gSasWmrp16ZVutzbnJwqA7lvaAOJ2a.LqsS751z1zPOJ3OD0c1Ym42L67us8EbGRTDWfLpbznPBx3Il1iXxgsGhoLT2cPFOxrm5O2dTHNJh3hLLJ+BEAiJKfR9dylai8wLGRNID5XN0grGMfJyo1u02R886fcIGQCz3d8Vcc3r1bedLfixlMPgXmSwCH6iUrUxD.wttTIWXKwRRDxXgs4tirGx+YVJ+GSinm3STKZhrAAkRtC22UgXEUT6gTe29is2HDxvret0WN05epYOpKcB8buv6mrgU9Iz8GFkJBuxEfWyqCdSARFZPZgTHsjosifFJy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2aWufV.mKGRYCJV0Eg1iyC2kgAufqN49Cg.VXfWXP5BhAD6Q7dXXJHQa3QImpuY2ALtfjNDcgBvwQRdvXCH4cl1vTTIiyY7ilOe8UgOuOU86W1F9YsCteVit+RmJMiwneXRjvjqbULwcOSZgYKJ8Vlh+Ng3IAg+GAwODSEcHOVBIH8vPgd0L06GGXCCi3P.syXvKYAZFkTwyoqanVmNMByMYweAeYa1Ts1Hayli27eEcDfcD7W4j9jKUv66jPAraVx+lmJl8TqsZd0GYE.SR7JGmhh5JG7Yy6AWadO35y6A+r48fOedO3mOuG7Kt8CpFzaqXnVZZ6ODpW+cSqhZLoDtQYzeC1XTfoC
-
@Steve-Lydford said in Help a newbie, i need a solution that a knob (slider) shows both values/modes Frequency and TempoSync:
@Xearox73 You can set the mode of the slider (either Frequency or TempoSync) based on the value of the button. This may be easier to integrate into your project.
HiseSnippet 1354.3oc0X8taiSDDecR8IRtiBENg3iVQ7gTQUUx0xAHTooMs4Hhl1n5dEP7gSasWmrp16ZVutzbnJwqA7lvaAOJ2a.LqsS751z1zPOJ3OD0c1Ym42L67us8EbGRTDWfLpbznPBx3Il1iXxgsGhoLT2cPFOxrm5O2dTHNJh3hLLJ+BEAiJKfR9dylai8wLGRNID5XN0grGMfJyo1u02R886fcIGQCz3d8Vcc3r1bedLfixlMPgXmSwCH6iUrUxD.wttTIWXKwRRDxXgs4tirGx+YVJ+GSinm3STKZhrAAkRtC22UgXEUT6gTe29is2HDxvret0WN05epYOpKcB8buv6mrgU9Iz8GFkJBuxEfWyqCdSARFZPZgTHsjosifFJy2QgmGa1kIIBOL310gRJunR+PIy1bfClb0.7ojNBXwjSTesFMVw5YMZr7WUsZUJymxHVdwLGIkyr3rSjriHAgbHRvQIEA2utCGHv.4sh0YX+XxxU+kpU74NXeKeOt0FVIgMqNfH6wci8wf6nds85bf0jkMqApqBv7pQD4VRofdRrjTWQXh1FKbfwpUnd0SVYswFVMVtZEPgUFaTfdZOFQ0qcJ6DPUcDjeJlvb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ts1Hayli27eEcDfcD7W4j9jKUv66jPAraVx+lmJl8TqsZd0GYE.SR7JGmhh5JG7Yy6AWadO35y6A+r48fOedO3mOuG7Kt8CpFzaqXnVZZ6ODpW+cSqhZLoDtQYzeC1XTfoC
you re going to have to set the max and min values, the middle position and possibly the step size as well if you do this.
-
@Lindon and Steve
Wow, thats much easier to integrate
How do i set the max and min values, the middle position and possibly the step size?
It`s one knob/slider ? -
@Xearox73 You can use the
.set
function to set the properties of components. -
@d-healey
thanks, solved -
@d-healey
uhhps, the defaultValue function runs only with one
the second will be ignored:inline function onbtnTempoSyncControl(component, value)
{
local lfo = Synth.getModulator("LFO Modulator1");
lfo.setAttribute(lfo.TempoSync, value);if(value == 0) { Content.getComponent("knbLFOFrequency").set("mode", "Frequency"); Content.getComponent("knbLFOFrequency").set("defaultValue", "10.0"); //OK } else { Content.getComponent("knbLFOFrequency").set("mode", "TempoSync"); Content.getComponent("knbLFOFrequency").set("defaultValue", "1.0"); //Ignored }
};
Content.getComponent("btnTempoSync").setControlCallback(onbtnTempoSyncControl);
-
@Xearox73 said in Help a newbie, i need a solution that a knob (slider) shows both values/modes Frequency and TempoSync:
local lfo = Synth.getModulator("LFO Modulator1");
Content.getComponent("knbLFOFrequency")
Store your references as
const
inon init
instead of getting them within the function.If I remember correctly the
defaultValue
can only be changed after you change either the min or max. Here's a thread about it - https://forum.hise.audio/topic/8354/is-it-possible-to-change-default-value-after-on-init -
@d-healey
Thanks !!!
Another question, how can i set the start size of the "ZoomHandler.js"
a bit crazy ... HISE shows only in 75% the Original 2800x1500px
At 100% its to big ... zooomed ????namespace ZoomHandler
{
const var MIN_ZOOM = 0.25;
const var MAX_ZOOM = 1.0; //should be 2800x1500 or not ??
const var ZOOM_STEP = 0.10;
const var INTERFACE_WIDTH = 2800;
const var INTERFACE_HEIGHT = 1500;Correction - HISE shows never the exact ZOOM, is it not possible to set the interface at 100% Original ??
-
Option 1: Design your UI to look the way you want on a 1920x1080 screen at 100%.
Option 2: The size setting is stored in the project's GeneralSettings.xml file, so you would need to modify that to change the default value on a user's system. - Search the forum, this has been discussed before.
-
@d-healey
Ok, i read many postings, but this has to do with the zoom level of your interface.
The Interface Designer himself never shows a pixel by pixel pictore/preview
I checked all possibility and make screenshots
then imported them into my graphics software and no shot has 100% 2800x1500px ??A 75% in HISE has to be scaled up to 104,56% to show the exact 100% of the Original GUI px by px
-
@d-healey
Best Solution for all LFO controlled modulators - solved:inline function onOSC12LFOPitchSyncControl(component, value)
{
local lfo = Synth.getModulator("LFO Modulator3");
lfo.setAttribute(lfo.TempoSync, value);// if needed you can set a defaultValue for the Frequency if(value == 0) { Content.getComponent("pitchLFO12").set("mode", "Frequency"); Content.getComponent("pitchLFO12").set("min", "0.5"); Content.getComponent("pitchLFO12").set("max", "40.0"); } else { Content.getComponent("pitchLFO12").set("mode", "TempoSync"); Content.getComponent("pitchLFO12").set("defaultValue", "5.0"); Content.getComponent("pitchLFO12").set("min", "0.0"); Content.getComponent("pitchLFO12").set("max", "18.0"); }
};
Content.getComponent("OSC12LFOPitchSync").setControlCallback(onOSC12LFOPitchSyncControl);
-
@Xearox73 said in Help a newbie, i need a solution that a knob (slider) shows both values/modes Frequency and TempoSync:
Content.getComponent("pitchLFO12").set("mode", "Frequency");
Grab your component references within
on init
and store them in a const instead of getting them in the callback function. -