HISE Logo Forum
    • Categories
    • Register
    • Login

    Scripnode 101

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

      @dustbro No but you can use the prepare function to store it to a member variable:

      void prepare(PrepareSpecs ps)
      {
          sr = ps.sampleRate;
      }
      
      
      double sr = 0.0;
      
      Dan KorneffD 1 Reply Last reply Reply Quote 1
      • Dan KorneffD
        Dan Korneff @Christoph Hart
        last edited by

        @christoph-hart Thank you!

        Dan Korneff - Producer / Mixer / Audio Nerd

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

          Okay some beginner scriptnode questions for you all.

          What's with the beaker glass?Screen Shot 2022-01-13 at 9.52.35 AM.png

          What is the best way to access scriptnode parameters? Create a midi script above the scriptnodeFX like this? If I have logic for callbacks having to do with the scriptnodeFX is the midi script controller script where I should put it?

          HiseSnippet 1431.3oc6X0saaTDEdW6LkF2RoEUgf6VEwENsgTanTPpTkebrqrZchUV2.2UMY2w1ixryrL6XmXgxi.OE7hvK.R7HviPeCfyL6tdWm5X4ZVJbA9BKOyYNm467+YbWoviDEIjV1q2aRHwx91H2Ib0vFCwTtU6CrruEhQvRNkOnt09SBwQQDeKa6xOWe.60Wyx74M6rOlg4djrsrrNQP8HujFPUY61c2WPYrVXeROZPtS+3ca6I3MDLwH.LkQ0rBwdmgGPNDqOVIjk8MZ5SUBoqBqHQV1qsuveh6Pw473yeBMhdJinWT2xEDT71sDLeMh06Z0XHk42MUoirrrQcyLAkiMA2G0g5Smtelo3tFBNYbj2dXWZV3UdF3UOO7pkCdyARkxAo0hgz8PtdRZnJiRrqoMWQj8wfYOOThOqk8uhZHfCvUaGfOizRBKlxP0mTq1VNvWa9z9i3dJpf6H3GJTji3U2rxOUY8JWVw4pj52etzzWiTvXD4b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X555v5YHZF2iSLdxYtfohr24hkWj0WBQ9AndCkDRwJzafZoMdEsLoiKXbhflDWTz1SWxX3YBErPaRGLTUzFzCo7B2f1qn08ahZxJ.KZ16mhKoqWAESKouhaiZGchlpGlkJFnNy9BwYAXSYs+1+yJq9r9qd20iEiTT9fNXn0h9gdv6+cgzRuzZpQokSSVWKsZmKg6aV7mvmDh00qsSHVOk36k6H.6IEu1Ktsl1+cSyNfdyM+Cqqi5nW6L8gzwwGAvvwu1ySah+BXV64yyWtB77Uq.OOdE34qWAddxJvy2rB77sKjG86R1ajRDD2MG1naSS9iscSNFhdMQ5V+kZam2d
          

          Also if possible we should rename this thread "Scriptnode 101" rather than Scripnode 101 so it comes up in a search.

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

            No tips on how to best access script node parameter's from midi processors?

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

              Okay more basic scriptnode questions, what is the difference between creating a embedded dsp network and creating a new DSP network file? (The 3d square vs. the page with a corner turned graphic on the scriptnode front page.)

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

                @crd The embedded one is part of your project XML, the network one is a separate XML that can be compiled to C++ or shared with other projects.

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

                C 1 Reply Last reply Reply Quote 1
                • C
                  crd @d.healey
                  last edited by crd

                  @d-healey What would the advantage of ever using the embed one? Is that for smaller scripts?

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

                    @crd Useful for prototyping and for small scripts that you don't plan to use in other project and that don't need compiling.

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

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

                      Has anyone successfully exported a plugin with a script node network/dll?

                      I was able to export for a while without compiling a dll but now I am getting an error:Screen Shot 2022-01-28 at 5.14.25 PM.png

                      and the script node workbench crashes whenever I try to compile wrapped dsp nodes into a dll.

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

                        @crd I'm successfully exporting scriptnode plugins with compiled dll.

                        Dan Korneff - Producer / Mixer / Audio Nerd

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

                          What's the best way to access L/R inputs to process them separately in SNEX?
                          Can we use arrays in SNEX?

                          @Christoph-Hart is there an example showing how to use block?

                          block - a wrapper around a preallocated buffer of float numbers
                          

                          When I try to initialize an index of a block with a number, I get an error saying statement cant be parsed.

                          Dan Korneff - Producer / Mixer / Audio Nerd

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

                            @dustbro got it to work for the left channel only, it might be obvious why data[1] isn't working but I can't find...

                            	// Process the signal here
                            	template <typename ProcessDataType> void process(ProcessDataType& data)
                            	{
                            		for (auto& s: data[0])
                            			s *= 0.5f;
                            	}
                            

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

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

                              @dustbro oh I finally found a solution

                              	// Process the signal here
                              	template <typename ProcessDataType> void process(ProcessDataType& data)
                              	{
                              		auto frame = data.toFrameData();
                              		    
                              		while(frame.next())
                              		{
                              			frame[0] *= levelLeft;
                              			frame[1] *= levelRight;
                              		}
                              	}
                              

                              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

                                @ustk Thanks! What about the function to process the input?

                                For instance, the SNEX shaper has:

                                float getSample(float input)
                                {
                                       return input;
                                }
                                

                                Anything other than float input returns a parse error.

                                Dan Korneff - Producer / Mixer / Audio Nerd

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

                                  @Christoph-Hart is there a simple example that shows how to do this with an SNEX node?

                                  Dan Korneff - Producer / Mixer / Audio Nerd

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

                                    @dustbro getSample is just a way to make an external function from the process one, nothing prevents you to remove it and make your algorithm directly in the process function, or make one getLeftSample and one getRightSample like below:

                                    	float getLeftSample(float input)
                                    	{
                                    		return Math.tanh(input);
                                    	}
                                    	
                                    	float getRightSample(float input)
                                    	{
                                    		return Math.tanh(input);
                                    	}
                                    	
                                    	template <typename T> void process(T& data)
                                    	{
                                    		auto frame = data.toFrameData();
                                    		    
                                    		while(frame.next())
                                    		{
                                    			frame[0] = getLeftSample(frame[0]);
                                    			frame[1] = getRightSample(frame[1]);
                                    		}
                                    	}
                                    	
                                    

                                    The only thing is that this way of using process to separate the channels actually transforms it in a frame processing. So if you want block processing of separated channels, I don't know the trick.

                                    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

                                      @ustk said in Scripnode 101:

                                      if you want block processing of separated channels, I don't know the trick

                                      Thanks again for this!
                                      That's what I was doing, but got unexpected results. Now that I look a little closer, it appears that placing an SNEX node into a frame2_block returns a mono signal.

                                      Dan Korneff - Producer / Mixer / Audio Nerd

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

                                        @dustbro Strange indeed...

                                        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 Looks like it's my code in processFrame. Lemme see if I can figure out the magic potion.

                                          Dan Korneff - Producer / Mixer / Audio Nerd

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

                                            @dustbro That's what I'm doing, as you can see the output is stereo:

                                            Screenshot 2022-02-01 at 13.12.55.png

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

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

                                            22

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.6k

                                            Posts