HISE Logo Forum
    • Categories
    • Register
    • Login

    Randomize Presets

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 235 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.
    • M
      meto396
      last edited by

      Hello, I tried this code to Random choose my Presets.

      const var Random = Content.getComponent("Random");
      inline function onRandomControl(component, value)
      {
      	if(value)
      	{
      	local myRandName = myPresetList[Math.randInt(0,myPresetList.length)];
          Engine.loadUserPreset(myRandName);
          }       
      };
      Content.getComponent("Random").setControlCallback(onRandomControl);
      

      I can compile it but when I click the button it says

      User preset /Users/usr/Downloads/project/UserPresets/preset - 1 doesn't exist
      

      But all of these presets exist.

      d.healeyD M 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @meto396
        last edited by

        @meto396 Try adding + ".preset" to the end of myRandName

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

        1 Reply Last reply Reply Quote 0
        • M
          meto396 @meto396
          last edited by

          @meto396 yes this worked thank you :folded_hands_medium-light_skin_tone:

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

          16

          Online

          1.7k

          Users

          11.8k

          Topics

          102.8k

          Posts