Forum
    • Categories
    • Register
    • Login

    Compiled Network Fixed Channel Count?

    Scheduled Pinned Locked Moved ScriptNode
    scriptnodechannelcompilednetwork
    17 Posts 4 Posters 153 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.
    • Christoph HartC
      Christoph Hart @David Healey
      last edited by

      @David-Healey but with rhapsody you cannot pull in compiled effects anyway unless you embed them in the player binary - that's the one hard restriction that comes with the full player expansion system.

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @Christoph Hart
        last edited by

        @Christoph-Hart My plan is to embed them in the binary since I need them in almost every project

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

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

          @David-Healey ah ok. BTW are you sure you need to compile them? If you're just using a simple multi channel DSP network with multiple gain modules in a container.multi container, then the DSP overhead is negligible - definitely lower than the old scripting approach.

          David HealeyD 2 Replies Last reply Reply Quote 2
          • David HealeyD
            David Healey @Christoph Hart
            last edited by

            @Christoph-Hart said in Compiled Network Fixed Channel Count?:

            definitely lower than the old scripting approach.

            In that case no I probably don't need to compile them, so that solves it :)

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            1 Reply Last reply Reply Quote 0
            • David HealeyD
              David Healey @Christoph Hart
              last edited by David Healey

              @Christoph-Hart Hmm I just realised I have the same problem, when I bring in my dsp xml that's setup for 16 channels into a project with only 6 it reds everything out and tells me there aren't enough channels.

              So I remove the extra ones but then I'm left with another file to maintain in my framework so it doesn't really make the situation any easier. If it was just one effect it wouldn't be an issue but this seems like it will be the same for any scriptnode effect I want to use with Rhapsody.

              Or will it still work but just show the angry red box?

              Free HISE Bootcamp Full Course for beginners.
              YouTube Channel - Public HISE tutorials
              My Patreon - HISE tutorials

              Christoph HartC 1 Reply Last reply Reply Quote 0
              • ustkU ustk referenced this topic
              • Christoph HartC
                Christoph Hart @David Healey
                last edited by Christoph Hart

                @David-Healey nope, won't work.

                What if you actually create the network dynamically?

                // define this somewhere in your interface script
                global NUM_CHANNELS = 8;
                
                // Put this code in a Script FX that is set to use the number of channels
                const var dsp = Engine.createDspNetwork("mixer");
                
                const var mixer = dsp.get("mixer");
                const var multi = dsp.createAndAdd("container.multi", "multi", "mixer");
                
                for(i = 0; i < (NUM_CHANNELS/2); i++)
                {
                	// create a gain module
                	var g = dsp.createAndAdd("core.gain", "gain" + (i+1), multi);
                	
                	// fetch the gain parameter
                	var dst = g.getOrCreateParameter("Gain");
                	
                	// create a root parameter
                	var src = mixer.getOrCreateParameter({
                	    "ID": "Gain" + (i+1),
                	    "mode": "Decibel"
                	});
                	
                	// connect the two
                	dst.addConnectionFrom({ID: "mixer", "ParameterId": "Gain" + (i+1)});
                	
                	// copy the range to the source parameter
                	// (make the warning icon disappear...)
                	src.setRangeFromObject(dst.getRangeObject());
                }
                
                David HealeyD 1 Reply Last reply Reply Quote 0
                • David HealeyD
                  David Healey @Christoph Hart
                  last edited by David Healey

                  @Christoph-Hart Ahh that's an idea, I haven't explored that side of scripting. I could pull the number of channels from the master container's routing matrix. No I can't, no access to Synth within the script FX :(

                  Free HISE Bootcamp Full Course for beginners.
                  YouTube Channel - Public HISE tutorials
                  My Patreon - HISE tutorials

                  ustkU 1 Reply Last reply Reply Quote 0
                  • ustkU
                    ustk @David Healey
                    last edited by

                    @David-Healey Can you do it from the UI script?

                    const var ScriptFX_RM = Synth.getRoutingMatrix("ScriptFX"); // or master chain...
                    
                    global NUM_CHANNELS = ScriptFX_RM.getNumSourceChannels();
                    

                    Hise made me an F5 dude, any other app just suffers...

                    David HealeyD 1 Reply Last reply Reply Quote 1
                    • David HealeyD
                      David Healey @ustk
                      last edited by

                      @ustk I found a better solution to get the channel count
                      https://github.com/christophhart/HISE/pull/957

                      Free HISE Bootcamp Full Course for beginners.
                      YouTube Channel - Public HISE tutorials
                      My Patreon - HISE tutorials

                      1 Reply Last reply Reply Quote 1
                      • David HealeyD
                        David Healey
                        last edited by

                        My network contains a lot more than just some gains so recreating it all via scripting is a pain and means I don't get to work with the nice GUI. Is there a simple build network from JSON type thing?

                        Another option I thought of is I can park all the chains in the multi as unused nodes, then in the script use this to add them for just the number of channels:

                        const dsp = Engine.createDspNetwork("SimpleGain");
                        const numChannels = dsp.getNumChannels();
                        const multi = dsp.get("multi");
                        const numPairs = numChannels / 2;
                           
                        for (i = 0; i < numPairs; i++)
                        	dsp.get("chain" + i).setParent(multi, i);
                        

                        This works for my multi channel simple gain because each channel has its own chain, but I don't think it would be a good general solution for all networks.

                        Free HISE Bootcamp Full Course for beginners.
                        YouTube Channel - Public HISE tutorials
                        My Patreon - HISE tutorials

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        24

                        Online

                        2.3k

                        Users

                        13.7k

                        Topics

                        119.2k

                        Posts