Global pitch modulator problem
-
Oh boy, this is so annoying, so let's sum up the problem in a novel (maybe I'll find a solution by typing this, wouldn't be the first time).
The problem is that the way the intensity affects the modulation value is fundamentally different between pitch modulation and gain modulation and there is no "clean" way how to use a global LFO (which uses gain modulation) for a pitch target if you have already applied the gain modulation at the source. Also there is absolutely no way changing this without breaking every existing project.
So the actual problem is the LFO intensity modulation when you intend to use the signal as a pitch modulation later on, so the only way to use a global LFO for both pitch and gain is without modulating the LFO intensity.
The advice I gave earlier (modulate the target) however only works until you need to modulate the intensity (eg. with a MIDI CC modulator).
Now we always have two solutions:
- Fix / add it to the modulator system in HISE
- Offer a solution that works in scriptnode
So let's talk about this first before we tackle the actual problem.
If we fix it in HISE it appears to be a more "clean" solution, however it will add overhead to all existing projects because every time variant global modulator will get a modulation chain. These things can go into the hundreds for big projects.
If we fix it in scriptnode, we can leave the existing modulators alone and offer a narrow solution to a narrow problem (plus we get a few new tools in scriptnode along the way), however that means that people will have to go into scriptnode for a problem that appears trivially at first sight. Another thing to consider is that currently the usage of any node that connects to an external modulator cannot be compiled and must be used in the interpreted graph.What do you prefer?
-
@Christoph-Hart What about a adding an additional pitch modulation type that has two parameters. Regular gain style intensity + a pitch value. This would (I think) remove the need for additional overhead for the other modulators, not affect older projects, and wouldn't require the use of scriptnode.
-
Ok, I think I finally get somewhere here.
The LFO will now work as expected when used in the pitch modulation chain. The days of having a weird constant mod that offsets the pitch modulation is over. The fade in and intensity modulation will now start from the center so if the intensity is modulated to zero the pitch will be exactly the same as when you bypass the LFO (by the way this also affects the stereo FX modulation which is basically the same problem).
However this will not solve the problem we have with the global modulators, but at least it's a solid foundation to build upon. Now my suggested solution is to add a new mode for the global modulators that can be switched between unipolar and bipolar. The default will be unipolar, but for our use case, we'll switch the LFO to bipolar and then all our problems are gone. The only thing that will be different is that now the gain modulation will be bipolar, but that's less of a problem than having to correct the pitch modulation.
-
@Christoph-Hart said in Global pitch modulator problem:
global modulators that can be switched between unipolar and bipolar.
Will that cause an issue if you want to use the same LFO for both gain and pitch?
-
It will be different (not sure if it qualifies as "issue"): if you set it to bipolar, the LFO will oscillate around the center. In gain mode the center is -6dB (0.5) so you will notice some ducking if you enable the modulation (but the ducking will be constant if you modulate the LFO intensity so no weird compensation hacks anymore).
-
@Christoph-Hart
Well I can't see any immediate problems with the idea:)Would I still need a compensation hack to prevent the ducking? I'm thinking my vibrato is suddenly going to sound quieter than my sustain, unless I use two LFOs but again that negates the advantage of global LFOs. Could add the bipolar/unipolar thing to the target rather than the origin?
-
@d-healey said in Global pitch modulator problem:
Could add the bipolar/unipolar thing to the target rather than the origin?
No, that's the entire problem. The LFO has to behave differently depending on whether it should be bipolar or not, thus the entire brainfuck.
Would I still need a compensation hack to prevent the ducking?
Add a simple gain with +6dB. Done.
BTW, I've just committed everything, so you can check it for yourself if it works like you need it.
-
@Christoph-Hart said in Global pitch modulator problem:
Add a simple gain with +6dB. Done.
BTW, I've just committed everything, so you can check it for yourself if it works like you need it.Thank you I'll take a look now. The simple gain will also boost regardless of the LFO intensity.
-
@d-healey And the LFO will duck it regardless the LFO intensity so you're fine :)
-
@Christoph-Hart Aha that's good :)
-
Getting a few build errors - to do with the scriptnode additions I think
../../../../../HISE/hi_backend/../hi_modules/nodes/HiseNodes.h:152:24: error: ‘extra_mod’ does not name a type 152 | DEF_PARAMETER(Index, extra_mod); | ^~~~~~~~~ ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/../hi_dsp_library/node_api/helpers/node_macros.h:51:112: note: in definition of macro ‘DEF_PARAMETER’ 51 | #define DEF_PARAMETER(ParameterName, ClassName) if constexpr (P == (int)Parameters::ParameterName) static_cast<ClassName*>(obj)->set##ParameterName(value); | ^~~~~~~~~ ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/../hi_dsp_library/node_api/helpers/node_macros.h:51:121: error: expected ‘>’ before ‘*’ token 51 | #define DEF_PARAMETER(ParameterName, ClassName) if constexpr (P == (int)Parameters::ParameterName) static_cast<ClassName*>(obj)->set##ParameterName(value); | ^ ../../../../../HISE/hi_backend/../hi_modules/nodes/HiseNodes.h:152:3: note: in expansion of macro ‘DEF_PARAMETER’ 152 | DEF_PARAMETER(Index, extra_mod); | ^~~~~~~~~~~~~ ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/../hi_dsp_library/node_api/helpers/node_macros.h:51:121: error: expected ‘(’ before ‘*’ token 51 | #define DEF_PARAMETER(ParameterName, ClassName) if constexpr (P == (int)Parameters::ParameterName) static_cast<ClassName*>(obj)->set##ParameterName(value); | ^ ../../../../../HISE/hi_backend/../hi_modules/nodes/HiseNodes.h:152:3: note: in expansion of macro ‘DEF_PARAMETER’ 152 | DEF_PARAMETER(Index, extra_mod); | ^~~~~~~~~~~~~ ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/../hi_dsp_library/node_api/helpers/node_macros.h:51:122: error: expected primary-expression before ‘>’ token 51 | #define DEF_PARAMETER(ParameterName, ClassName) if constexpr (P == (int)Parameters::ParameterName) static_cast<ClassName*>(obj)->set##ParameterName(value); | ^ ../../../../../HISE/hi_backend/../hi_modules/nodes/HiseNodes.h:152:3: note: in expansion of macro ‘DEF_PARAMETER’ 152 | DEF_PARAMETER(Index, extra_mod); | ^~~~~~~~~~~~~ In file included from ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/../hi_dsp_library/hi_dsp_library.h:111, from ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/hi_dsp.h:56, from ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/hi_components.h:57, from ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/hi_sampler.h:54, from ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/hi_scripting.h:80, from ../../../../../HISE/hi_backend/../hi_modules/hi_modules.h:57, from ../../../../../HISE/hi_backend/hi_backend.h:55, from ../../Source/../JuceLibraryCode/JuceHeader.h:17, from ../../Source/MainComponent.h:12, from ../../Source/MainComponent.cpp:12: ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/../hi_dsp_library/node_api/helpers/node_macros.h:51:128: error: invalid use of ‘void’ 51 | #define DEF_PARAMETER(ParameterName, ClassName) if constexpr (P == (int)Parameters::ParameterName) static_cast<ClassName*>(obj)->set##ParameterName(value); | ^~ ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/../hi_dsp_library/node_api/helpers/node_macros.h:51:128: note: in definition of macro ‘DEF_PARAMETER’ 51 | #define DEF_PARAMETER(ParameterName, ClassName) if constexpr (P == (int)Parameters::ParameterName) static_cast<ClassName*>(obj)->set##ParameterName(value); | ^~ ../../../../../HISE/hi_backend/../hi_modules/../hi_scripting/../hi_sampler/../hi_components/../hi_dsp/../hi_dsp_library/node_api/helpers/node_macros.h:51:130: error: expected ‘)’ before ‘setIndex’ 51 | #define DEF_PARAMETER(ParameterName, ClassName) if constexpr (P == (int)Parameters::ParameterName) static_cast<ClassName*>(obj)->set##ParameterName(value);
-
oops, try again, it should work now.
-
@Christoph-Hart Yep that fixed it.
When the LFO is set to bipolar the intensity slider doesn't appear to do anything.
HiseSnippet 1193.3oc4X0saiSDE1tId0ltvBKrBgPfjufK5J5VkvVJ+cQZaZRUDIMQ0YKHwEql5bRxnZOiY73.QHtfG.dG3IfmAdD3NtkKg612.3L1NISZyllZkFsqvWX44bNi824m47iaK3tPXHWXXVnyn.vv70rbFwjCpLfPYF0Oxv79VMIgRPXmP5vQAjvPnqgoYtiUDLKj2vv3W+ke9OKeHwivbgTRwWmwotPCpOUNkZ68+JpmWMRWnC0WS5c2utKmUg6wiP7jypnQ.w8BRe3DhRrMrLLuS0tTIW3HIRHDk4Pd2QNC3eOKQ9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iU0nRCwIHSDNlXRyMXmN3n.LHd1XCysWzjBewkZGbk4UWi0UWMsJWXM4B+K8Np07l4dUwal8tNxdF80QmFqiugOwUvelaxOqREAd2XJndyh+ijErZpVaWxH9GXolbq3NEM7wplOy0UYheLlJZ964iyvddRF1ytYXOeRF1ydYXOeZF1ymsv8nZX4fHbRxjjSHg1USNXZNYVTybF+GDUFkjG
-
Yes thats the idea...
-
@Christoph-Hart Oh, well when it's set to unipolar, if I pull the intensity to 0 the pitch goes to the max
-
Set it to bipolar, add a MIDI CC to the intensity modulation.
-
@Christoph-Hart That works, I understand why, but it works :) Now if I set the pitch modulator to unipolar and pull the CC down to 0 the pitch is left at + 1/2 of the set pitch value.
-
@d-healey said in Global pitch modulator problem:
Now if I set the pitch modulator to unipolar
Then don't :)
-
@Christoph-Hart lol but what if I want unidirectional pitch modulation? It's just occured to me also that it will require one simple gain per mic position to counteract the ducking, I might use a scriptFX instead.
And now I've realised the +6 simple gain would only work if I leave the gain mod intensity at its max of 1, but if I adjust this I'd have to figure out a new settings for the simple gain to counteract it. I don't think we've reached a perfect solution yet but it's very close.
-
@d-healey said in Global pitch modulator problem:
lol but what if I want unidirectional pitch modulation?
why?