HISE Logo Forum
    • Categories
    • Register
    • Login

    Changing NoteNumber Modulator parameters via script

    Scheduled Pinned Locked Moved General Questions
    19 Posts 3 Posters 780 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.
    • d.healeyD
      d.healey
      last edited by

      Actually if you look in this thread Christoph offers a solution - https://forum.hise.audio/topic/2315/change-specific-samples-pan/9?_=1624631954795

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

      Evan SplashE 1 Reply Last reply Reply Quote 0
      • Evan SplashE
        Evan Splash @d.healey
        last edited by

        @d-healey Thank You, I will definitely try this!

        ulrikU 1 Reply Last reply Reply Quote 0
        • ulrikU
          ulrik @Evan Splash
          last edited by

          @Evan-Splash with this script you're able to set pan per sample, if you have the sample mapped on several notes, all will be affected

          HiseSnippet 1335.3oc4X80aSbDD+t3bHrKFUP7PeoRqh5CNRTvFBPqppvDmDjUIfUt.s7Ri1b2b1q3tcOs2dI3h3qR+LzOB4iDeCZmcu67s1XBoQMTTadxyL6Lyuclc9ykQRQ.jkIjNtM2eZJ33dEO+ob0jASnLtyvsP9dJHSkR4NaNMklkAgNttMdrVrayUcL+8tGtIMlxCfZVNNuPvBfmvRXpZti5+Sr33cngv9rDqSuQ+gAB9.QrHGgRCutNozfWQGCOkpO1JdNtWZ6PlRH8UTDONtqtoHbp+Dww7hy+BVF6vXPSzywGMTA6cDwgZDq45LXBKNbT0UNyww0aTc.nQQ.3Fd6xBYy3WGH9Ri.RsF1wC2UNM30yFdcO6vy0BdqV.uq44GHYopZIZr8EdC4JPFQwTfMrJNqyJ+9JdCD3I3pakPeEriDIloQm60s6MIazs65+P6Vsac6aSHJzWgjLZRZLHIYFqPjPDHALK2tElrxTjinRhewY5Q9Qh4gysFCpRdcVqR3Z0VdXDYpHmbLkqHJAAOMQMAH36q1sz1C+g1TkJZrlHmqCKof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SPkov6V4uMq661.35oIlcAiwIzw1Ooq1aFm88IAkIz.o3ffhOhQi0Ka3fnja92lzzaWMMoW02u3408Vc0qzyNHHPWH7sXDd45bmygN28bnyFmCct24Pm6eNz4AmCc9tSUG8ZBOJWIRJZRhLFscwCK2sm8vpgyego9dS+
          

          project

          Hise Develop branch
          MacOs 15.3.1, Xcode 16.2
          http://musikboden.se

          ulrikU 1 Reply Last reply Reply Quote 0
          • ulrikU
            ulrik @ulrik
            last edited by

            @Christoph-Hart is this a good/bad way to change the sample properties?
            I know you shouldn't use it in the NoteOn callback but else, is it ok?

            Hise Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

            1 Reply Last reply Reply Quote 0
            • ulrikU
              ulrik @Evan Splash
              last edited by ulrik

              @Evan-Splash I use this setup for controlling pan values
              It's 15 panknbs and 15 notes
              To find the samples to change I use the

              Sampler1.getSoundProperty(3, i);
              

              to get the "Root" of the sample and then it's simple to iterate over all samples selected

              In this instrument there is 4 round robin groups

              //  Pan --------------------------------------
              //  Selects all samples
              Sampler1.selectSounds("");
              
              //  get number of samples selected
              var NUMSelected = Sampler1.createListFromScriptSelection().length;
              
              // lookup array (note numbers)
              var indexList = ["48", "50", "52", "53", "55", "57", "59",
              "60", "62", "64", "65", "67", "69", "71", "72"];
              
              inline function onPanKnbsControl(component, value)
              {
                  local index = PanKnbs.indexOf(component);
                  {
                      if (value)
                      {
                          for (i = 0; i < NUMSelected; i++)
                          {
                              //  property 3 = sample "Root"
                              local root = Sampler1.getSoundProperty(3, i);
                              
                              if (root == indexList[index])
                              {
                                  Sampler1.setSoundProperty(i, 9, value);
                              }
                          }
                      }
                  }
              }
              
              for (p in PanKnbs)
              {
                  p.setControlCallback(onPanKnbsControl);
              }
              
              

              Hise Develop branch
              MacOs 15.3.1, Xcode 16.2
              http://musikboden.se

              Evan SplashE 1 Reply Last reply Reply Quote 0
              • Evan SplashE
                Evan Splash @ulrik
                last edited by

                @ulrik This is what I need! Thank you so much!

                ulrikU 1 Reply Last reply Reply Quote 0
                • ulrikU
                  ulrik @Evan Splash
                  last edited by

                  @Evan-Splash and instead of using "magic" numbers for the attributes

                  //  Pan --------------------------------------
                  inline function onPanKnbsControl(component, value)
                  {
                      //  Selects all samples
                      Sampler1.selectSounds("");
                  
                      //  get number of samples selected
                      var NUMSelected = Sampler1.getNumSelectedSounds();
                  
                      // lookup array (note numbers)
                      var indexList = ["48", "50", "52", "53", "55", "57", "59",
                      "60", "62", "64", "65", "67", "69", "71", "72"];
                      
                      for (i = 0; i < NUMSelected; i++)
                      {
                          local index = PanKnbs.indexOf(component);
                          local root = Sampler1.getSoundProperty(Sampler1.Root, i);
                                  
                          if (root == indexList[index])
                          {
                              Sampler1.setSoundProperty(i, Sampler1.Pan, PanKnbs[index].getValue());
                          }
                      }
                  }
                  
                  for (p in PanKnbs)
                  {
                      p.setControlCallback(onPanKnbsControl);
                  }
                  

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

                  Evan SplashE 2 Replies Last reply Reply Quote 1
                  • Evan SplashE
                    Evan Splash @ulrik
                    last edited by

                    @ulrik Thank you so much, I will try it tomorrow!

                    1 Reply Last reply Reply Quote 0
                    • Evan SplashE
                      Evan Splash @ulrik
                      last edited by

                      @ulrik This works great, this is what I was looking for! Thanks again for the help

                      ulrikU 1 Reply Last reply Reply Quote 0
                      • ulrikU
                        ulrik @Evan Splash
                        last edited by

                        @Evan-Splash I'm glad it worked for your case! 😊

                        Hise Develop branch
                        MacOs 15.3.1, Xcode 16.2
                        http://musikboden.se

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

                        47

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        101.8k

                        Posts