HISE Logo Forum
    • Categories
    • Register
    • Login

    Load Sample Map Randomness

    Scheduled Pinned Locked Moved General Questions
    11 Posts 2 Posters 356 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.
    • DabDabD
      DabDab
      last edited by

      How to create a button that will load random samples (Sample Map).

      I know the Sample map but with button I want to load random sample maps.

      Bollywood Music Producer and Trance Producer.

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

        Use Math.randInt() to generate a random index for your array of sample maps.

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

        DabDabD 1 Reply Last reply Reply Quote 0
        • DabDabD
          DabDab @d.healey
          last edited by

          @d-healey Can I get a basic snippet please ?

          Bollywood Music Producer and Trance Producer.

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

            @DabDab I'm sure you could figure this out...

            HiseSnippet 881.3ocsU01aTaDDd8kXn1khJR7CXEexQhdbWKPQBgHMWRPmHW3TME0ppJzl0yEuj06Zs65TNUk+y8ePYVaewNvoT3jve3zMu7r9YlclGO2n4f0pMjfnWurDHA2JLcoxkOImITjo6SBtc3Ll0AFZiq8VVxrVHiDDr0K7NBh1lT+7uOeOljo3PmKB4MZAGNRTHbcdmu6KER4grL30hhdY+vcmx0pIZotB4yVgiHkL9YrSgiY9zFDRBtwAYBm1j5XNvh4rmNaYZt9uUM4+FgUbhD7FiIo3A03lLIWHylupVsDRv1y6p7sZp76FNSjItzeWG36qCP6PzuGDL35nz3u.JEziRa2Po6DlxMhRWWDOe91voJ7BYACa08oRStjAiFDNQiYnbCKXmAGZPiKQj73QitOE+YmmFGisaqiZYEkRXFqzReFMs1vL7Tvktx+QBqKYmmRevCnu.bTlhxLF1RpdAkIks3oE9CPnntbfVZzuC3t3XgRJT.cQkh6DZEUq1qx4zpwdFZzxDttnTqPtde54LYErS7+DGIVPSZshPyHolyj3YmAuGo3LlKengoxvhJAKlN9OTBpSc4XosBykwPbc48m0G0egcfnHrnjZVFcIN00qTn4fAhitH9BLqUsSroLYEeStWakbucFZ89qqmIXC4DbpM4iKTjS8ZBGqcvqTI0Ea7EwzONzhEqMV6Yg2OqMrecxbc.STUEm.l9sZeh371UGhuwm2PLuoszKQsZpR3dUIzZenVl4GN8++SG4Is8U7e+1z8YNleKn0GlWIXbBOcB1GNGkQZ1IhB2Grm4zk041dYPBtoqN5sa2XZZ9DQlGP6MA48cZMY6try3O1UXmoKvygYP2AC.ECKW+V+Q.yn7KWV14vT0bCf20daxmtsh5D5rJIycUwCuJYa.7x3Jar9sRkU3V1WE8KPQYz0pn74Rw6DNW334qmiCVCGwqouFbrUG96BOXwBT7nifaGd3uuoht+Ou9eUW4DpSQIEi.GOBOtpHEEB3.91UJPhGdXv.+nZi8HusuCjBprZi+CeZCN1aGzFb7pfjBF2neKuYEzqz+M0dPNop+vVD9EVzlNlTuVh3BGMbDo.G+dKm6K+e.2dVOlebCv7Sa.lGtAXdzFf4wa.ledCv7jqEiey+Wpb5hl0Azw7Cp0mBBNnVZndJj7AHZbRJN
            

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

            DabDabD 2 Replies Last reply Reply Quote 1
            • DabDabD
              DabDab @d.healey
              last edited by

              @d-healey Excellent... Thank you so much. Yup got the learning path.

              Bollywood Music Producer and Trance Producer.

              1 Reply Last reply Reply Quote 1
              • DabDabD
                DabDab @d.healey
                last edited by DabDab

                @d-healey how can I change combobox samplemaps also via this randomize button?

                inline function onButton1Control(component, value)
                {
                	if (value)
                	{
                		local index = Math.randInt(0, smpmapFD.length);
                		local sampleMap = smpmapFD[index];
                
                		// load your sample map here
                		Drum2.loadSampleMap(sampleMap);
                	    SmpmapCmb.changed(); // nothing is changed 
                	}
                };
                

                Bollywood Music Producer and Trance Producer.

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

                  @DabDab setValue

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

                  DabDabD 1 Reply Last reply Reply Quote 0
                  • DabDabD
                    DabDab @d.healey
                    last edited by

                    @d-healey Something like this ?

                    // load your sample map here
                    Drum2.loadSampleMap(sampleMap);
                    SmpmapCmb.setValue(1);
                    

                    not working.. smp.gif

                    Bollywood Music Producer and Trance Producer.

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

                      @DabDab SmpmapCmb.setValue(1); Something like that yes, but if you set it to 1 then it will always be 1.

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

                      DabDabD 1 Reply Last reply Reply Quote 0
                      • DabDabD
                        DabDab @d.healey
                        last edited by

                        @d-healey Then what is the solution ? how can I use randomize button and it will change ComboBox as well ?

                        Bollywood Music Producer and Trance Producer.

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

                          @DabDab you use the index you generated

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

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

                          15

                          Online

                          1.7k

                          Users

                          11.8k

                          Topics

                          102.4k

                          Posts