HISE Logo Forum
    • Categories
    • Register
    • Login

    Audio Spike when loading a Neural Network node.

    Scheduled Pinned Locked Moved ScriptNode
    23 Posts 6 Posters 1.1k 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 @tomekslesicki
      last edited by

      @tomekslesicki Alright, thanks I missed that, now I can reproduce it.

      The easiest solution is to just warmup the network whenever the reset call was made - it then just processes a bunch of silent samples and throws away the result. I'm not sure why it creates the spike in the first place and usually the convention of calling reset() just before processing the audio signal should work here too, but this will definitely remove the necessity for high pass filtering the values.

      I can imagine that the amount of samples necessary depends on the network so I made it a dynamic preprocessor constant. Just add

      HISE_NEURAL_NETWORK_WARMUP_TIME=2048
      

      to your ExtraDefinitions field and click save (no need to recompile, HISE will reload that value and use it dynamically. In the compiled plugin it will be a compile time constant).

      Note that there are a few situations where the reset() call can be made in the audio thread - eg. when using it polyphonically and starting a new voice, so if you try to outsmart the system by adding

      HISE_NEURAL_NETWORK_WARMUP_TIME=10000000000
      

      you'll blow up your audio callback.

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

        @Christoph-Hart you might want to consider adding a HPF as well. Many models contain a DC offset and filters are built into the NAM player for this reason.

        Dan Korneff - Producer / Mixer / Audio Nerd

        1 Reply Last reply Reply Quote 1
        • T
          tomekslesicki
          last edited by

          @Christoph-Hart thanks, I'll test this later today! If I'll hard enable it when building HISE, I should be able to test the results while working on the network, right?

          I also agree with @Dan-Korneff , a high switchable high pass to remove the DC offset would be a fantastic addition

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

            @tomekslesicki It's a dynamic preprocessor which will fetch the value from the extra definition field while working in HISE so you don't have to recompile HISE anymore - just change the definition, hit save in the settings dialog and toggle the script fx bypass to hear the change.

            T 1 Reply Last reply Reply Quote 0
            • T
              tomekslesicki @Christoph Hart
              last edited by

              @Christoph-Hart yes, I understand, I thought it would be easier to test in scriptnode if I compiled it with this defined, but I see it's more flexible the other way around, I should stop posting at 4AM! Could you please add a switchable 5hz HPF to filter out the DC offset, too?

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

                @Dan-Korneff can you upload the changes (or make a pull request) with the 5Hz cutoff stuff, then I‘ll merge it.

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

                  @Christoph-Hart 🤟 I make a PR today. Also have a fix for the bypass being ignored.

                  Dan Korneff - Producer / Mixer / Audio Nerd

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

                    @Christoph-Hart https://github.com/christophhart/HISE/pull/787

                    Dan Korneff - Producer / Mixer / Audio Nerd

                    1 Reply Last reply Reply Quote 0
                    • ChazroxC
                      Chazrox
                      last edited by

                      GOAT activity. ☝

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

                        Alright it's merged now, thanks @Dan-Korneff for the contribution! I had to modify the code a little bit to allow the usage of neural networks in compiled effects - the HPF filter setting will be baked into as a compile time constant when you generate the C++ code for the network.

                        I also added a check that throws an error if you try to use a hardcoded network with a neural network (or global cable, same concept) without creating it first in the scripting initialisation - before it just failed silently but now you get an error message in the hardcoded module's interface.

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

                          @Christoph-Hart said in Audio Spike when loading a Neural Network node.:

                          thanks @Dan-Korneff for the contribution!

                          It's nice to feel useful for once 🤣
                          Got a few more enhancements coming soon...

                          Dan Korneff - Producer / Mixer / Audio Nerd

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

                          16

                          Online

                          2.0k

                          Users

                          12.7k

                          Topics

                          110.5k

                          Posts