HISE Logo Forum
    • Categories
    • Register
    • Login

    Arp plays in key?

    Scheduled Pinned Locked Moved General Questions
    25 Posts 5 Posters 1.0k 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.
    • Christoph HartC
      Christoph Hart @Lindon
      last edited by

      Yes I would also recommend writing that from scratch. Here's a starting point:

      HiseSnippet 1550.3oc2X0raaaDDlz1LsRsMnoMnnG2dH.x0JNR14WXDXKKIGHTKYAQm3.3FXrlbkz1PtK6xkNQIHOC8bt0WihdsO.8buk1S8VdCZmkKkHorhgqZRQasu3c1Yl8al4alkq6J3NjvPtvvrv9iBHFlenk8HlbX8gXJynUCCy2ypQjKwyX6QA3vPhqgo4h2SsoYgkLh+40atM1CybHohLLd.m5P1k5SkoR6t0WQ871A6R1m5mQ6quUKGNqN2iGA.YQqJFAXmGiGP5fUpsfkg4EZ5RkbgsDKIgFlKsM2cj8P9SXZ8e.MjdrGQsnpgM3Hs3c3dtJDqjZTeH0ys63.NzvvzpaZ3unN7urUapKch7zzvGGuAJ0hr4CyExCuEyAupYgWkLv6zPxHChVRiH3f4tQdXYdznJAIaP4rbnoESRXgT4nrkn+wg3kr5RkNCmMFWXFXDJHuKvXRg8irZ1uOwQlBvkr14gu6qhWTe7efkMkQhashO7OKdM5.7IDz8HLhPk7pdFMY+74sIK3b2jsmiDN98EXVX.OLmisI9z84LUVHU38CI6HHeaOU0Lq75brXla85M2ABxYZiMVFIhoE074Qrw3eqW8reZSyEOql8puol87cDYzeFc9K8utNeSyS2WcIKaGAMPltiBOeZhzTDkm2n20XgxWv5ZWC0sVuZsateyd1nqhp45hjCgZMRxQXz8agpyYRA2Cw6iFADCjyPEkpXQAY.py8aezd02u1CZZitKp5FEKB9ylHUFWA0mKPQAOAKbQC7nggXlKO1rd05zXu1IVnDXWu1tMOpUmFMeHHc8wR61rYCkVU1.A9MJjDhjD+.NhxbIOEVUB3qLn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YU0ZyjMqNdy+2bF9XGA+HG8ETJ9y6GKAxsr3+APErZqVipZDeoEXmE7cUF9vyxNxwQwpuJPCmsMqMG1r9bXy0mCatwbXyMmCat0bXysOSaTuHtVjj6qm3AB51L9lbSylLLzgD2Ca7mvaAVhJ
      
      MikeBM 1 Reply Last reply Reply Quote 0
      • MikeBM
        MikeB
        last edited by MikeB

        @Christoph-Hart @Lindon
        Thanks guys - saved the idea.

        But since I unfortunately built a plugin 2 years ago with the internal arp. that now finally accepts a preset change without stopping and also uses all other existing functions, it would be a step backwards to start all over again and build my own arp.

        My arp only plays tuned drum samples in one loop player.

        No notes are entered/played from the keyboard. Everything is tuned to C3 and only this note is set as root.

        This basically means that the internal arp only has to omit a selected key when playing random notes, or play the next higher or next lower note - which one doesn't matter - because it's random.

        I would need an approach for this.
        How do I get my random function for the arp to randomise only within allowed notes?

        "One hour of trial and error can save 10 minutes of reading the manual."
        "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
        HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

          @MikeB said in Arp plays in key?:

          How do I get my random function for the arp to randomise only within allowed notes?

          Based on the above answers I don't think it's possible without modifying the built in arp.

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

          MikeBM 1 Reply Last reply Reply Quote 0
          • MikeBM
            MikeB @d.healey
            last edited by

            @d-healey
            Sir David - so you mean that it is not possible to tell a slider in a sliderpack to randomise only between the values -10 ,-8, -7, -5 ,-3 -2, 0, 2, 3, 5, 7, 8, 10 for example?
            ...and that 5 hours before the turn of the year :-)

            "One hour of trial and error can save 10 minutes of reading the manual."
            "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
            HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

              @MikeB Ah that's different, I thought you wanted the arp to do something it wasn't meant to. What you want to do is within your GUI script, correct? You can use the Math.random or Math.randInt function to generate a random number which you assign to your slider pack slider.

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

              MikeBM 1 Reply Last reply Reply Quote 0
              • MikeBM
                MikeB @d.healey
                last edited by

                @d-healey

                //Random Note Button-----------------------------------------------------------------------
                inline function onbtnRandomNote_S1Control(component, value)
                {        if(value) {  
                        for (i = 0; i < 16; i++){  
                            local r = Math.randInt(-12, 12);
                            myPads_S1[i].setValue(r);
                            SliderPack1_S1.setSliderAtIndex(i, r); }            
                       }
                };
                Content.getComponent("btnRandomNote_S1").setControlCallback(onbtnRandomNote_S1Control);
                //----------------------------------------------------------------------------------
                
                

                I already have that - but with Math.random and/or Math.randInt, only between whole numbers are selected, for example between -12 and 12 - in this case, however, certain numbers within -12 / 12 are not to be selected (because they do not occur in the selected key, for example 5).

                So I need a random function that only selects between the numbers 1 2 3 4 6 7 8 9 10 11 12 and leaves out 5. As an example.

                "One hour of trial and error can save 10 minutes of reading the manual."
                "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                  @MikeB Make an array that has the numbers you want. Use the random function to generate an index that you can use to get the value of an element in the array.

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

                  MikeBM 1 Reply Last reply Reply Quote 0
                  • MikeBM
                    MikeB @d.healey
                    last edited by

                    @d-healey Do you have a small example that I can look at and understand?

                    "One hour of trial and error can save 10 minutes of reading the manual."
                    "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                    HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                      @MikeB

                      const valuesIWant = [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12];
                      
                      Console.print(valuesIWant[Math.randInt(0, valuesIWant.length)]);
                      

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

                      MikeBM 1 Reply Last reply Reply Quote 1
                      • MikeBM
                        MikeB @d.healey
                        last edited by

                        @d-healey
                        Super thanks Sir David. I got it - now even better with your example.

                        I thank you for your great support this year and wish you a happy and successful new year.

                        "One hour of trial and error can save 10 minutes of reading the manual."
                        "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                        HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                          @MikeB You're most welcome. Happy New Year!

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

                          DanHD 1 Reply Last reply Reply Quote 0
                          • MikeBM
                            MikeB @Lindon
                            last edited by

                            @Lindon said in Arp plays in key?:

                            @MikeB

                            Write your own Arp.

                            It was easier in this case - Happy and prosperous New Year to you.

                            "One hour of trial and error can save 10 minutes of reading the manual."
                            "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                            HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

                            1 Reply Last reply Reply Quote 0
                            • MikeBM
                              MikeB @Christoph Hart
                              last edited by MikeB

                              @Christoph-Hart
                              Thanks to David, I found an easier solution. A happy and successful new year to you.

                              After two years of peace and quiet here in Berlin, we'll have a lot of noise in front of the house again in a few hours. :-)

                              "One hour of trial and error can save 10 minutes of reading the manual."
                              "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                              HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

                              1 Reply Last reply Reply Quote 0
                              • DanHD
                                DanH @d.healey
                                last edited by DanH

                                @d-healey just trying this - the console prints correct values but the sliderpack continues to set random values, rather than values in the specified array. Am I doing something stupid?!

                                HiseSnippet 1225.3ocsW8+SaaDE+b.W03tV0N0+.NwurD0T23PJkIFZIjD1hFDxHYnNgPUG1WH2v9tH6KTxlPZZ+Eu+C1d2YmXGHM.QpVg.uudedu68d9Q2PgKMJRDhLx2exHJx3aL6MgKG1XHgwQsahLdg4gjHIMDGyZuIiHQQTOjgwZ+jhgQ90Q5m+8G2i3S3tzTVHzIBlK8.V.Slxsaseg46uOwi1mEjQ6p0Z6J3MD9hw.dVyrLZDw8RxEzNDkZ4LQFOokGSJB6IIRZDnydBuI8FJ9LOV+SXQry8oJBGTOvQwrQMFx785NMViPHi06lF4qEG4u17PlGaF+zLvK0BvoVjMGXjaYPx4Q.IiLPZ8XH8JydtgrQxTIJ77Ly1b3BY.AR0YgRrtnbemoYCAnAWZGPtjteHPLyhBaUtbIL7UwcrrfzcjDeEIDGv3hP7t3SAgUJg2rD98kvenDd6RXGfkCvyoJ7Cv0AX678fZJUA9Upd1NY7DjEjJGUQ6nGzm4rOf7GYQR0oHANQGGPyrnt9wc60n9As.0mFwWPkMDAiDbfnvFSUXihYOhd9LOZXWn3x4KZYFcTFaw39LNEOXL2UxDbrfC9935cZdzgJGDJ7K3N05Rvo3OlVz5urxyFfKLEEpi3DkjBEw6tK1onUdPi7Cf3s.CPR4cvL7Ofc1B98adCHMO7Am77t2kAR1QTYLYc3p0idcAVI7gD4P6PB2CtrK71JUUWMEArm5iL+I.5HgO0dTHSEtwQhNRyeiU9kh6JOJb+nPMbmqqDs8o7KjCuC5uEpOrcmiNdCsRyKQ6jSWpqOaluu+HdyupQrpiYt.9VQoRNDjKHAr3vLq+NK1tarzA5cu3WP.CP3FnL3K1PMsTQEaIk9MH99mCwag61UTbmLsLcDR5Q7B5FCK.S2VzfAKTVhq7ogKTr5sHgKyvB7wAmSCy1VpTDFyN+r6m7vlc6FmYxnnf2lyjGMhlPuuv2SMSV822cROJI0By7ykfP.JR8D+uMYheZMDhAN54lYJpP5vH88lutlGQRPFmZtUUa3YS6511CZzzN4oYcf9plJ59cgu5pns0x6nn+YE8.s7eUQ2WQ2USu4QZOTOFyZftVLPeYBPgZiyE6ItVCSKyo0S2FinZneqcSELg2TkD+PNYDMTxTodilzqfMEhesWdylznKkhQvoMq1CY7zGQJ55YG8eeZsIo3nYsOy7jCQFlF0LPngT1ECkJp+ADFPRMCscMXqmQ8X+Ic58XJRdRLRdQBR1arTJ3ZT7LyYM.Yv.52yhAVMJm.0UpsJNfRB4pWdGQth1l2MjBcUJ5Ebb2WJO87vgyed5.yDbJPHoAQpkchAokdDpU+V85aAalcmMPfceDdi8Ix4WHRs4Wh.nSatsPTaZviXxIY2L7QrkT4ktkzCEhuxrKS5NbwXL2BvnpY7q.FS1s74lsFLf5JSA35l6+wUcQx643OVLVx3W.uVHjot26LNnGrRsKENcNm5GopExolCESWVQqx.8nbOMw+AOIBcTzFIBclJDZUbCEexMdnfZ60mp4.XhqWVOO7eM.z3YCqLMKaWFE.k7ex0UE9u0AgVrMUVAa1bEro5JXy6WAa1ZEr4CqfMauTaTSapOVJBhaG.FcaoGHaXzRONRWEh9esZ6tKA
                                

                                EDIT: Actually the console values are random even with the test array which is just a bunch of '2's

                                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                https://dhplugins.com/ | https://dcbreaks.com/
                                London, UK

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

                                  @DanH

                                  the sliderpack continues to set random values

                                  That's because you are setting random values... what size t-shirt do you want?

                                  SliderPack1.setSliderAtIndex(i, Math.randInt(0, minor.length));

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

                                  DanHD MikeBM 2 Replies Last reply Reply Quote 0
                                  • DanHD
                                    DanH @d.healey
                                    last edited by

                                    @d-healey XXXL please 😁

                                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                    https://dhplugins.com/ | https://dcbreaks.com/
                                    London, UK

                                    1 Reply Last reply Reply Quote 2
                                    • MikeBM
                                      MikeB @d.healey
                                      last edited by

                                      @d-healey What would be the right approach here?

                                      "One hour of trial and error can save 10 minutes of reading the manual."
                                      "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                                      HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                                        @MikeB To what?

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

                                        MikeBM 1 Reply Last reply Reply Quote 0
                                        • MikeBM
                                          MikeB @d.healey
                                          last edited by

                                          @d-healey So that DanH's snippet above works!

                                          "One hour of trial and error can save 10 minutes of reading the manual."
                                          "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                                          HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                                            @MikeB It does work, it does exactly what he told it to do.

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

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

                                            10

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            103.2k

                                            Posts