HISE Logo Forum
    • Categories
    • Register
    • Login

    How to build SNEX Playground?

    Scheduled Pinned Locked Moved General Questions
    38 Posts 4 Posters 1.7k 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.
    • ustkU
      ustk @Casmat
      last edited by

      @Casmat The implementation of your function looks like this:

      	float getSample(float s)
      	{
      		//return your stuff here
      	}
      	
      	
      	template <typename ProcessDataType> void process(ProcessDataType& data)
      	{
      		auto f = data.toFrameData();
      		
      		while (f.next())
      		{
      			for (auto& s: f)
      				s = getSample(s);
      		}
      	}
      	
      	
      	template <int C> void processFrame(span<float, C>& data)
      	{
      		for(auto& s: data)
      			s = getSample(s);
      	}
      

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

      CasmatC 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @Casmat
        last edited by ustk

        @Casmat And as I wrote above, the constants should be float if you don't want to get casting errors

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

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

          @Casmat And one other thing, have you tried to plot your formula to see what you get out from it? Because it's going over the -1/+1 gain factor so you either need to scale the output or rework the formula...

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

          CasmatC 1 Reply Last reply Reply Quote 0
          • CasmatC
            Casmat @ustk
            last edited by Casmat

            @ustk thanks for the info! I don’t think ive done anything with the formula, i found it on music dsp and I was clueless from the start on how to get it to be a simple saturator, is the gain factor related to the gain matching on a saturator?

            Edit: so the gain factor is x?

            i make music

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

              @Casmat So I imagine a is your gain, right?
              What do you get as a result? Is it at least sounding "something"?
              Does the level need to be tamed a bit perhaps?

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

              CasmatC 1 Reply Last reply Reply Quote 0
              • CasmatC
                Casmat @ustk
                last edited by

                @ustk as far as I know when looking at it, I thought that x was the input signal and a was the saturation amount

                i make music

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

                  @Casmat said in How to build SNEX Playground?:

                  Edit: so the gain factor is x?

                  f(x) means the it's the output, so a should be the gain

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

                  CasmatC 1 Reply Last reply Reply Quote 0
                  • CasmatC
                    Casmat @ustk
                    last edited by Casmat

                    @ustk ohh yeah! Polynomials (or maybe not)!

                    i make music

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

                      @Casmat At first, does it look the way you want?

                      ![Screenshot 2023-08-18 at 20.47.17.png](Imgur is temporarily over capacity. Please try again later.)

                      EDIT @Christoph-Hart @Dominik-Mayer Apparently there's still this Imgur over capacity issue that prevents us to see images...

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

                      CasmatC 1 Reply Last reply Reply Quote 0
                      • CasmatC
                        Casmat @ustk
                        last edited by Casmat

                        @ustk why was there an float s in the arguments? And I should be declaring a as a variable, right? I put the code you gave

                        if (x < a)
                           out = x;
                        else if (x > a)
                           out = a + (x - a) / (1.0 + Math.sqr((x - a) / (1.0 - a)));
                        else if (x > 1)
                           out = (a + 1.0) / 2.0;
                        

                        In the get sample func?

                        Edit: didn’t see your post yet, the img seems broken

                        i make music

                        Christoph HartC 1 Reply Last reply Reply Quote 0
                        • CasmatC
                          Casmat @ustk
                          last edited by Casmat

                          @ustk try using imgbb.com

                          i make music

                          ustkU 2 Replies Last reply Reply Quote 0
                          • Christoph HartC
                            Christoph Hart @Casmat
                            last edited by

                            @Casmat if imgur is over capacity then there‘s nothing we can do except for stop uploading images :)

                            ustkU 1 Reply Last reply Reply Quote 2
                            • ustkU
                              ustk @Christoph Hart
                              last edited by

                              @Christoph-Hart Yeah I though it was somehow related to the forum... Or use another provider 😛

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

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

                                @Casmat

                                SOS image provider

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

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

                                  @Casmat You definitely need to declare a
                                  At first, make it 0.0
                                  Then add a parameter to control it

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

                                  CasmatC 2 Replies Last reply Reply Quote 0
                                  • CasmatC
                                    Casmat @ustk
                                    last edited by Casmat

                                    @ustk shouldn’t the a be from 0-1? And there were some comments under that music dsp post, do we have to do normalization or am I yapping away at nothing?

                                    i make music

                                    CasmatC 1 Reply Last reply Reply Quote 0
                                    • CasmatC
                                      Casmat @Casmat
                                      last edited by Casmat

                                      @Casmat and as for the image, isn’t that how the saturation should look like

                                      i make music

                                      1 Reply Last reply Reply Quote 0
                                      • CasmatC
                                        Casmat @ustk
                                        last edited by

                                        @ustk hmm, seems like im missing part of the picture, im not really understanding the whole use of the soft saturation function vs other common saturation functions like a tanh function, have you got any resources that can help me learn more about saturation dsp or dsp in general a bit more? I feel like getting a better understanding would help me ease my way into Snex cause I have little clue what all this dsp does. Thanks for your help so far, opened my eyes to the vastness amount of info I’m missing and I’m pretty eager to learn more! After taking some time to research, it may be right to jump back at this, right?

                                        i make music

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

                                          @Casmat A good sounding distortion unit is much more than just the saturation function. It needs clever filtering, oversampling to remove aliasing, etc... Tanh is a good starting point, but you need to understand if you want more or less of the odd or even harmonics, or asymmetric distortion. And this is only the beginning, as a "true analog sounding" algorithm is much more... You might find some literature about this in your fav search engine. The first steps you've made is a good start! Just go for a simpler equation until you know what it does 😉

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

                                          CasmatC 3 Replies Last reply Reply Quote 0
                                          • CasmatC
                                            Casmat @ustk
                                            last edited by

                                            @ustk Thanks! Will definitely take a look!

                                            i make music

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

                                            27

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.7k

                                            Posts