HISE Logo Forum
    • Categories
    • Register
    • Login

    Decimally Accurate Sample Delay in Scriptnode

    Scheduled Pinned Locked Moved General Questions
    10 Posts 4 Posters 483 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

      What is the best way to give sample delay with decimal accuracy in scriptnode?

      For example I need a delay with 4.6 samples.

      AFAIK the jdelay is good for sample delay, but is it accurate with decimal values?

      develop Branch / XCode 13.1
      macOS Monterey / M1 Max

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

        @orange Since a sample is the smallest indivisible block, you can't have decimal.
        My guess would be to oversample this part and take a close multiple.
        4.6 => approx 5 => 8.7% difference
        4.6 oversampled x8 => 36.8 => approx 37 => about 0.5% difference

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

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

          @ustk sure you can that‘s how interpolating delay lines work.

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

            @Christoph-Hart Hmm alright, so this is based on an internal oversampling or ?

            I tried something similar a while ago and it seemed to be rounded to the closest sample... I might have made a mistake though

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

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

              @Christoph-Hart This would be the way then ?

              Screenshot 2022-12-14 at 16.33.21.png

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

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

                @ustk said in Decimally Accurate Sample Delay in Scriptnode:

                @Christoph-Hart This would be the way then ?

                Screenshot 2022-12-14 at 16.33.21.png

                That's what my predict, should we put this into a fix32 container?

                develop Branch / XCode 13.1
                macOS Monterey / M1 Max

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

                  An interpolating delay gets you a fractional delay, but it interpolates aka smears the signal:

                  100000000
                  
                  => 4.6 sample delay:
                  
                  0000 0.4 0.6 000
                  

                  Whether this sounds better then a 5 ms delay without interpolating the values - I don't. know...

                  orangeO Dan KorneffD 2 Replies Last reply Reply Quote 0
                  • orangeO
                    orange @Christoph Hart
                    last edited by orange

                    @Christoph-Hart

                    I have a SNEX node that gives 4.6 samples delay with 8x oversampling. So to handle the delay compensation what I think is:

                    • Define the 5 samples delay compensation (the nearest point to the 4.6) Engine.setLatencySamples(5);
                    • Then back to SNEX container and for 8x Oversampling > 0.4 samples delay in scriptnode (5 - 4.6 = 0.4)
                    • For 1x (Oversampling is off) > 5.0 samples delay in scriptnode

                    Is this ok?

                    develop Branch / XCode 13.1
                    macOS Monterey / M1 Max

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

                      @Christoph-Hart said in Decimally Accurate Sample Delay in Scriptnode:

                      An interpolating delay gets you a fractional delay, but it interpolates aka smears the signal

                      I found that it does a bit more than smear the signal in my testing. Sub Sample interpolation creates a full on LPF.
                      This example uses a converter node + jdelay and a knob with 0.1 step.

                      Sub Sample interpolation.gif

                      Dan Korneff - Producer / Mixer / Audio Nerd

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

                        @Dan-Korneff said in Decimally Accurate Sample Delay in Scriptnode:

                        I found that it does a bit more than smear the signal in my testing. Sub Sample interpolation creates a full on LPF.

                        Well, that's what I mean with smearing the signal :) The interpolation method will probably be responsible for it, as this is just using linear interpolation.

                        I've spent a few weeks researching and creating alternative algorithms from scratch and managed to implement two other interpolators that have a better amplitude response. Just kidding, they were lying around in the JUCE DSP module waiting to be used. I've also added the possibility of using delay lines in polyphonic contexts, so you can use it to detune your synth voices.

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

                        23

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        102.6k

                        Posts