HISE Logo Forum
    • Categories
    • Register
    • Login

    Control individual notes/samples with a slider.

    Scheduled Pinned Locked Moved Scripting
    19 Posts 2 Posters 1.1k 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.
    • jssrecordingJ
      jssrecording
      last edited by

      I know how to control the sampler volume. But what I'm looking to do is control the volume of a specific sample on C1 note #36 with a slider.

      My id for the volume slider is: volumeSlider1

      Any tricks guys thanks?

      Cheers
      Jason

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

        @jssrecording You can assign volume changes to MIDI messages. Type the words gain or volume into the API browser to see what commands are available, I can't remember right at this moment.

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

        jssrecordingJ 1 Reply Last reply Reply Quote 0
        • jssrecordingJ
          jssrecording @d.healey
          last edited by

          @d-healey
          Looking at my options and still scratching my head.

          Screen Shot 2019-05-10 at 4.58.02 PM.png Screen Shot 2019-05-10 at 4.57.48 PM.png

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

            @jssrecording Message.setGain() and Synth.addVolumeFade() would be your two options. setVoiceGainValue(); might be useful too but I haven't used it.

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

            1 Reply Last reply Reply Quote 0
            • jssrecordingJ
              jssrecording
              last edited by

              Hey @d-healey , I'm still on the struggle bus trying to figure this one out. Would you have any working examples of this?

              Cheers
              Jason Smith

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

                @jssrecording Nope, it's not something I've done. Post what you have so far and let's try and shape it into something that does what you want

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

                jssrecordingJ 1 Reply Last reply Reply Quote 0
                • jssrecordingJ
                  jssrecording @d.healey
                  last edited by

                  @d-healey Okay no problem! I've been able to change the note volume with the Message.getNoteNumber and Message.setGain. Where I'm stuck is changing the slider and updating my variable/reg.

                  if (Message.getNoteNumber() == 48) {
                          
                          Message.setGain(volume1);
                      
                          Console.print(volume1);
                      
                       }
                  
                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @jssrecording
                    last edited by

                    @jssrecording Could you post it as a snippet (export >> HISE snippet)? Is volume1 a variable or a reference to your slider?

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

                    jssrecordingJ 1 Reply Last reply Reply Quote 0
                    • jssrecordingJ
                      jssrecording @d.healey
                      last edited by

                      @d-healey Sorry David, still new to a few of these features. Don't fully understand the Export Hise snippet.
                      volume1 is a variable for storing the volume.
                      My slider ID is volumeSlider1
                      Screen Shot 2019-05-13 at 11.12.14 AM.png

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

                        Go to the export menu, click export HISE snippet. Then paste it here in code tags.

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

                        jssrecordingJ 1 Reply Last reply Reply Quote 0
                        • jssrecordingJ
                          jssrecording @d.healey
                          last edited by

                          @d-healey ```
                          HiseSnippet 2855.3oc6b87aaibElxNLIVa71jso.aOz1ABsAxMYsEkn9g61rgwx1YcRjsVKG2Tf15PSMRhHTbXIoriiqPcKRwh1dX60bK+Izi6wbrG1C8PQA1EEEY6ghBTTfbsmZmgjRbH0unjkx5DSs.AKGNy27Muu2LuG4vwE0QRPCCjNSjY15.MHSjKvV5.UyZ4qIJqxr1xLQtD6paU.rrdi5Flh5fbIXV5.MQCCXYlHQl9VjpEYlyvX86k2XIQEQUInaQLLaijkf2UttroaoEEtirhxphkgaIWmp17BqIgTyiTPMvTZZ1DLZhROTrJbcQR0lhkIxYWorrIRujonIzfI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ZRToIkLLMovzjBSSJLMoSUoIkBjmeb7W9pvzjdy7sIwGllTXZRzoIkJLMovzjBSSJLMoSUoIwCxmNLMovzj5UZRoCSSJLMI5zj3CSSJLMovzjBSS503zjdUvRqCC5NR1G8Sq+jkaUBlkpVmV1YXsNanf1muYV1DymfoNNV0NRRjIBuG1B281jbDZSpQnM7iPaROBsIyHzlriPax021PRS3lMLQ0sWjDWPwUrcrhrRaGqoY9+nNge+.

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

                            So when you say

                            Where I'm stuck is changing the slider

                            What do you mean?

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

                            jssrecordingJ 1 Reply Last reply Reply Quote 0
                            • jssrecordingJ
                              jssrecording @d.healey
                              last edited by

                              @d-healey Moving the volumeSlider1 to change the Message.setGain() on note Message.getNoteNumber() == 48

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

                                Message.setGain(volumeSlider1.getValue()); Should probably do it. Just make sure you have a variable reference to your slider in your script - right click on the slider in the widget list to get the script variable declaration. You probably also want to setup your slider correctly to decibel mode with the appropriate min/max values.

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

                                jssrecordingJ 1 Reply Last reply Reply Quote 0
                                • jssrecordingJ
                                  jssrecording @d.healey
                                  last edited by

                                  @d-healey said in Control individual notes/samples with a slider.:

                                  Message.setGain(volumeSlider1.getValue());

                                  Okay I think I'm close thanks David! Where am I going wrong? BTW right clicking and creating a declaration is pretty slick!

                                  //volumeSlider1
                                      const var volumeSlider1 = Content.getComponent("volumeSlider1");
                                      
                                          if (Message.getNoteNumber() == 48) {
                                          
                                              Message.setGain(volumeSlider1.getValue());
                                          
                                              Message.setGain(volumeSlider1);
                                      
                                              Console.print(volumeSlider1);
                                      
                                           }
                                  
                                  d.healeyD 1 Reply Last reply Reply Quote 0
                                  • d.healeyD
                                    d.healey @jssrecording
                                    last edited by

                                    @jssrecording

                                    This should go in on init const var volumeSlider1 = Content.getComponent("volumeSlider1");

                                    Tell me why you put:

                                    Message.setGain(volumeSlider1.getValue());
                                            
                                    Message.setGain(volumeSlider1);
                                    

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

                                    jssrecordingJ 1 Reply Last reply Reply Quote 0
                                    • jssrecordingJ
                                      jssrecording @d.healey
                                      last edited by

                                      @d-healey Ha ha oops! That's my mistake 😑 Setting my constant to the init now.

                                      jssrecordingJ 1 Reply Last reply Reply Quote 1
                                      • jssrecordingJ
                                        jssrecording @jssrecording
                                        last edited by

                                        @jssrecording It works @d-healey thank you! Also changed my slider to decibels. Thanks my friend! BTW you should create a Udemy course on Hise. You're extremely knowledgable.

                                        jssrecordingJ 1 Reply Last reply Reply Quote 1
                                        • jssrecordingJ
                                          jssrecording @jssrecording
                                          last edited by

                                          @jssrecording Just to clarify our conversation for anyone else. I update my code in the onNoteOn to this.

                                                  if (Message.getNoteNumber() == 48) {
                                                  
                                                      Message.setGain(volumeSlider1.getValue());
                                              
                                                   }
                                          

                                          onInit

                                          //volumeSlider1
                                          const var volumeSlider1 = Content.getComponent("volumeSlider1");
                                          
                                          1 Reply Last reply Reply Quote 1
                                          • First post
                                            Last post

                                          45

                                          Online

                                          1.7k

                                          Users

                                          11.7k

                                          Topics

                                          101.9k

                                          Posts