HISE Logo Forum
    • Categories
    • Register
    • Login

    randomize help

    Scheduled Pinned Locked Moved General Questions
    2 Posts 2 Posters 200 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.
    • B
      BWSounds
      last edited by

      Im trying to randomize the wet control of a fx but twith this code it goes either all the way down or all way up. the min/max for the control is 0, 1

      KnobWET.setValue(Math.randInt(0, 2))
      

      and this works but I dont want the knob to go past .5 which I cant control with this code.

      KnobWET.setValue(Math.random());
      

      :man_shrugging:

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

        const rand = 0.5 * Math.random();

        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

        27

        Online

        1.8k

        Users

        12.0k

        Topics

        104.7k

        Posts