HISE Logo Forum
    • Categories
    • Register
    • Login

    where to grab Engine.getSampleRate() ?

    Scheduled Pinned Locked Moved General Questions
    6 Posts 3 Posters 170 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.
    • Dan KorneffD
      Dan Korneff
      last edited by

      I'm working on a convolution project that loads audiofiles based on the host sample rate.
      Placing Engine.getSampleRate() on init retuns a value of -1 because it's initialized before the samplerate is queried.
      In the past, I've placed the getSampleRate function inside PrepareToPlay of a scriptFX, and this works fine.
      This project is using a compiled scriptnode dll and I'm throwing that into a HardcodedFX module so I'm thinking there's a better way to do this. What would you do?

      Dan Korneff - Producer / Mixer / Audio Nerd

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

        @Dan-Korneff the prepare callback of a script fx (without a network).

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

          @Christoph-Hart global variable , right?

          Dan Korneff - Producer / Mixer / Audio Nerd

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

            @Dan-Korneff yeah that's what I do

            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

              yup that's one of the good occasions of using global variables.

              I could add a broadcaster source that listens to audio spec changes, then you could just attach it inside the main script and wouldn't need to add a script FX only for this.

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

                @Christoph-Hart giphy.gif

                Dan Korneff - Producer / Mixer / Audio Nerd

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

                52

                Online

                1.7k

                Users

                11.7k

                Topics

                101.9k

                Posts