Voice Count: scriptnode synths?
-
I'm sorry to pester
But I'll have to ask you to elaborate / be specific -
I'd like to be able to set a voice limit at compile time.
Yeah, just set
NUM_POLYPHONIC_VOICES
to whatever amount you want in the extra definitions of your project, it will be used globally for all sound generators, including your custom ones.During development you should ensure that you compile HISE with the same value as you compile the DLL with, otherwise it'll be glitchy.
-
Ah, in the project like this?
I never knew this existed. I assume it will only take effect after compiling the whole plugin?I initially rebuilt hise with the lower voice count pre-processor but that caused errors when I tried to play voices above that count. Perhaps this way will work.
Thanks for elaborating.
-
@griffinboy if both HISE and your dll are using the same value here it should work fine (and if you change the value in the HISE source code directly you don‘t have to do it here).
-
.dll ?
I have a feeling I still am missing a piece of information. But I'll see where this gets me. I got errors when I tried to build Hise with the pre-processor definition before. I'm going to try all of the different ways and see what works.
-
@griffinboy if you compile your effect to be loaded into HISE, it'll be a DLL that HISE loads and calls into for the processing. This DLL has to be compiled with the same
NUM_POLYPHONIC_VOICES
value or otherwise there will be a mismatch and glitches. -
How do I set it for the DLL? Is it a case of:
template <int NV = 8> struct Granular_Synth_2 : public data::base {
in the c++ node?
-
@griffinboy no, use
ExtraDefinitions NetworkDll
in the project tab, or better, just change the number in the HISE source code directly and done (since you have to change it anyway to match). -
Hi is there a specific place to do this in the source code? Just want to be sure, sorry for asking!
-
G griffinboy has marked this topic as solved
-
Update*
Adding the preprocessor definition that Christoph mentions in this post
NUM_POLYPHONIC_VOICES=1
in every available preprocessor box (including the juicer file when building Hise from GitHub, and the project preprocessor boxes) seems to have worked. Sometimes I get errors when running Hise debug and going over the limit. But in regular release Hise the limit seems to work. Now that I think about it, I wonder if I was supposed to track down this constant and change it directly in the source code.
I've noticed quirks such as the seems that it lets you play one less voice than the limit, and it also cancels voices in a bit of an odd way. Maybe there is still something to do, or this is just how it works.
Voice limit must be set to a power of 2, eg 8, or you'll get an error.