HISE Logo Forum
    • Categories
    • Register
    • Login

    Scripnode 101

    Scheduled Pinned Locked Moved General Questions
    157 Posts 13 Posters 14.4k 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.
    • Dan KorneffD
      Dan Korneff @ustk
      last edited by Dan Korneff

      @ustk The framex_block gets it's stream from processFrame. If you leave that blank, the output will be unprocessed.

      Here's the same example using an oscilloscope to see the results of placing the SNEX node into the frame block. I'm inverting one channel for easier viewing.

      INVERT.gif

      Dan Korneff - Producer / Mixer / Audio Nerd

      ustkU 2 Replies Last reply Reply Quote 1
      • ustkU
        ustk @Dan Korneff
        last edited by

        @dustbro Oh yes of course! My bad!!!

        Can't help pressing F5 in the forum...

        1 Reply Last reply Reply Quote 0
        • ustkU
          ustk @Dan Korneff
          last edited by

          @dustbro Then you might not need a frame2_block, or?

          Can't help pressing F5 in the forum...

          Dan KorneffD 1 Reply Last reply Reply Quote 0
          • Dan KorneffD
            Dan Korneff @ustk
            last edited by

            @ustk Maybe, but without the frame2_block my DSP is glitchy and distorted.

            Dan Korneff - Producer / Mixer / Audio Nerd

            ustkU 2 Replies Last reply Reply Quote 0
            • ustkU
              ustk @Dan Korneff
              last edited by

              @dustbro That kinda makes sense. I'm trying to get the channels in the processFrame with no luck. in fact it works for the left channel but not for the right one. I'm investigating the use of span with no more luck since yesterday...

              Can't help pressing F5 in the forum...

              1 Reply Last reply Reply Quote 1
              • ustkU
                ustk @Dan Korneff
                last edited by ustk

                @dustbro Got something! Try this:

                	float getLeftSample(float input)
                	{
                		return input;
                	}
                	
                	float getRightSample(float input)
                	{
                		return input * 0.05f;
                	}
                	
                	// Process the signal here
                	template <typename ProcessDataType> void process(ProcessDataType& data)
                	{
                	}
                	
                	// Process the signal as frame here
                	template <int C> void processFrame(span<float, C>& data)
                	{
                		for (int i = 0; i<2; i++)
                		{
                			auto& s = data[i];
                			
                			s = i == 0 ? getLeftSample(s) : getRightSample(s);
                		}
                	}
                

                Can't help pressing F5 in the forum...

                Dan KorneffD 1 Reply Last reply Reply Quote 1
                • Dan KorneffD
                  Dan Korneff @ustk
                  last edited by Dan Korneff

                  @ustk Nice one! That's pretty close. Something about it is making the DSP process differently on each channel.
                  process.png

                  Trying my code again with just the process block seems to work now with:

                  	auto frame = data.toFrameData();
                  

                  Since the data is being converted to frame data, I no longer need to use a frame?_block.

                  I can now pop it into a fix_block without glitches :)
                  processbuffer.png

                  Dan Korneff - Producer / Mixer / Audio Nerd

                  ustkU 1 Reply Last reply Reply Quote 1
                  • ustkU
                    ustk @Dan Korneff
                    last edited by

                    @dustbro Glad it works :)
                    But strange the last solution with the processFrame isn't working properly...

                    Can't help pressing F5 in the forum...

                    Dan KorneffD 1 Reply Last reply Reply Quote 0
                    • Dan KorneffD
                      Dan Korneff @ustk
                      last edited by

                      @ustk said in Scripnode 101:

                      strange the last solution with the processFrame isn't working properly

                      agreed

                      Dan Korneff - Producer / Mixer / Audio Nerd

                      1 Reply Last reply Reply Quote 0
                      • Dan KorneffD
                        Dan Korneff
                        last edited by

                        @Christoph-Hart Are we able to embed compiled SNEX nodes within other wrapped DSP networks?
                        When I try to compile DPS that contains a compiled SNEX node within it, I get the following errors:

                        \dspnetworks\binaries\source\main.cpp(18): error C2065: 'Test_Node': undeclared identifier 
                        \dspnetworks\binaries\source\main.cpp(18): error C2672: 'scriptnode::dll::StaticLibraryHostFactory::registerNode': no matching overloaded function found
                        
                        \dspnetworks\binaries\source\main.cpp(18): error C2974: 'scriptnode::dll::StaticLibraryHostFactory::registerNode': invalid template argument for 'T', type expected
                        

                        Dan Korneff - Producer / Mixer / Audio Nerd

                        C 1 Reply Last reply Reply Quote 0
                        • C
                          crd @Dan Korneff
                          last edited by

                          @dustbro I get the same errors.

                          1 Reply Last reply Reply Quote 0
                          • Dan KorneffD
                            Dan Korneff @Christoph Hart
                            last edited by

                            @christoph-hart said in Scripnode 101:

                            However I would rather add a dynamic oversample node that exposes the oversampling factor as parameter that can be modulated like any other knob.

                            @Christoph-Hart Just checking to see if this is still on your radar.

                            Dan Korneff - Producer / Mixer / Audio Nerd

                            1 Reply Last reply Reply Quote 1
                            • C
                              crd
                              last edited by crd

                              Has anyone here had any success trying to compile a scriptFX with global mod node in the network? Details about what I am trying to do are here:
                              https://github.com/christophhart/scriptnode_testsuite/issues/5

                              I understand what Christoph is saying but there seems to be no way to disable global nodes from compiling.

                              Also, are there any actual performance gains to be had by compiling in this specific case??

                              Matt_SFM 1 Reply Last reply Reply Quote 0
                              • Matt_SFM
                                Matt_SF @crd
                                last edited by Matt_SF

                                @crd You don' compile just nodes, you compile networks.
                                Regarding your problem, as Christoph suggested, try to create 2 separated scriptFX, the one with the global mod node (which won't be compiled) and the one with the Math.expr (which will be).

                                To enable/disable network compiling, click on this icon :

                                acea0573-b4e9-48da-87ce-df820c9ab438-image.png

                                And simply allow the compilation of the 'math' network.
                                When you'll create the DLL, only this network will be compiled.

                                If you're using Math.expr nodes (and similar) you have to compile the network first before being able to compile your plugin.
                                But - AFAIK - there's no (real) performance gain to be had by compiling 'classic' networks, except maybe for real complicated ones.

                                Develop branch
                                Win10 & VS17 / Ventura & Xcode 14. 3

                                C 1 Reply Last reply Reply Quote 0
                                • C
                                  crd @Matt_SF
                                  last edited by

                                  @Matt_SF Are the two scriptfx just for the purpose of creating the dll? I’m away from my rig st the moment but am sure the edit properties window is not giving the option to disallow compiling global mod nodes in a network.

                                  The network isn’t complicated but does involve many nodes so maybe there are no performance gains to be had by doing this anyways…

                                  Matt_SFM 1 Reply Last reply Reply Quote 0
                                  • Matt_SFM
                                    Matt_SF @crd
                                    last edited by Matt_SF

                                    @crd no no, you must compile any network containing Math nodes in a dll in order to be able to compile your plugin. Otherwise HISE will throw an error while creating your plugin.

                                    But since HISE can't compile global mod nodes into a dll, you have to split your network in 2 separated networks, disallow compilation of the network containing the global mod node and allow compilation of the one containing the math node.
                                    (When we speak of 'networks' it means 'scriptFX' because 1 scriptFX = 1 network.)

                                    So the math network will be embedded into the dll and the other will not. But when compiling your plugin, HISE will embed the dll and the other network directly into the plugin.

                                    Develop branch
                                    Win10 & VS17 / Ventura & Xcode 14. 3

                                    C 1 Reply Last reply Reply Quote 0
                                    • C
                                      crd @Matt_SF
                                      last edited by

                                      @Matt_SF How does that help in the case of a network that needs a global mod node to interact with a math.expr node?

                                      C 1 Reply Last reply Reply Quote 0
                                      • C
                                        crd @crd
                                        last edited by

                                        This is what I see when I edit the properties of a global node:Screen Shot 2022-04-05 at 8.44.30 PM.png

                                        It makes since to me that I would need to disallow these nodes from compiling into dll's but I do not see a way to do that. (but once again, I might just be spinning wheels here if there are no actual performance gains to be had by compiling these types of networks.)

                                        ulrikU 1 Reply Last reply Reply Quote 0
                                        • ulrikU
                                          ulrik @crd
                                          last edited by

                                          @crd I'm not sure this is what you're looking for but, to be able to enable/disable compiling of script FX you can't have anything in the module area selected because then you will see the properties of the selected node, if you press esc nothing will be selected and you will be able to enable/disable the compilation.

                                          nodes.gif

                                          Hise Develop branch
                                          MacOs 15.3.1, Xcode 16.2
                                          http://musikboden.se

                                          C 1 Reply Last reply Reply Quote 1
                                          • C
                                            crd @ulrik
                                            last edited by

                                            @ulrik Thanks - I did not notice that!

                                            Still, it seems impossible to compile a network with global mod nodes which means you can never use a global mod node and math.expr in an exported plugin...

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

                                            51

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            102.1k

                                            Posts