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.
    • Evan SplashE
      Evan Splash
      last edited by

      I'm looking for the ability to change the panorama of individual notes. The best solution I've found so far is to add a NoteNumber Modulator to the StereoFX in the Sampler. And it works the way I want it.
      But the problem is that I need to change the panorama of the selected note in the UI. I can't find any way to change the modulator parameters through a script, maybe there is some workaround?

      A similar question was on another thread: https://forum.hise.audio/topic/2212/accessing-notenumber-modulator-parameters-in-ui
      But unfortunately David's solution doesn't work for me, because in this case the release of the previous note will be pan along with the next note.

      I am very sorry for my English, it is not my native language.
      I hope for your help.

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

        What about using an "Array Modulator" instead, would it work?

        HiseSnippet 1481.3oc6Y0sbZaDEVBrRCj5zjLY5zK03oWfGRYPFCXlNcB1.NF6fE1xwNo2jYQr.KVrqhzxeISdnxc8wnOB8pdcdCZOqD+HRXvTpSSblhmggyY2yte64muiV4pNLSrqKyQRNxYCswRxeqhwPJuUgVHBUpbQI46pTA4xwNp9p1anMx0EWWRVN7SDJjirlj2m2+38PVHpIdpJIoyYDS7SIcH7oZql+Hhk09n53yHcBL6syW1jQKvrXcA7DVIojMx7RTS7wHwzBoHIeqR0IbliAGwwtRxqsGq9PiVr9T+4eNwkTyBKDzjLfExW89Lq5BDK9sTgVDq5UGetckjjUpN0KD12K7PkJj5jI5m5Mtm2.pSsHn+PNzhfm1JBO4.vaMe3ceECSGhMe5HBrcGkxTHP0.AgffvxetRgdmrRAFLCJOQGzk38c.gIVDKcxjORc6jI27mWOJDFb4p8PNpUQzJr5p+hpWVQhlXNH10BAmxXa3O3FBKD+QnVDJVsQWpImvnpLp+NaXQpiczD6sCyJlIqiMiBn3QvN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v0M1pcpbmsU6mmQfWG8CJw44ZbVpzoMfiFSfeRNgQoGB6rkNX4w4.ejYJC3n1v2e1CFR6Kg340prz0VSuks4gn+u0z5ru7618.EOt2aN.9dJUQ+Gy7dksDu0BXdush+ao4pw4dDaQyMw8HuQP8dySV+vZUh2FXIS8+9iaNTumx5xIzlUPvsjF.Olywc6X.2p2DCjBTJ1BVbE4Phal6KmTH6esdZcOg+B9LZPMgr7nA0FO3WM6QGjoC6kl9u+QAM0s8z.9Vp2+PfHJUDxpSdgiJJISjTpCbk+WZZJtOwOAjyy2lsVAaRsB1r8JXS5UvlLqfMYWAa1Yg1HdaK61ky532MCTTsjGourbIJBpP7ZXH82rzKniE
        

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

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

          @Evan-Splash if it's a sampler you can access the pan for each sample with a script

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

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

            @ulrik But not for each note - one note can trigger multiple samples and some samples can be used by multiple notes.

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

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

              @d-healey but you can set the pan for each sample, so if you have a structure and add all samples connected to C4 you would be able to set the pan for those samples, or is it not scriptable?

              Skärmavbild 2021-06-24 kl. 20.00.29.png

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

              ulrikU Evan SplashE 2 Replies Last reply Reply Quote 0
              • ulrikU
                ulrik @ulrik
                last edited by

                @ulrik I mean if you use an individual sample for each note

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

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

                  @ulrik Unfortunately Array Modulator doesn't work for me either. When you change a note, the previous one immediately takes on the value of the new played one.
                  But anyway, thanks for the advice!

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

                    @ulrik Accessing the sample's pan value is what I need if there is no way to change the pan of a single note. Perhaps you can tell me how I can access the panorama of a sample through a script?
                    Sorry if this is a stupid question, I'm just new to HISE and before that I wrote scripts only for KONTAKT.

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

                      It's not possible but it should be, I'll add a feature request.

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

                      1 Reply Last reply Reply Quote 0
                      • 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+BVF6vXPSzywGMTA6cDwgZDq45LXBKN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9yzifHgLwxRKY2qK8Y8pge5Z913rA2Ox1qMqvnOSmv1leDVvhbzX753.xHZdrph67MO1UvEoSDbVv7kG3y8wiAoM1W5E5QJEVcVy4F82CWcilYUe+M8eBt5FUNeU+eqXQuydr3zxWekWAbI5Ndj+aLzrw+6GZdZgtqVNxjfdWp9LOOeEOSSdhdl7+VPcOQtBm0VMuyCGJhe5jL.rGMthdbaAcWMsFP9321YH9S7uRg8plipE1qRnSPkov6V4uMq661.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

                                          43

                                          Online

                                          1.7k

                                          Users

                                          11.7k

                                          Topics

                                          101.8k

                                          Posts