HISE Logo Forum
    • Categories
    • Register
    • Login

    Velocity Randomization with percentage

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 250 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.
    • 0
      0x7887
      last edited by

      Hi, I wanted to randomize the velocity in the sampler with percentage so I asked ChatGPT to make me one, after many attempts i ended up with this result.

      HiseSnippet 1493.3oc4Xs0aaaCEVJIpqwqoXsqOrWF.QwdPdKM0tWGPQQcysBiUmXXmUr2JXkns4pDo.EUZbKJ1eo8Sn+j5+fsCIkrnbTCbburBL+fgOGdNG9wyUR2WvCHoobgi65GMMg33dIugSYxI6LASYNc20w8xd8voRh.YXs8zDbZJIzw0c0mnX3t9ZN5Ou+Qaiivr.RIKGmmwoAjmRioxRt867aznn8wgjinwVRemNcC3rc3Q7L.Oq50xIAG7R7XxAXkXq343dg8BoRtXnDKIofLayCmNbB+ULi7OilReQDQQz1YHXHCamclPiB6WbVScbb85WdxW0bxulWOZHcF+ROv2oW.UpgsOvckyBRsOGPx0BRqYfzU7FFHnIxxUT34a85xf.xHL3psghQVG224sCGDfI2JF+Rx9BfXlB92qUqMQvWMevnLVfjxYHN6.tjbHyuYi2zX8FusAZ9kFMp10TaifGEQD0trJ5JNKE8YYwufH1DcLNJiLSP33W0mdgEymFXN0VBxYcYT4gIjb584QgJek52mNB3j61fe86c2EKwpfRNOPtDhPRUvwcWxwPVsIDst2tjzWJ4IPd8ohePlCOLKBKqlNopaxW.7GUhgp.EKkJmZWWcNxwZcl4XKJDuhWepLXR8XbkZvH3o9bfw7JyM71azHRfrDfq4s+errkgK91+ils+pdCkBBNlxFODGm.o6ZLzvKmp8mhlhIKbSw9BRDGGNj9ZKwdWmsy.ejnJ2+tidqdbLOiUYuxQ9.RBAKgvrkNWryfAOQvyRlWq2+HcRwQBnoL3JrW3PFA70R6y3NBdZ5H33nsUp8R8yDiU9pRN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vCkddPfpP3FfGtdct0RnysWBctyRnycWBct2Rny8WBc90yTG0aTebljGaZRBL5umIwxcuYIVq57ujQp2EM
      

      "in order to see how this works open the sampler workspace and use your keyboard or midi."

      So far it works well idk if there another way, but this one gets the job done for now.

      The way it works, it depends on how you hit the key, if you hit at 100 velocity it will hit randomly in a range of 5%.
      I hope the explanation is understandable :D

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

        @0x7887 You probably don't need scripting, just add a random velocity modulator to the thing you want to modulate (I assume gain?)

        mySampler.noteOn(Message.getNoteNumber(), Message.getVelocity());
        This is gibberish, you should get an error message in the Console.

        Also tell ChatGPT to use local variables not var

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

        0 1 Reply Last reply Reply Quote 3
        • 0
          0x7887 @d.healey
          last edited by

          @d-healey said in Velocity Randomization with percentage:

          mySampler.noteOn(Message.getNoteNumber(), Message.getVelocity());

          I just noticed this error

          Also tell ChatGPT to use local variables not var

          well do next time 👅

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

          24

          Online

          1.7k

          Users

          11.8k

          Topics

          102.8k

          Posts