HISE Logo Forum
    • Categories
    • Register
    • Login

    Sampler (if enabled)

    Scheduled Pinned Locked Moved Scripting
    15 Posts 4 Posters 597 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.
    • ThinkTankT
      ThinkTank
      last edited by

      Is there any function like this?

      if (samplers[y].isEnabled() && samplers[y].isNoteNumberMapped(i)) {
      

      Cant find it in the documentation, to check if a sampler is enabled or not.,

      Without problems that test the limits of your abilities, you can not expand them.

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

        @ThinkTank you can use

        Sampler1.isBypassed();
        

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

        ThinkTankT 2 Replies Last reply Reply Quote 0
        • ThinkTankT
          ThinkTank @ulrik
          last edited by

          @ulrik said in Sampler (if enabled):

          Sampler1.isBypassed();

          Thanks, too bad i only use enable/disable for my samplers :/

          Without problems that test the limits of your abilities, you can not expand them.

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

            @ulrik Can you apply multiple parameterid in the Interface designer? - or should it be done in scripting?

            Without problems that test the limits of your abilities, you can not expand them.

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

              @ThinkTank Need to do it through scripting.

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

              ThinkTankT 1 Reply Last reply Reply Quote 0
              • ThinkTankT
                ThinkTank @d.healey
                last edited by

                @d-healey

                There really should just be a:
                Sampler1.isEnabled
                funtion...

                And a function for enable and disable Samplers in scripting.

                Without problems that test the limits of your abilities, you can not expand them.

                LindonL 1 Reply Last reply Reply Quote 0
                • LindonL
                  Lindon @ThinkTank
                  last edited by

                  @ThinkTank said in Sampler (if enabled):

                  @d-healey

                  There really should just be a:
                  Sampler1.isEnabled
                  funtion...

                  And a function for enable and disable Samplers in scripting.

                  const var Sampler1 = Synth.getChildSynth("Sampler1");
                  
                  Sampler1.setBypassed(true);
                  

                  HISE Development for hire.
                  www.channelrobot.com

                  ThinkTankT d.healeyD 2 Replies Last reply Reply Quote 0
                  • ThinkTankT
                    ThinkTank @Lindon
                    last edited by

                    @Lindon

                    Does everyone use bypass and not enable/disable for samplers?
                    Isn't that a CPU drain or does it not matter at all?

                    Without problems that test the limits of your abilities, you can not expand them.

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

                      @Lindon said in Sampler (if enabled):

                      Sampler1.isEnabled

                      const var Sampler1 = Synth.getChildSynth("Sampler1");
                      Console.print(Sampler1.isBypassed());
                      

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

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

                        @ThinkTank said in Sampler (if enabled):

                        @Lindon

                        Does everyone use bypass and not enable/disable for samplers?
                        Isn't that a CPU drain or does it not matter at all?

                        It's exactly the same.

                        isBypassed = !isEnabled

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

                        1 Reply Last reply Reply Quote 0
                        • ThinkTankT
                          ThinkTank @d.healey
                          last edited by ThinkTank

                          @d-healey

                          Great. Now i feel even more stupid. :cat_face_with_tears_of_joy:
                          Then why is there a enable/disable parameterID at all?

                          Without problems that test the limits of your abilities, you can not expand them.

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

                            @ThinkTank If you're connecting it up via a button using parameter/processor ID you'll want to be able to differentiate between them. So you can choose if button on = enabled or bypassed.

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

                            ThinkTankT 1 Reply Last reply Reply Quote 0
                            • ThinkTankT
                              ThinkTank @d.healey
                              last edited by ThinkTank

                              @d-healey

                              I cant do something like this?

                              // KEYBOARD COLORING
                              namespace Keyboard {
                              
                                  const var KeyboardPreload = Content.getComponent("KeyboardPreload");
                              
                                  const samplerIds = Synth.getIdList('Sampler');
                              
                                  const samplers = [];
                              
                                  const KEY_COLOUR_OPACITY = 0.28;
                              
                                  const KEY_COLOURS = [
                                      Colours.withAlpha(Colours.darkcyan, KEY_COLOUR_OPACITY), // Sampler 1
                                      Colours.withAlpha(Colours.darkcyan, KEY_COLOUR_OPACITY), // Sampler 2
                                      Colours.withAlpha(Colours.darkcyan, KEY_COLOUR_OPACITY) // Sampler 3
                                  ];
                              
                                  for (id in samplerIds) {
                                      samplers.push(Synth.getSampler(id));
                                  }
                              
                                  KeyboardPreload.setLoadingCallback(function(isPreloading) {
                                      if (!isPreloading) setKeyColours();
                                  });
                              
                                  inline function setKeyColours() {
                                      for (i = 0; i < 128; i++) {
                                          Engine.setKeyColour(i, Colours.withAlpha(Colours.black, 0.2));
                                      }
                              
                                      for (i = 0; i < 128; i++) {
                                          for (y = 0; y < samplers.length; y++) {
                                              local s = samplers[y];
                                              if (s.isNoteNumberMapped(i) && !s.isBypassed()) {
                                                  Engine.setKeyColour(i, Keyboard.KEY_COLOURS[y]);
                                                  break; // Exit the loop once a non-bypassed sampler is found
                                              }
                                          }
                                      }
                                  }
                              }
                              

                              I just want to color the keys with Samplers which are NOT bypassed. Its a headache!

                              Without problems that test the limits of your abilities, you can not expand them.

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

                                @ThinkTank Sampler doesn't have an isBypassed function. You need to get the reference as a childSynth

                                8b04fddb-3488-4a16-8397-36317014ffbd-image.png

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

                                ThinkTankT 1 Reply Last reply Reply Quote 0
                                • ThinkTankT
                                  ThinkTank @d.healey
                                  last edited by

                                  @d-healey Thanks!

                                  Without problems that test the limits of your abilities, you can not expand them.

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

                                  35

                                  Online

                                  1.7k

                                  Users

                                  11.7k

                                  Topics

                                  101.9k

                                  Posts