HISE Logo Forum
    • Categories
    • Register
    • Login

    Easy ease smoothed transition function between two constants

    Scheduled Pinned Locked Moved Scripting
    2 Posts 2 Posters 560 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

      Hi

      I have 2 constants and one variable (knob value).

      I need an easy ease - smooth transition function (something like "S" shape) between 2 values with a knob control (from 0 to 10). So when the knob is 0, target value will be "constant 1". When the knob is 10, target value will be "constant 2". And the proper smoothed target values in between 0 & 1 knob values.

      Which function or method do you suggest?

      develop Branch / XCode 13.1
      macOS Monterey / M1 Max

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

        @orange Sorry I just saw this post.

        This is a KSP function I used to smoothly go between 2 values. If I remember correctly the /1000 was because Kontakt can't handle floating point numbers so you might not need that. This doesn't have an S-shape though, I think you'll need to employ some trigonometry for that.

        function ul.morph_2(value, x, y) -> return
            return := (((1000 - value) * x) + (value * y)) / 1000 
        end function
        

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

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

        38

        Online

        1.8k

        Users

        12.1k

        Topics

        104.9k

        Posts