Forum
    • Categories
    • Register
    • Login

    LFO Phase Control - Now shifts phase in realtime

    Scheduled Pinned Locked Moved General Questions
    10 Posts 5 Posters 54 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.
    • DanHD
      DanH
      last edited by DanH

      I've successfully used Claude to change the behaviour of the stock HISE LFO's phase control, which would shift the phase only when the LFO was next triggered. Now it changes it in realtime. @Christoph-Hart if this is of interest I'll submit a pull request, if I can figure out how to 😆

      Here are the lines - probably better to check first 😁

      Line 356 in LFOModulator.cpp, change:

      case Parameters::PhaseOffset:
          phaseOffset = (double)newValue;
          triggerWaveformUpdate();
          break;
      

      to

      case Parameters::PhaseOffset:
      {
          // Calculate the change in phase offset
          double phaseChange = (double)newValue - phaseOffset;
          
          // Update the stored phase offset
          phaseOffset = (double)newValue;
          
          // Apply the phase change to the current position
          uptime += phaseChange * (double)SAMPLE_LOOKUP_TABLE_SIZE;
          
          // Wrap uptime to stay within bounds
          while (uptime >= (double)SAMPLE_LOOKUP_TABLE_SIZE)
              uptime -= (double)SAMPLE_LOOKUP_TABLE_SIZE;
          while (uptime < 0.0)
              uptime += (double)SAMPLE_LOOKUP_TABLE_SIZE;
          
          lastCycleIndex = (int)floor(uptime * (1.0 / (double)SAMPLE_LOOKUP_TABLE_SIZE));
          
          triggerWaveformUpdate();
          break;
      }
      

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

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @DanH
        last edited by

        @DanH said in LFO Phase Control - Now shifts phase in realtime:

        while (uptime < 0.0)

        Will this ever be true?

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        Christoph HartC DanHD 2 Replies Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart @David Healey
          last edited by

          But if you don‘t smooth the phase you‘ll get really nasty zipper noises, no?

          griffinboyG DanHD 2 Replies Last reply Reply Quote 1
          • griffinboyG
            griffinboy @Christoph Hart
            last edited by

            @Christoph-Hart

            sbb's phase control is also unsmoothed I think 😅

            But anyway, regarding this Hise realtime phase control, shouldn't smoothing should happen at the parameter level anyway rather than lower down?

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

              @Christoph-Hart said in LFO Phase Control - Now shifts phase in realtime:

              But if you don‘t smooth the phase you‘ll get really nasty zipper noises, no?

              It's not terrible. But I'll ask about smoothing 😆

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

              1 Reply Last reply Reply Quote 0
              • OrvillainO
                Orvillain
                last edited by

                haha! I wrote a custom LFO late last year for a project, and this was precisely one of the reasons!

                Musician - Instrument Designer - Sonic Architect - Creative Product Owner
                Crafting sound at every level. From strings to signal paths, samples to systems.

                griffinboyG 1 Reply Last reply Reply Quote 0
                • griffinboyG
                  griffinboy @Orvillain
                  last edited by

                  @Orvillain

                  Me as well, I've got a few.

                  I used fixed point math for all LFOs now.
                  You can get really cheap phase manipulation and implicit wrapping

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

                    @griffinboy Yeah I've been waiting on yours basically and getting impatient 😆

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

                    griffinboyG 1 Reply Last reply Reply Quote 0
                    • griffinboyG
                      griffinboy @DanH
                      last edited by

                      @DanH

                      Mines done apart from the saving and loading and creating more of them.
                      I've not done that before in Hise.

                      But a single one exists and works completely. Envelope too.

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

                        @David-Healey said in LFO Phase Control - Now shifts phase in realtime:

                        @DanH said in LFO Phase Control - Now shifts phase in realtime:

                        while (uptime < 0.0)

                        Will this ever be true?

                        Yes apparently.

                        @Christoph-Hart said in LFO Phase Control - Now shifts phase in realtime:

                        But if you don‘t smooth the phase you‘ll get really nasty zipper noises, no?

                        Smoothing tricky apparently 🤷🏼♂ But doesn't sound bad without.... so far

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

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

                        27

                        Online

                        2.1k

                        Users

                        13.3k

                        Topics

                        115.2k

                        Posts