Global pitch modulator problem
-
adjust the intensity of the global target pitch modulator,
That was your first response in this thread in 2017 :p
Then you said
Now I get it. I think I need to change the way how the intensity modulation affects the intensity. Right now it just "modulates" the intensity and for Global Modulators this has no effect so in this case I need to apply this directly on the actual modulation signal. Does that make sense?
Then we get to today :)
-
You missed the part where I get it :)Lol forget it, it's the same thread, I think I can scroll upwards myself... -
@Christoph-Hart said in Global pitch modulator problem:
Or add a intensity modulation to the receiving modulator which might be even cleaner...
I think that is the cleanest and least intrusive solution so before I implement this, please tell me this would fix your problem.
-
@Christoph-Hart said in Global pitch modulator problem:
please tell me this would fix your problem.
I'll try now, but I'm sure I attempted this and found a reason against it.
-
How did you attempt this? It's a rather complicated addition that requires a hefty redesign of the time variant global modulator.
-
I probably did something like this:
HiseSnippet 2423.3oc2ZkzaibbEtZJUThZjkimQvvHvAnw.efCrLAapkYjMBDGsMfvZgVTihA7AgRcWTrA6tKltaJIZCC3C4d9CDfbOGxobN4ZNleBI4Wv7OH4UUuUMWaxP6IdzAAUau56U0a46Usp6xzoddLWjRgK60ghTVE2nmieqCZQLcP0NDorF9ThmO0UMnq860g34QMPJJK7JdGJEVDI94M6sOwh3nSS5BgthYpSOwz1zOo25U+RSKqiIFzKMskl8VUqoybNfYw5B3YAbYTGhdaxszyH7okCiTxejgoOysgOwm5AyYelQuFsX26DL+qL8LuwhxangZ.BJnazAsLsLpGoqdHPP0Sz7EBz70wmZZXF2exIvuPLfZxJjOCTxMNHoMEPRQBRKF.oO.2P20riexHb77HbMG3BoIANpkgRvbQ49CJ3CXvLb7KYSZSO1EZDuhh6Tt7Fpvud1WrxJvwsmu5cDWUalg5uVUb0W5Vp+oLitVDPsJ9zWYwtgXoxupTuh3ZRb7UiGV6obwX5XY5PUa10Q22j4nxb9RG1MZbP3xrJpyr6vb.3rArUVcoOakuakBvFVxiJvkimoeuhAC8Eq78f.ifOfjChVbwmJD5SeFeYgh9.hk0MfMRwz6HHEIrbFymdtSQwttx2uhZ+C0r4PGKTVVT2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v1eoKwwqCyKkfaPsMuj4vOoS570dTNe8.55xOAKi3NzgdydGCJ4PWSCheWWgoWzawHYpsPle.P4mRJ8W3RZ9uS8oFdK9k7R8P0EhvXCQgDGEVWg.iOFBHI9XnQ8l1v9TlCK5k4Rt0ufBNj2dKOReB1GpBERnU5SFDQkLtqOoZv6DIpBd1NKl9+aQF580GEx+N3Qjeq+EXWN5suC9fUi7suyzmkdhIMfHFWRDXjOg6frWASVzYbURxYh2XbeXyOuuuj0b617mC4MSYwUHiWip3w+uOzjw+9lcXVD9yUkS51L2OWtMeWkgwOE6gMQ2kccXQibKvkE8.5si3eHvBPkIPaUMzcxLg4OT6055QOr4vWSkYXMaNCqYqYXMaOCqYmYXMOeFVyKF6Z3DUBKnk6+AcT+n.GSk3ZsUV.8ekn1uAE
This sort of works for pitch but it's a bit fudgy because I have to set the knob range to cover the pitch value, 0 - 6 in this case, but once you get down to a lower value it's hard to hear any difference because it's linear. Really I want the knob to be 0 - 1 so I'd probably need to use a conversion function with a suitable skew to make it sound right at all values.
If I want to use the same modulator for other parameters, gain, xfade, etc. I'd have to script conversions functions for each of these too, or use separate knobs on the UI. I'd also have to hard code their intensity ranges. Using the global LFO intensity I could just set the gain mod's intensity slider to 0.5 and then changing the LFO intensity would stick in the range of 0 - 0.5 but doing it through scripting I have to hardcode the 0.5 upper value - or add additional UI controls to hold this value which I then reference in the script.
Another solution is to use multiple LFOs but then what's the point in having global LFOs.
I think we have enough workarounds to get a working result, but it's hacky.
-
Here's what I think is a workable but hacky solution. It includes a skew factor to make the pitch intensity behave in a more useful way.
HiseSnippet 1526.3oc0Y0saaaCEVxNrK1cqXcqXnXXCPqXW3rk4Zul18SQWbiSbPvRZLhRyFvtnfQh1lHRjZRToMXXOO6t8LzGgs2f9Hz2fsCknrnRbbT7RR67EAlmeH+N+vy4Pm9gbGRTDOzvr1tGEPLLeWj8QLwntivTlwFqBzQdC3BRjvXkiBvQQDWCSypqKYaVaNijOud4UvdXlCImjgwdbpCYSpOU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CwX6ZSxP3fzorKApRByS5neJ19btXDkMTKYy5OW+uWdSNOXMFFLcW8Mo+HbjbNCXnF8b6twQBteFVRdIhsfDjzXy7WPOXolvmAeYyrO2a6we865l8sYfuwE2iKpT5rLYjLe.WPjyeV1U78BIhGmO8+.DO0NRUKUGoKb7N6cmtXfxN7XAbOEdpPHElfA8jXeanUfCAPBiQ7fCBYVQNMT55Vx0IWwIL2jE+C7QwrsbsohY6LlFmrB10Q1PmsjWglXreTxZK4Mcq0IPOuSVM6Ruu21NB332MDyhB3QE1XahOcWXTvHchOMhHS92QlIoSuKGGNQVud4dfQNQcrwh3vjTxG6yiYhBofUKcbWuVTw4C0j+prQ8k9PluAmCtPo8ZYXzl5G3QVicHwCdtUBF+.38UCvwdhLpESr2hy3Ai3LZgNn6PfKjCGRB0w9DMnGKDXmCxobqN6P7HX8L3OuylPlGND7SjYzWb9+MzlX751nT3ZIuMZ8eItcgWIVMn9mnF2SBv8vgTLK+GIS8SxpR4N6tGPIhcwIfRJvgvquSENgX5TLvHMvf9LhS5KAWbZuC36O1vdWXgu2lafdloa0JYbq9Xve1ndEZ.2CGJen5oDCq71bL7MwSduJFj3p3L7wNg7m4j9iuIy0lOgBX2rj+aH0PaIWa0N62bCgZ0rk7mzg9LGGoK9qfJMSVmudFz4dyfNKMC5b+YPmGLC57MyfNe6T0QNOxiigGJlVRBHzeszKlliepoYUi+Eng+wAJ
-
Not to derail David's thread but I just want to chime in to say I would love a better solution for this as well.
@Christoph-Hart said in Global pitch modulator problem:
Why don't you leave the intensity of the source LFO at 1.0 and then adjust the intensity of the global target pitch modulator, then you get the desired behaviour?
Changing the pitch amount is not the same as changing the amount of the LFO modulating the pitch.
It would be great to have .setIntensity function the same on the pitch modulators as it does on all the other modulator modules where .setIntensity is setting the amount or amplitude of the modulation. I don't think the issue is with the time variant global modulator but with all pitch modulation.
-
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.