HISE Logo Forum
    • Categories
    • Register
    • Login

    Smoother for Snex Parameters

    Scheduled Pinned Locked Moved General Questions
    7 Posts 3 Posters 338 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.
    • orangeO
      orange
      last edited by orange

      Turning knobs is causing some zipper noise, depending on the dsp code in the Snex.

      How can we add a smoother to a parameter inside Snex?

      develop Branch / XCode 13.1
      macOS Monterey / M1 Max

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

        @orange There is one already. You can even adjust the smoothing time :)
        Screenshot from 2022-04-16 11-11-59.png

        Dan Korneff - Producer / Mixer / Audio Nerd

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

          @dustbro you might need to add a fix32 block around it or you still might hear the zipper noises from the once-per-buffer update of the smoother.

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

            @Christoph-Hart In my experiments, I actually have to wrap all of my dsp in a sample accurate container. It not only removed unwanted artifacts, but made offline bounces work properly.

            Screenshot from 2022-04-16 11-16-47.png

            Dan Korneff - Producer / Mixer / Audio Nerd

            Christoph HartC 1 Reply Last reply Reply Quote 2
            • Christoph HartC
              Christoph Hart @Dan Korneff
              last edited by

              @dustbro Yeah, that shouldn't be necessary.

              BTW, there's a inbuilt smoothed float type in SNEX, which might be better (from a design perspective it's more elegant to smooth the parameters that you need directly in the algorithm / node so that you don't have to add this construct around it anytime you try to change its parameters:

              template <int NV> struct simple_ramp_test
              {
              	SNEX_NODE(simple_ramp_test);
              	
              	sfloat value = 1.0f;
              	
              	
              	// Initialise the processing specs here
              	void prepare(PrepareSpecs ps)
              	{
              		
              
              		// uses the sample rate from the processing specs
              		  // to create a 100ms ramp.
              		  value.prepare(ps.sampleRate, 100.0);
              	}
              	
              	// Reset the processing pipeline here
              	void reset()
              	{
              		// reset the ramp when this is called
              		value.reset();
              	}
              	
              	// Process the signal here
              	template <typename ProcessDataType> void process(ProcessDataType& data)
              	{
              		for(auto& s: data[0])
              		{
              			s *= value.advance();
              		}
              	}
              	
              	// Process the signal as frame here
              	template <int C> void processFrame(span<float, C>& data)
              	{
              	}
              	
              	// Process the MIDI events here
              	void handleHiseEvent(HiseEvent& e)
              	{
              		
              	}
              	
              	// Use this function to setup the external data
              	void setExternalData(const ExternalData& d, int index)
              	{
              		
              	}
              	
              	// Set the parameters here
              	template <int P> void setParameter(double v)
              	{
              		// set the ramp target in the parameter callback
              		value.set((float)v);
              	}
              };
              

              Example use:

              HiseSnippet 1082.3ocwW0saaaCElxILa1ocnsXO.9xTfr.6tttArKZichGL1RpPUVPuyfghNlvTjBTTI1aX2uGq8H02fsyQTNRJwHnwHayWj3ye77wyuzgVCWjkYrjf1msLUPBdBMZo1Ma3LlTSFeDI3qnmvxbBaWOqAKSYYYhXRPvV+DxHn81jhOe5sCXJllKpXQHmajbwuHSjtJtgu6mkJ0HVr3LYRMse86FyM5gFkIGvyVzdjTFeN6RwoLTsVTRvNGGKcFaji4DYfNCLwKilYtV60+bYl7Bk.I5ShfCxylLblTEGt5tlQHAaGVcy2xey+Z5IxX4M7qh.OqPP2JKpGCBZcePp+C.RA0fz1dH8bZD2JScURP7rKcrFRHSYPntNT75RB9K5PCnf1cPBatXjEHtwf8dSud62E9yK+wo4ZtSZzcM5SMNw6068xN+dm1c9iNcusnoSWqLzMViRIrqULlcs2mg6oyStPX2u6ULUt3FEgqeyX5NedwTt+VWSQidrV5depnjdjQEiwJ762MCPJCav290wGwbLLoTxCzKUXcRDNAGItBpp8on1ziDYyclTnt9N4OnxwDmqXtlkSXeSo.HdzHGhIJclzsrde0CnFq28Vi84BwmSCkN9r0iwVqAiPj5eCLV1Y9T5wSmJ3tJ.tMczG2z1vdO31vNksgfOQm+jRxti9X+01.9mzph8TqHkYEmYBUrk6kwRRUhO.Xb+tWnL74QxeSb2NjTODFfZrGeFSqEprMoQZmGogSjOXxcR8kmvbV4BR.8z7jHXLMWLrDc.ufVXOjmtGRi0EQBcbAweCeJE1GoCJE1ekvZsemJbWaryKRGkeGRF9XeVQPdxzE8IGpTlqGZRRkkUoPNnfWnQsLclQK4HKuFqP5gIlbvIkvMn0olXH.PGw3PfZYHyMCq+wYIPwlvd.+lhtF9tddGOhUqs72ZvkI3UoXo0V0Fd3quPJn6ok+TGmcNJkyTjyw7G1iQvyrXQUI9PUoTVbLoAR6PSf+e.x+AfnV0QDIjYgErvBBO7VQAUOmH0kHppQ+D1haw6SuMxIRwJ455EMWbsGp00DuFeA0e.24XH0tq6RyzhESzHmF23mA4Fq3fJoOZYh1zgJ3jFGuBYuflIw90IPDIcBzA4JNOfyhx0CzyXP+CFDiTxXgMDdvBRcXdrzLR5EA+2GbIGIyRgw.CxgwY1+OB86Rq7w8F9eJMwnMuBe3mvzLA7BeBnt7GkRu5teGZpfMuoe2062BAO.GtcCGVsR6Ll8Rgyu1udJM31IoawAKVzwhEqFacLL4MFdUQg4qFk03d0fXfwLOgULaaydkw+EShSXbqYB2ubACAeYAGnARW7T71vuI.n61mbkuHhR6cPORB7L4IbNtd9afGXsdad0FXy2tA175MvluaCr4MafMe+FXyObu1f+BkCyclD+hPfQ3w9Jxfi03LphVEx+DNNOO.
              

              (you might have to manually create a SNEX node file called simple_ramp_test and paste the code above

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

                @Christoph-Hart I'll try to make a test example to see if I can pinpoint the issue. I was getting Buffer crashes without the frame container.

                Dan Korneff - Producer / Mixer / Audio Nerd

                orangeO 1 Reply Last reply Reply Quote 1
                • orangeO
                  orange @Dan Korneff
                  last edited by orange

                  @Christoph-Hart & @dustbro Thank you for the tip guys.

                  @dustbro said in Smoother for Snex Parameters:

                  I'll try to make a test example to see if I can pinpoint the issue. I was getting Buffer crashes without the frame container.

                  Does the node requires fast calculations? I think Frame nodes are especially for fast operations (like detailed, more accurate signal analyzing...etc.) and maybe there is some overload.

                  develop Branch / XCode 13.1
                  macOS Monterey / M1 Max

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

                  16

                  Online

                  1.8k

                  Users

                  12.1k

                  Topics

                  104.8k

                  Posts