HISE Logo Forum
    • Categories
    • Register
    • Login

    How to use KeSwitch for global muting?

    Scheduled Pinned Locked Moved General Questions
    5 Posts 2 Posters 246 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.
    • CatABCC
      CatABC
      last edited by

      How to use KeSwitch for global muting?

      When the key is pressed, global is muted, and when the key is released, the sound is restored to the state before muting.

      ea0f2123-b399-4e4f-ac9b-63b72e0773c1-image.png

      //I am a new student at HISE._
      //Windows11 & MacOS Ventura 13.6.7_

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

        @BobCat There are a few ways to do it. If you want it to kill the notes then you'll need use Engine.allNotesOff() if you want them to keep playing but just have the volume drop I would use a simple gain module. In the on note on callback you can set the Gain to -100 and in the on note off callback you can set it back to 0.

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

        CatABCC 1 Reply Last reply Reply Quote 0
        • CatABCC
          CatABC @d.healey
          last edited by

          @d-healey I want chose to turn off and on the main switch of Container through note on/off, but I don't know how to write the code. Could you please tell me how to write it? Thank you very much. Sorry, I am a novice.

          if  (Message.getNoteNumber() == 89)
          

          //I am a new student at HISE._
          //Windows11 & MacOS Ventura 13.6.7_

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

            @BobCat said in How to use KeSwitch for global muting?:

            I want chose to turn off and on the main switch of Container through note on/off,

            I wouldn't advise doing that, you'll get some nasty pops and clicks. If you want to dip the volume use a simple gain effect as I described above. If you want to prevent MIDI coming through then use a MIDI muter script.

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

            CatABCC 1 Reply Last reply Reply Quote 0
            • CatABCC
              CatABC @d.healey
              last edited by

              @d-healey This will cause a problem. When the key is release in a short time, the sound before muting will continue to play. I hope that after muting, there will be no sound.

              //I am a new student at HISE._
              //Windows11 & MacOS Ventura 13.6.7_

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

              13

              Online

              1.7k

              Users

              11.8k

              Topics

              103.0k

              Posts