HISE Logo Forum
    • Categories
    • Register
    • Login

    Calling multiple functions with delay on a Knob's Callback

    Scheduled Pinned Locked Moved General Questions
    33 Posts 9 Posters 1.9k 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.
    • resonantR
      resonant @Christoph Hart
      last edited by

      @Christoph-Hart I'll look at it thanks!

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

        @resonant Oh and if you want to deactivate the delayed calls, you can use Broadcaster.setBypassed() for this - if it's bypassed it will not call the delayed functions.

        1 Reply Last reply Reply Quote 1
        • FortuneF
          Fortune @resonant
          last edited by

          @resonant said in Calling multiple functions with delay on a Knob's Callback:

          1. Firstly run functOne()
          2. Then wait for 30 ms and run functTwo()
          3. Then wait for 50 ms and run functThree()

          Just out of curiosity, why would you need this function workflow?

          resonantR 1 Reply Last reply Reply Quote 1
          • resonantR
            resonant @Fortune
            last edited by resonant

            @Fortune

            As you see in the snippet, on each knob I am using multiple functions and each function contains lots of setAttribute APIs. Also there are lots of knobs, so this means tons of setAttribute APIs.

            I've just discovered that the more setAttributes are assigned to the knobs/buttons, the more crashes happen while loading DAW Projects with multiple plugin instances.

            These crashes happen on Windows and it's a memory corruption error. Because while the DAW project is loading, all of the parameters are trying to load the setAttribute functions and this causes a bottleneck that causes the crash.

            I think delaying these functions will prevent crashes because the functions aren't being loaded simultaneously.

            Or this might be a bug, I am not sure. But these crashes are happening with multiple plugin instances, on Windows and while loading the DAW project.

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

              @resonant So if this work around succeeds it's a good alternative, but it might also mean we're lacking of a possible Hise optimisation so this bottleneck doesn't happen... @Christoph-Hart?

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

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

                Yes I agree. If you manage to make a minimal example that recreates this I can take a look. This shouldn‘t be a reason to hack around with timers.

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

                  I've pushed an experimental build flag that might help with the issue. Please pull HISE and export your plugin with the HI_DONT_SEND_ATTRIBUTE_UPDATES flag set in your Extradefinitions. This should deactivate the internal messaging and hopefully fix the crash. Let me know if that helped.

                  resonantR ? 3 Replies Last reply Reply Quote 3
                  • resonantR
                    resonant @Christoph Hart
                    last edited by resonant

                    @Christoph-Hart Thank you for the update.

                    Unfortunately, this update is not a solution for the crash. The plugin seems a little bit relaxed but the crash still happens.

                    I sent you a minimal project of this FX plugin privately.

                    We tried this crash problem on different users and different computers. My advice to replicate the problem there is if possible, on Windows in Cubase 9/10/11 or Studio One 5/6 create 3 individual DAW projects (Using this FX plugin on the channels of a real song project will give a much more realistic result):

                    • 3 plugins
                    • 8 plugins
                    • 20 plugins

                    Some computers crash at 3 plugins, some at 20.

                    I also discovered that, if I insert only a ShapeFX module at the begining of the project (no setAttribute or parameter usage for this module), it reduces the crash because the loading time increases and this prevent crash. But the plugin seems still unstable.

                    I think the real cause of the crash is all of the parameter settings, UI elements...etc. are being called simultaneously at the same time on DAW project loadings. A little bit delayed calls can solve this issue.

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

                      @resonant So the issue doesn't happen in a single plugin instance but when multiple are used?

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

                      resonantR 1 Reply Last reply Reply Quote 0
                      • resonantR
                        resonant @d.healey
                        last edited by

                        @d-healey said in Calling multiple functions with delay on a Knob's Callback:

                        @resonant So the issue doesn't happen in a single plugin instance but when multiple are used?

                        Yes exactly.

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

                          @resonant Are you doing realtime stuff in the UI thread?

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

                          1 Reply Last reply Reply Quote 0
                          • resonantR
                            resonant @Christoph Hart
                            last edited by

                            @Christoph-Hart Any progress for this issue?

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

                              No, I need to test this. Can you give me a list of all host / OS combinations. I know Cubase is very critical when it comes to UI CPU pressure but I can‘t est on Cubase at the moment.

                              resonantR 1 Reply Last reply Reply Quote 1
                              • resonantR
                                resonant @Christoph Hart
                                last edited by

                                @Christoph-Hart I understand. We've tested on 11 different Windows 10 machines.

                                • 8 crashes are coming from Cubase version 9 or 10 or 11 unfortunately.
                                • 2 crashes from Studio One 5 and 6.
                                • 1 crash from Reaper 6.

                                For other DAWs and macOS, no known crashes for now. But I can definitely say that, if the plugin works in Cubase, it will work on everywhere.

                                For the NFR License, as a Developer you can write to Steinberg and ask from them, they are giving NFR Licenses to the Developers for free. If you get version 11, you can rest assured because you will reproduce the issue in there.

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

                                  @resonant yeah I wrote them for an NFR but never heard back, then I stopped caring.

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

                                    @Christoph-Hart Have you used up your free trial?

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

                                    1 Reply Last reply Reply Quote 0
                                    • orangeO
                                      orange @Christoph Hart
                                      last edited by

                                      @Christoph-Hart said in Calling multiple functions with delay on a Knob's Callback:

                                      @resonant yeah I wrote them for an NFR but never heard back, then I stopped caring.

                                      They have changed their NFR License section lately. The new system is very cool and easy to use/update, their response is now quick. Maybe giving a one more shot would be useful.

                                      develop Branch / XCode 13.1
                                      macOS Monterey / M1 Max

                                      DanHD 1 Reply Last reply Reply Quote 0
                                      • DanHD
                                        DanH @orange
                                        last edited by

                                        @orange is there a form we can fill out or specific email to contact? Or just their info@ one?

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

                                        orangeO 1 Reply Last reply Reply Quote 0
                                        • orangeO
                                          orange @DanH
                                          last edited by

                                          @DanH Just using the website support ticket system worked here.

                                          develop Branch / XCode 13.1
                                          macOS Monterey / M1 Max

                                          1 Reply Last reply Reply Quote 1
                                          • resonantR
                                            resonant
                                            last edited by

                                            Still no luck :/

                                            If there is no fix for this for now, what can we do as an alternative shortcut hack?

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

                                            40

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.9k

                                            Posts