HISE Logo Forum
    • Categories
    • Register
    • Login

    fix channel resizing in HISE broke my routing

    Scheduled Pinned Locked Moved Solved Bug Reports
    20 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.
    • d.healeyD
      d.healey @orange
      last edited by d.healey

      @orange I'm not using a faust version. Which commit are you using?

      Peek 2023-01-05 13-45.gif

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

      orangeO 1 Reply Last reply Reply Quote 0
      • orangeO
        orange @d.healey
        last edited by orange

        @d-healey said in fix channel resizing in HISE broke my routing:

        @orange I'm not using a faust version. Which commit are you using?

        I built Hise 3 days ago, but I am not sure if after this commit or not.

        I asked Faust because all of my old projects are crashing when Faust is enabled. But they work without Faust without any issues. I can't open my projects!

        develop Branch / XCode 13.1
        macOS Monterey / M1 Max

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

          @orange Please test with the commit I linked to if you have time (813c0a7ddd15242aecc0e85466522b8c8d7ae2be)

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

          orangeO 2 Replies Last reply Reply Quote 0
          • orangeO
            orange @d.healey
            last edited by

            @d-healey Ok I'll test with that commit.

            develop Branch / XCode 13.1
            macOS Monterey / M1 Max

            1 Reply Last reply Reply Quote 1
            • DanHD
              DanH @d.healey
              last edited by

              @d-healey Does the same as you described here :(

              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
              https://dhplugins.com/ | https://dcbreaks.com/
              London, UK

              1 Reply Last reply Reply Quote 1
              • orangeO
                orange @d.healey
                last edited by

                @d-healey Like yours here.

                NoSound.gif

                develop Branch / XCode 13.1
                macOS Monterey / M1 Max

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

                  Thanks for confirming. I just tested further and the send effects have nothing to do with it. I've simplified the snippet

                  HiseSnippet 934.3oc6X80aSbDDe2XuU3.EUpPU8w6AdHHQQ1I7mJ0GHIN1HKHIV4BTdCsr2X6U4tcut2dlZUw2M9HvGE9F.ydmS7Z3havD5ehheHJyL6byucl423wWeiV.YYZCg13vIo.gdMV3DkcT6QbohzaGB8GXYfJ5.ctUpFtc9Px1SR4YYPDgRq8X2onMpSJ979GsMOlqDvLUDxy0RA7TYhzNSa+MehLNtKOBNTl3c56sYOgV0VGqyQDUi0jjxEGwGB6wcGaEFg9cchjVsIzxsPFgVeaczjvQ5WqJO+ykYxWECNgVjP7AUptqNNxgXmVR6Qx3n9GeyyH3Cs+r7Psx7vMY6Jijmn2Oe3LDLyC+7Ack4gWs4fWKe30zCdU.IpGjpWBoavBEFYpclEGdtJqmxBlAbLs6CkxyRnuk0ViGPYuaB+HnqAENwg0dPyl2I.+ys+sA4JgUpUAZ0dZKruZsau5esZiUeypAepoACpzlKLFcbLXpzrqRaVjiqoxSdEXtSvXdbNbxAwq+74T1omS8K4hxas2A0pdJoc+TPcZMBjooJ7+dVuc3VtqPLUGdtTvXkNHP2AFic0kkkFrcfrir5Tru9ypYX2hNJOlamuExwalZ.yAyU2bEGUlzNwmWct0WcVg3MX8kVwnpw3JUfQLS8s.iSYieOqyfAfvNCf0Ycew2Fpme3uxoLT7ZEjJTBLsNOFHldlGHRqsH1vYZ.39iAyXI75+lghr+yMT7R90EM900KC+UYgHUpfiUD7epPN324igfGCHIyk7VDQ6cm+Ds8EVL7GZ3prTc1bO3PHQdnV4xByT9rL7KWg+3.W0zWeaM2Too2+nt3krReB41bSQawVI5bkct1fZKZCnVK4FP0ujr+UtjViiwXnLIMF5nFCw3FCEX7GwUDFvyisGqc9d4c0Jc5HsRJ7KzG.Vib3Pv3i8JuPaYs3ZxyzbyMO.hAteS6s17oXyF2f4IXIyEs9hWXsx50OyJgafi.F7+2gz0tXOjd5O3aWN1D9m3x.6kmDhyFE.FckBhcqdPWwMeqTtoStb3nJpP3C3moFa4joSM15Xi+iDiurk4V+e2k4Ne90rWNK+xE2tnLSnQkwn9WULlZbceOW+SLtgumabB5R3Bi9khxWXgiqckBMXFSU7FpZv10IGzhT7RLP+XMuaSRBxwdoP3JN+BRYq1m0WBe1XI74dKgO2eI74AKgOObI74WWnOtwaaka0IkjUTQ+NEuYGJsihi88EbDxGAq8fmJB
                  

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

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

                    @Christoph-Hart Bump bump, this is a pretty big bug for anyone using more than one stereo out and more than one container.

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

                    Dan KorneffD 1 Reply Last reply Reply Quote 0
                    • Dan KorneffD
                      Dan Korneff @d.healey
                      last edited by Dan Korneff

                      @d-healey

                      the source code changed from:
                      #if FORCE_INPUT_CHANNELS
                      internalBuffer.makeCopyOf(buffer);
                      #endif
                      to:
                      #if FORCE_INPUT_CHANNELS
                      if(internalBuffer.getNumChannels() == buffer.getNumChannels())
                      internalBuffer.makeCopyOf(buffer);
                      #endif
                      Now when I add a 2nd container to the project, I don't get any sound from the output of HISE. I have to disable the 2nd container for it to work again. Do you know why?

                      The code you provided has been modified to check the number of channels in the internalBuffer and in the input buffer before making a copy. 
                      It compares the number of channels in the internalBuffer and the input buffer and only makes a copy if the number of channels are the same.
                      
                      It seems that the issue you are experiencing is caused by the 2nd container having a different number of channels than the internalBuffer. In this case, the script doesn't make a copy of the buffer and the audio engine processes the buffer with the incorrect number of channels. The audio engine then doesn't produce any sound or produce sound that is not expected.
                      
                      You can fix this by checking the number of channels of the input buffer and the internalBuffer before making a copy. If the number of channels are not the same, you can use buffer.setSize() to change the number of channels to match the internalBuffer before making a copy.
                      

                      can you show me how to adjust this code to check the number of channels of the input buffer and the internalBuffer before making a copy?

                      You can check the number of channels of the input buffer and the internalBuffer before making a copy using an if statement like this:
                      
                      if (FORCE_INPUT_CHANNELS)
                      {
                          if (buffer.getNumChannels() == internalBuffer.getNumChannels())
                              internalBuffer.makeCopyOf(buffer);
                      }
                      
                      This way, if the number of channels in the input buffer and the internalBuffer match, the internalBuffer will make a copy of the input buffer. If the number of channels don't match, the internalBuffer will not make a copy, avoiding the problem you're facing.
                      Please also note that, if you are sure about the number of channels of your audio file, you can always set the number of channels for the internalBuffer before making a copy of the input buffer, like this :
                      
                      if (FORCE_INPUT_CHANNELS)
                      {
                          internalBuffer.setSize(buffer.getNumChannels(), buffer.getNumSamples());
                          internalBuffer.makeCopyOf(buffer);
                      }
                      

                      In my current setup, I have 4 channels on my hise project. after updating the code to your suggestion, I'm seeing signal on the output of bus 3 even when nothing is playing

                      It seems like the problem might be that you are not handling the case where buffer.getNumChannels() is different than internalBuffer.getNumChannels(). In that case, the internalBuffer should be resized to match the number of channels of the input buffer, otherwise the makeCopyOf() function will copy the data into the wrong places.
                      
                      You can try this modification:
                      
                      if (FORCE_INPUT_CHANNELS)
                      {
                          if (buffer.getNumChannels() != internalBuffer.getNumChannels())
                              internalBuffer.setSize(buffer.getNumChannels(), buffer.getNumSamples());
                          internalBuffer.makeCopyOf(buffer);
                      }
                      
                      This will check if the number of channels of buffer and internalBuffer match before making a copy, and if they don't match, it will resize internalBuffer to the number of channels of buffer before making the copy.
                      
                      This way the code should handle the case when the number of channels of buffer and internalBuffer don't match, and match the number of channels of input buffer before making the copy.
                      
                      Also, you should move the internalBuffer.setSize(buffer.getNumChannels(), buffer.getNumSamples()); out of the if statement, so in case force_input_channels is not defined it will set the size of internal buffer to the size of input buffer.
                      

                      is this the right way to do your suggestion:
                      if (buffer.getNumChannels() == internalBuffer.getNumChannels())
                      internalBuffer.makeCopyOf(buffer);
                      else if (buffer.getNumChannels() != internalBuffer.getNumChannels())
                      internalBuffer.setSize(buffer.getNumChannels(), buffer.getNumSamples());
                      internalBuffer.makeCopyOf(buffer);

                      Yes, that would be the correct way to implement my suggestion.
                      It checks if the number of channels of the input buffer and internalBuffer match before making a copy, and if not, it resizes the internalBuffer to match the number of channels of the input buffer before making a copy.
                      It's important to keep in mind that, if the input buffer has different number of channel than the internalBuffer, you should also make sure to clear the internalBuffer before making the copy, otherwise the previous content of the internal buffer would still be present and you will get unwanted signal in your output.
                      

                      So... In short, I changed the code in hi_dsp/modules/ModulatorSynthChain.cpp , Line 252 from:

                      #if FORCE_INPUT_CHANNELS
                      	if(internalBuffer.getNumChannels() == buffer.getNumChannels())
                      		internalBuffer.makeCopyOf(buffer);
                      #endif
                      

                      to:

                      #if FORCE_INPUT_CHANNELS
                      	if (buffer.getNumChannels() == internalBuffer.getNumChannels())
                      	{
                      		internalBuffer.makeCopyOf(buffer);
                      	}
                      
                      	else if (buffer.getNumChannels() != internalBuffer.getNumChannels())
                      	{
                      		internalBuffer.setSize(buffer.getNumChannels(), buffer.getNumSamples());
                      		internalBuffer.makeCopyOf(buffer);
                      	}
                      
                      #endif
                      

                      @Christoph-Hart Is this the right way to do this? or do we need a "Human equivalent" solution?

                      EDIT:
                      simplified

                          if (buffer.getNumChannels() != internalBuffer.getNumChannels())
                              internalBuffer.setSize(buffer.getNumChannels(), buffer.getNumSamples());
                          internalBuffer.makeCopyOf(buffer);
                      

                      ... and it works.... mostly. A couple of the routing meters show junk, but audio seems to work.

                      Dan Korneff - Producer / Mixer / Audio Nerd

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

                        @Dan-Korneff Nah, we must not resize the buffers in the processing callback (in the other case it works because it just shrinks the array length without reallocating.

                        But I think I've fixed it. I also spent a new preprocessor macro HISE_BACKEND_AS_FX which will use the same processing style as a compiled FX plugin (so it will not render child synths and only the master FX chain).

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

                          @Christoph-Hart does this also fixes my issue here?
                          https://forum.hise.audio/topic/7069/audio-inputs-aren-t-working-anymore

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

                          1 Reply Last reply Reply Quote 0
                          • d.healeyD d.healey marked this topic as a question on
                          • d.healeyD d.healey has marked this topic as solved on
                          • First post
                            Last post

                          32

                          Online

                          1.7k

                          Users

                          11.9k

                          Topics

                          103.5k

                          Posts