HISE Logo Forum
    • Categories
    • Register
    • Login

    Voice Limit Count: scriptnode synths?

    Scheduled Pinned Locked Moved Solved ScriptNode
    22 Posts 4 Posters 833 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • griffinboyG
      griffinboy
      last edited by griffinboy

      How do you set the voice count of polyphonic scriptnodes?

      8e07a444-0c09-46b6-85e6-a149b877427b-image.png

      griffinboyG 3 Replies Last reply Reply Quote 0
      • griffinboyG griffinboy marked this topic as a question on
      • griffinboyG
        griffinboy @griffinboy
        last edited by

        @griffinboy

        • and will there be automatic voice stealing if I do so?
        1 Reply Last reply Reply Quote 0
        • griffinboyG
          griffinboy @griffinboy
          last edited by

          @griffinboy

          I feel like someone answered this recently.
          In regard to scriptnode synths. But I can't find the post

          1 Reply Last reply Reply Quote 0
          • griffinboyG
            griffinboy @griffinboy
            last edited by

            @griffinboy

            Perhaps only @Christoph-Hart knows : )

            Christoph HartC 1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart @griffinboy
              last edited by

              @griffinboy HISE will use the NUM_POLYPHONIC_VOICES constant to create a fix amount of voices (default is 256 I think) and then use the default HISE voice management system to allocate / start / steal the voices.

              If you set the voice count to be less than the maximum voices using the scripting API, it will just ignore the voices that are allocated above this amount.

              griffinboyG 2 Replies Last reply Reply Quote 0
              • griffinboyG
                griffinboy @Christoph Hart
                last edited by griffinboy

                @Christoph-Hart

                Sorry I'm struggling to find that in the docs! If you meant the javascript which I assumed you did rather than the c++

                Unless you do mean the c++, so instead of using NV for the polydata, I just type in the desired number of voices?

                or something like

                template <int NV = 8>
                    struct Granular_Synth_2 : public data::base
                    {
                

                ( ^ Okay well this probably wasn't what you meant because it didn't work xD )

                // maybe
                PolyData<Voice, 8> voices;
                // instead of?
                PolyData<Voice, NV> voices;
                

                ^ hmm, doing this wasn't right either.

                Maybe you were referring to the Hise UI scripting? I still couldn't find anything in the docs about it

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @griffinboy
                  last edited by d.healey

                  @griffinboy https://docs.hise.dev/scriptnode/snex_api/containers/polydata.html

                  The docs search is limited, I use github's search

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  1 Reply Last reply Reply Quote 1
                  • griffinboyG
                    griffinboy @Christoph Hart
                    last edited by griffinboy

                    @Christoph-Hart said in Voice Count: scriptnode synths?:

                    NUM_POLYPHONIC_VOICES

                    It's a pre-processor definition?

                    else
                    {
                    	// your handleVoiceLimit() function failed...
                    	jassertfalse;
                    }
                    

                    mmmm.... I'm managing to do nothing but break things.

                    I'd like to be able to set a voice limit at compile time. It's all for efficiency reasons. If theres no overhead then I guess it doesn't matter, but I know that it makes a difference in the sampler so I wanted the same for my scriptnode synths.

                    griffinboyG 1 Reply Last reply Reply Quote 0
                    • griffinboyG
                      griffinboy @griffinboy
                      last edited by griffinboy

                      @griffinboy @Christoph-Hart

                      I'm sorry to pester 😅
                      But I'll have to ask you to elaborate / be specific

                      Christoph HartC 1 Reply Last reply Reply Quote 0
                      • Christoph HartC
                        Christoph Hart @griffinboy
                        last edited by

                        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.

                        griffinboyG 1 Reply Last reply Reply Quote 0
                        • griffinboyG
                          griffinboy @Christoph Hart
                          last edited by

                          @Christoph-Hart

                          Ah, in the project like this?
                          I never knew this existed. I assume it will only take effect after compiling the whole plugin?

                          eeac91d1-9865-4400-b426-5b99b42f3767-image.png

                          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.

                          Christoph HartC 1 Reply Last reply Reply Quote 0
                          • Christoph HartC
                            Christoph Hart @griffinboy
                            last edited by

                            @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).

                            griffinboyG 1 Reply Last reply Reply Quote 0
                            • griffinboyG
                              griffinboy @Christoph Hart
                              last edited by

                              @Christoph-Hart

                              .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.

                              Christoph HartC 1 Reply Last reply Reply Quote 0
                              • Christoph HartC
                                Christoph Hart @griffinboy
                                last edited by

                                @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.

                                griffinboyG 1 Reply Last reply Reply Quote 0
                                • griffinboyG
                                  griffinboy @Christoph Hart
                                  last edited by

                                  @Christoph-Hart

                                  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?

                                  Christoph HartC 1 Reply Last reply Reply Quote 0
                                  • Christoph HartC
                                    Christoph Hart @griffinboy
                                    last edited by

                                    @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).

                                    griffinboyG 2 Replies Last reply Reply Quote 1
                                    • griffinboyG
                                      griffinboy @Christoph Hart
                                      last edited by

                                      @Christoph-Hart

                                      Hi is there a specific place to do this in the source code? Just want to be sure, sorry for asking!

                                      griffinboyG 1 Reply Last reply Reply Quote 0
                                      • griffinboyG griffinboy has marked this topic as solved on
                                      • griffinboyG
                                        griffinboy @griffinboy
                                        last edited by griffinboy

                                        @griffinboy

                                        Update*

                                        Adding the preprocessor definition that Christoph mentions in this post

                                        NUM_POLYPHONIC_VOICES=16
                                        

                                        in every available preprocessor box (including the juicer file when building Hise from GitHub, and the project preprocessor boxes) seems to have worked.

                                        Voice limit must be set to a power of 2, or you'll get an error.

                                        1 Reply Last reply Reply Quote 0
                                        • griffinboyG
                                          griffinboy @Christoph Hart
                                          last edited by griffinboy

                                          @Christoph-Hart

                                          Strangely, I seem to have broken this...
                                          My voices are being limited and I can't set a new higher limit. I've tried sticking in

                                          NUM_POLYPHONIC_VOICES=64
                                          

                                          Into every box I set my eyes on (rebuilding new version of hise on new hard drive, sticking this definition everywhere, as well as in all the boxes in the project settings) but to no avail. The limit is still stuck at 8, which is an old limit I set when I made this thread.

                                          Is there some way for me to change this limit?
                                          I find it odd that it carries over even to fresh hise builds,
                                          I'm thinking maybe the projects I created while the old limit was in practice, have been infected?

                                          Or is there a place in the source that I need to set this up?

                                          griffinboyG ustkU 2 Replies Last reply Reply Quote 0
                                          • griffinboyG griffinboy has marked this topic as unsolved
                                          • griffinboyG
                                            griffinboy @griffinboy
                                            last edited by griffinboy

                                            This post is deleted!
                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            53

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts