HISE Logo Forum
    • Categories
    • Register
    • Login

    HISE FX and delay compensation

    Scheduled Pinned Locked Moved General Questions
    51 Posts 9 Posters 2.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.
    • orangeO
      orange
      last edited by orange

      I found this threads, they may be helpful. Also I see that they prefer to use setLatencySamples() in prepareToPlay. But we're using it in onInit, could that be the cause?

      https://forum.juce.com/t/cubase-latency-issues/27669

      https://forum.juce.com/t/look-ahead-vs-daws-latency-compensation/30384/2

      https://forum.juce.com/t/vstplugininstance-getlatencysamples/7934

      https://forum.juce.com/t/setlatencysamples-int-newlatency-in-cubase-and-bitwig-in-vst3-win-and-mac/15061/3

      develop Branch / XCode 13.1
      macOS Monterey / M1 Max

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

        Well, onInit comes way before prepareToPlay, so if it's not set correctly by then, we're screwed anyway.

        However, I've encorporated a few things mentioned in the threads:

        • resend the latency update in prepareToPlay if it's different than at the last call
        • add a static delay line to the bypassed processing chain (I thought the host would do this, but it makes sense that it's the plugins job to delay it).

        While the first one is pretty cosmetic, I think the last one might be actually helpful.
        Unfortunately I am not in my studio right now, so I can't test the hosts, but I pushed it to the scriptnode branch so if anyone wants to check if this improves the situation, have a go.

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

          @Christoph-Hart I've just tried, result is the same :/

          develop Branch / XCode 13.1
          macOS Monterey / M1 Max

          Dan KorneffD 1 Reply Last reply Reply Quote 0
          • Dan KorneffD
            Dan Korneff @orange
            last edited by

            @orange @Christoph-Hart I just tested latest version of ScriptNode. Cubase is picking up the reported latency.
            Gotta test to see how accurate it is.

            Dan Korneff - Producer / Mixer / Audio Nerd

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

              @dustbro Yeah Cubase can detect the latency value, there is no problem about it. You can also see that in the Cubase plugin manager.

              But the problem is, wet and dry channels are not in sync. Delay still persists.

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

                @Fortune got it.

                Dan Korneff - Producer / Mixer / Audio Nerd

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

                  OK, I've committed a fix for a typo that caused crackling when a delayed plugin is bypassed.

                  I've also made a example project with a latency of 200ms - it's just a simple delay without anything else:

                  Link Preview Image
                  hise_tutorial/LatencyTest at master · christophhart/hise_tutorial

                  The Tutorial project for HISE. Contribute to christophhart/hise_tutorial development by creating an account on GitHub.

                  favicon

                  GitHub (github.com)

                  The sample amount will get calculated on the initialisation and the latency will be changed accordingly (so to eg. 8820 samples on 44,1 kHz).

                  I've tested these hosts:

                  • Cubase 9: Latency is reported correctly, both active and bypassed plugins are in sync
                  • REAPER 5: Latency is reported correctly, both active and bypassed plugins are in sync
                  • Ableton 9: Latency is reported correctly, both active and bypassed plugins are in sync

                  Please try your hosts and report back any problems:

                  1. Compile the LatencyTest plugin as FX plugin.
                  2. Load up your DAW and add two audio tracks with the same audio data
                  3. Load the LatencyTest VST plugin into one of them
                  4. Play and check that it's in sync. Bypass the plugin and play again, check that it's still in sync.
                  FortuneF 1 Reply Last reply Reply Quote 3
                  • Dan KorneffD
                    Dan Korneff
                    last edited by

                    💪

                    Dan Korneff - Producer / Mixer / Audio Nerd

                    1 Reply Last reply Reply Quote 0
                    • FortuneF
                      Fortune @Christoph Hart
                      last edited by

                      First of all, you did it, well done @Christoph-Hart !

                      I am pretty impressed. Especially calculating the delay time acording to sample rate and ms conversion multiplying is a clever idea. Yeah it needs some improvements but you did most of the thing. As you can see, you can do it.

                      My check is that:

                      Windows:

                      • It works well on Cubase 10, Reaper 5, Ableton 10, Studio One 4.5, Pro Tools 2019 Ultimate!
                      • In FL Studio 12 & 20- it fails again. I hear 200 ms latency unfortunately :/

                      Mac

                      • Reaper, Ableton, Studio One, Pro Tools did it very good.
                      • In Logic Pro X, When you insert the plugin in the channel, it takes approximately 2 seconds to sync. You can hear fade of the phase shift before synching, after 2 seconds it is in sync. This fade time can be disturbing to some users. You can improve it.
                      • FL Studio 20 - fails again. I hear 200 ms latency unfortunately :/

                      Also I have some questions;

                      • To calculate the delay time , can we take the delay time of the plugin with "getlatency" and use it on "setLatency"?
                      • I tried that code in "if / else statement" but it doesn't work properly. I usedin different oversampling modes, delay time changes when OS is on and off. For setLatency, only first statement works. Can that be done?
                      1 Reply Last reply Reply Quote 0
                      • Christoph HartC
                        Christoph Hart
                        last edited by

                        You can improve it

                        How? I am not the Logic developer.

                        FortuneF 1 Reply Last reply Reply Quote 0
                        • FortuneF
                          Fortune @Christoph Hart
                          last edited by

                          @Christoph-Hart said in HISE FX and delay compensation:

                          You can improve it

                          How? I am not the Logic developer.

                          You are right, it seems like it is a Logic issue.
                          https://forum.juce.com/t/logic-pro-x-midi-fx-plug-in-latency-compensation-timeshift/23855

                          What about FL Studio?

                          1 Reply Last reply Reply Quote 0
                          • lalalandsynthL
                            lalalandsynth
                            last edited by

                            What is the status of this issue ?
                            Do I need to need to do anything manually to take care of latency or does Hise take care of that ?

                            https://lalalandaudio.com/

                            https://lalalandsynth.com/

                            https://www.facebook.com/lalalandsynth

                            https://www.facebook.com/lalalandsynth

                            lalalandsynthL 1 Reply Last reply Reply Quote 0
                            • lalalandsynthL
                              lalalandsynth @lalalandsynth
                              last edited by

                              @lalalandsynth nudge topic.

                              https://lalalandaudio.com/

                              https://lalalandsynth.com/

                              https://www.facebook.com/lalalandsynth

                              https://www.facebook.com/lalalandsynth

                              1 Reply Last reply Reply Quote 0
                              • Dan KorneffD
                                Dan Korneff @Fortune
                                last edited by

                                @Fortune said in HISE FX and delay compensation:

                                With this way, plugin reports delay compensation to the DAW in the very begining of the initialization.

                                Is there a way to adjust delay compensation after a plugin has been initialized? The amount of latency may change depending on the amount/type of modules enabled. It would be nice to be able to compensate for this.

                                Dan Korneff - Producer / Mixer / Audio Nerd

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

                                  @dustbro I wonder if the procedure is not to report the biggest latency, and then compensate IN the plugin for lower latency configuration by adding the difference...
                                  I reckon I've seen that one day but not 100% sure...

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

                                  Dan KorneffD 1 Reply Last reply Reply Quote 0
                                  • Dan KorneffD
                                    Dan Korneff @ustk
                                    last edited by

                                    @ustk said in HISE FX and delay compensation:

                                    report the biggest latency, and then compensate IN the plugin

                                    Not a bad idea!

                                    Dan Korneff - Producer / Mixer / Audio Nerd

                                    1 Reply Last reply Reply Quote 0
                                    • lalalandsynthL
                                      lalalandsynth
                                      last edited by

                                      Just to be clear , does the plugin not normally compensate for latency unless I do something specific to make it do that ?

                                      https://lalalandaudio.com/

                                      https://lalalandsynth.com/

                                      https://www.facebook.com/lalalandsynth

                                      https://www.facebook.com/lalalandsynth

                                      Dan KorneffD ustkU 2 Replies Last reply Reply Quote 0
                                      • Dan KorneffD
                                        Dan Korneff @lalalandsynth
                                        last edited by

                                        @lalalandsynth said in HISE FX and delay compensation:

                                        Just to be clear , does the plugin not normally compensate for latency unless I do something specific to make it do that ?

                                        It does not automatically compensate for latency.

                                        Dan Korneff - Producer / Mixer / Audio Nerd

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

                                          @lalalandsynth I don't think any plugin can compensate its own latency, it's the DAW's job. Plugins can only tell the DAW how much it needs

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

                                          lalalandsynthL 1 Reply Last reply Reply Quote 0
                                          • lalalandsynthL
                                            lalalandsynth @ustk
                                            last edited by

                                            @ustk yes, that is what i meant does it report the latency without doing anything specific to make that happen? :)

                                            https://lalalandaudio.com/

                                            https://lalalandsynth.com/

                                            https://www.facebook.com/lalalandsynth

                                            https://www.facebook.com/lalalandsynth

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

                                            15

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.8k

                                            Posts