HISE Logo Forum
    • Categories
    • Register
    • Login

    BUG? Issue with ScriptNode smoothing

    Scheduled Pinned Locked Moved Solved ScriptNode
    15 Posts 4 Posters 815 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.
    • griffinboyG
      griffinboy
      last edited by griffinboy

      bf70d729-6891-48f2-8af2-b2a83bca2e22-image.png

      I am applying smoothing to this signal.
      As you can see, the signal going into the smoother is level in the centre, but post smoothing there is a massive dip.

      This dip occurs every few seconds. It always dips to zero.
      It's a little erratic, sometimes the signal has no issue for a few seconds, but the dip always happens every few seconds, sometimes multiple times in a row.

      The only questionable thing that I have done is increase the 'smoothing time' to 8000.
      But I wouldn't have thought that to be an issue.

      This is a script for a randomised LFO.
      I am taking a slowed down noise oscillator and putting it into sample and hold (of which I have also extended the range). This is then feeding directly into the script that you are seeing here.
      The entire script resides in a MODCHAIN.

      griffinboyG 2 Replies Last reply Reply Quote 0
      • griffinboyG
        griffinboy @griffinboy
        last edited by

        @griffinboy

        Some extra info.

        It seems that the 'dip' only occurs when the sample and hold takes a new sample.
        It aligns with the level change.
        It doesn't happen on every change though.

        1 Reply Last reply Reply Quote 0
        • griffinboyG
          griffinboy @griffinboy
          last edited by griffinboy

          @griffinboy

          (Edit: This issue is still not resolved, disregard what I say in this post)

          I fixed the issue it seems. But I don't understand why it works 😆
          I'll leave this thread open in case someone wants to explain it to me,
          but it seems that smoothing the signal by 1ms before doing the long smoothing fixes the issue,

          04238df8-8439-4d61-94f9-86ec5ddc66e2-image.png

          I've seen people use the 1ms smoothing before, is this to account for some kind of error that happens?

          griffinboyG 1 Reply Last reply Reply Quote 0
          • griffinboyG
            griffinboy @griffinboy
            last edited by

            @griffinboy

            Nevermind! It's not fixed, my bad,

            822ddaa8-13b2-40ce-9701-e4fe3b9ae24d-image.png

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

              @griffinboy looks like a bug. Can you upload a minimal snippet that shows this behaviour?

              griffinboyG 2 Replies Last reply Reply Quote 1
              • griffinboyG
                griffinboy @Christoph Hart
                last edited by griffinboy

                @Christoph-Hart
                Sure thing,
                I'll write my own snex smoother if it takes a while to find the source of the issue : )
                One sec, I'll send the snippet.

                Upon opening the project I now have this error message. I shall recreate the project

                b54f4637-3994-4157-a6f1-161b53dbc83d-image.png

                1 Reply Last reply Reply Quote 0
                • griffinboyG
                  griffinboy @Christoph Hart
                  last edited by griffinboy

                  @Christoph-Hart

                  Here you go! Many thanks.

                  HiseSnippet 1781.3oc2Y0raabCDdWYQ4XEkll17.rHmT.bUzp333ffB+irchPicDhTLxMClcorHzJxsborkRQA5g9RjCEnuF8TO1S4TeB5aPN0qsCWtR6t5GaIEmdnJ.IhbFNbFNeeCGpTWvcHAAbgg4ZMG3SLLKfZLfIaWsMlxLpsOLO5f93t9dDi8F3iCBHtFllq7LkXy0xZD94iauG1CybHQSsye8ted6S3TGxKncoxXEquy2Q87ND6RZR6Rhmeicp4vYU4d7dfqrBprgO1oC9LxwXkZYPFl4NvkJ4hFRrjDXXlcOt6fFs4Wvz5eBMf9VvIgA1FM.Com9PtmqxiUyZTsM0ys9vPNv.rR83CfUzG.2EcD0kNZ93ChuLTfU7JRddXlIs6sRJ2yNo6UNg6MEWxLgKkU6R2A0vQP8kwRT9yMQ0XRhnE1IcpQqqg4eipxAEXxRcwcHGJfAiVPwMKWdcK3ut+SymGN4CjVmiEV5kd3ars9VqPXPoyHxCZ0h3HKdOsPKP58t+Sa0i4HoblEmcLWRdIq38y+C4WK+Ol2ZbQsZMUYJmSv87HhoJVgODW1BKx508sDw5fi60iLRQ3PKcl.M6LQRfhi9rJghbVMFU9ReBaVvGinCX3aut19XIVk9hlCzymHjTkKXtO4bfKnSlqg1mDzQx8A1vDYZ.iwc64gkoAdJ1Vj.3LHU1VkRYAT4fjrwwQiYmOz3kSVlW28Nn5ToS6o6uYlh+BmZ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jZdoj5c6I4PgF8iCRSpSDHS6FyDhWLF803Ml4lWR0FyfTkNiq0yXVoiGF94O2NQ5PwIlGZUxLiRgJUdxSJuwi1rRkGtwVOdqGE8KJDiPhIcUB6ELUZ5ZnTkZmrdkBReMegdN30xRxrM5bdGT813.xr6iYtrRtvGtOtqLiKwtMR+bF3kPsgGSlFx+UnV8KkV9BTzISp8blT+bSR8+31SP8ewG1YRpOTNXlT+0PUUOIXh6j7+icRF+4P9Dbmzg8M0L8PAKP7l8Ja9YQKAjIpDf9sUG.OOzEdte3xG9dqjGqFodnQPWNW1d7KRtsN1FI75Iel4xymSoT9N+934ye88u+2lLeZ8ge4CaqApMB8Y3ArIudN1bFKrOrvWm7En8IsvP2NypUwTc2pvO1+OAYkdvk0LQATsfSTRcheXSxZ2KqA1iy6zEG96Irb+rm+W7qezE6H3mF0plJ3tQ3Lvs+rv+GEfdqTisrMNebrSWpK8TGmzlZhEVYYW3CW1EtwxtvGsrKbykcgOdYW3VW8BU+mvD0MhpyWfEV+.Mcwb36S.drw+BvGuIUC
                  
                  Christoph HartC 1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart @griffinboy
                    last edited by

                    Lol after 20 minutes of debugging and suspecting some weird floating point precision issues in the coefficients I realized that there's no bug at all :)

                    The problem is that you're creating a signal with the oscillator which uses the full signal range from -1 to 1. The peak node will use the absolute value of the signal (like its name says, it searches for peaks). However the signal is still going from positive to negative which will cause the smoother to make this big jumps (you can't really see this in the peak node, but if you use an oscilloscope node it should become clear:

                    Unbenannt.PNG

                    If you fold the oscillator output to the positive axis, you get the graph from the peak with the values seemingly coming from zero, but they just cross the y axis in the original signal.

                    Long story short: Put this after the oscillator to map it into the 0...1 range.

                    If anyone has an idea how to improve the UX here (if even I miss that concept sometimes it should be a big red flag that it's not super obvious) let me know.

                    A griffinboyG 2 Replies Last reply Reply Quote 1
                    • A
                      aaronventure @Christoph Hart
                      last edited by

                      @Christoph-Hart I think a node is missing that will output the raw signal with a cable. Like pmaUnscaled.

                      I find myself relying on pma and pma unscaled even for simple operations because the peak normalizes everything so if I then again want to deal with non-normalized values, I have to reconvert.

                      I know that this means scriptnode is slowly turning into unreal blueprint or max msp with freely assignable endpoints but it seems to be a recurring point of frustration. My 2c anyway.

                      1 Reply Last reply Reply Quote 1
                      • griffinboyG
                        griffinboy @Christoph Hart
                        last edited by

                        @Christoph-Hart
                        Doh!
                        Thank you, apologies for wasting your time!
                        This was definitely an oversight on my part, I am very new to audio programming and am feeling my way through it blind!
                        Thank you for this wonderful program!

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

                          @griffinboy No worries, at least you found a weak spot in the UX (the only one lol) that we can now address.

                          I think a node is missing that will output the raw signal with a cable

                          I never found myself the need for that but I can see the point. How should we call it? core.peak_unscaled?

                          griffinboyG 1 Reply Last reply Reply Quote 2
                          • griffinboyG
                            griffinboy @Christoph Hart
                            last edited by

                            @Christoph-Hart
                            Sounds good to me!

                            If only I'd used an Oscilloscope instead of the peak meter xD

                            Christoph HartC griffinboyG 2 Replies Last reply Reply Quote 0
                            • Christoph HartC
                              Christoph Hart @griffinboy
                              last edited by

                              Alright, I've added the peak_unscaled node and updated the docs to highlight their differences:

                              https://docs.hise.audio/scriptnode/list/core/peak.html
                              https://docs.hise.dev/scriptnode/list/core/peak_unscaled.html

                              The only thing I'm unsure of is whether I should now clip the output of the peak node to be in 0...1. This would make it more consistent but possibly break a few existing DSP networks which rely on the current behaviour of going beyond the normalized bounds.

                              d.healeyD 1 Reply Last reply Reply Quote 3
                              • d.healeyD
                                d.healey @Christoph Hart
                                last edited by

                                @Christoph-Hart Preprocessor definition perhaps?

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

                                1 Reply Last reply Reply Quote 0
                                • griffinboyG
                                  griffinboy @griffinboy
                                  last edited by griffinboy


                                  1 Reply Last reply Reply Quote 0
                                  • griffinboyG griffinboy marked this topic as a question on
                                  • griffinboyG griffinboy has marked this topic as solved on
                                  • First post
                                    Last post

                                  18

                                  Online

                                  1.7k

                                  Users

                                  11.9k

                                  Topics

                                  103.6k

                                  Posts