HISE Logo Forum
    • Categories
    • Register
    • Login

    All voices Killed callback?

    Scheduled Pinned Locked Moved General Questions
    7 Posts 2 Posters 364 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.
    • DanHD
      DanH
      last edited by

      Is there a way of firing a callback when all voices are killed?

      There are multiple instances where this happens, loading sample maps, switching certain modules on and off etc. I'm using Engine.allNotesOff in a few functions too and it's getting rather messy trying to control a couple of UI things which need to disappear when all the voices are killed...

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

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

        @DanH No, but you can manually check how many voices are active and then perform some action

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

        DanHD 1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @d.healey
          last edited by

          @d-healey thanks :) So trying something a bit weird:

          I have a button that plays a note when on. Some other buttons kill all voices - this is fine, and the play note button remains in the on position. But I'd like then to be able to click the play note button and have it play the note again from its 'on' position. The button can't be momentary (thus far at least). Obviously the below doesn't work but it's a starting point!

          inline function onPLAYNOTEControl(component, value)
          {
          	if (value)
          	{
          		Synth.playNote(53, 127);
          	}
              
          	else if (value == 1 && Engine.getNumVoices() == 0)
                  {
                          Synth.playNote(53, 127);
                  }
              
                  else
          	{
          		Engine.allNotesOff();
          	}
          };
          
          Content.getComponent("PLAYNOTE").setControlCallback(onPLAYNOTEControl);
          

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

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

            @DanH

            Some other buttons kill all voices

            Why not turn off the first button in this button's callback?

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

            DanHD 1 Reply Last reply Reply Quote 0
            • DanHD
              DanH @d.healey
              last edited by DanH

              @d-healey that's a good question - because it serves a further purpose to be in the 'on' position - a visual signal to the user

              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
              https://dhplugins.com/ | https://dcbreaks.com/
              London, UK

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

                @DanH You could use another variable that represents the true state.

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

                DanHD 1 Reply Last reply Reply Quote 0
                • DanHD
                  DanH @d.healey
                  last edited by

                  @d-healey I've made this - gonna store here while I apply to my project in case I lose it 😆

                  HiseSnippet 1220.3oc4X0zaaaCFlxNJnxcqXcnEaGEJ1AGfz.K2uFPQQchsSWvhiMhyZ2NUvHQaSDIRAJprZTz+a6mv9Ira65ttSaujRxRJQ1yyasCaSGLz6WjO7kueIORvcIQQbAxv5r4gDjwGYNdNSNq6LLkgNpGx3VlCvQRhvNg0AyCwQQDOjgQ8WnXXXsER+7KO+.rOl4RxYgPujScIGSCnxbti570Te+CwdjynAEz9gcNxky5x84w.dpa1BEhcu.OkbBVoVMSjw188nRtXrDKIQHisNf6Me7L92yRz+kzH549DEgCZLrPIrOj66oPr5cT2YTeuQYm6HDxvbTtWndhW3NlCndzE7y8FehVfctEE8GF0JCu5kfmyxfWEPxn.j1JAR21brqfFJyknvyMMOhAWNSvfauHTRzEU6WqY1kCZvj6Efufbn.HVXQyG2p0t1vO67zFMDjo1g934Ltj.WCRA229Y1s.ITlOkQrmDybkTNylyFc79e2ICOqe2D8Z5xCB4LXS109RreLYmFusgEchcyTJKfzRGWsmZKNA1hlO5A6Z6z9IvVaYc880AX+tF1vSCKheDwVsZWSsmY2dGsRpm2t3srmktiYJjtCYjpMJAq8YSgi7dXeekkQCmLo4R.ZKMPeG3lx7ySIxtY9il2KyUcuc1KRIPaWWXgOGhsadMWo5lnBG9AwRIm4rR+8Rv70gb6mtB7ltSKCtkABr9E.oZaGxZpASCv0dUQJ.Ugrz0xmHpTrpFgXUF1jEGbNQTzUnTDRbJmMt85kM5l3VJnHmcDiJGFRRoyKm3TQtKJ0uBYw0RQHnpTmCeqzb3DuHhBKRCyrH.jF+EKdhVC6sLSuRpv7u4ndXIVUNIES.NCIBIU4NL5QtDpMmTbwxrGI5BIOTC5zfAvCtNv9MPETieF1t4pWtugF2KVhsWCj+lEn9G76LeAQm3NDFFthTkbOlfELUkMZz.d.rzXAnoQMz0qTB0n4dw9XY4B2ptUoBf3mRUKUUDYQT47hcytZ07sVd7SqJa1TYzwZB2aaNhJcmUMdqUAdUgaumwaZuwO1r+jIDWYNX2x7vuckMB+aGJ2MAJ2z7U3KI5x7ZfbWM8DtHv9EDFQn7oNqXjkebcGYIbsGYYnqDfvYBLKJjGQbJtxWQV6hx5QjwrxpmvpjVpi2gvwqfd2nSFy1EYNByJsX.coUZ.MOqC8SOuuNQarpKg2vHW3vp7cESGFECcGeE0SNyong4raWj8WgEdv8hao.z5qcTQwBxkyaKneEyMs86qQ49fl7+WuVU80Ct+ASdZkgwwzfPeRe1kDenAhFieJzwXBN1Wlwsbd1.NiGNiynkh.NkHEzoSIkBrp7.suTBCbjy4NcNk3SvQEx89hNGCy6fEfehrg9h+7SgW480mal.WaUwA6+azio9+66wr5LTn94+dto+LSnldaa80s8+722mxikT1zAXnZfZ5wShCFCMPcI.hYL3qvTCRVSMGYBcKEsBNiILOMwuAOoBcTzFoBcxD9AYOBvtB9qS+vJUAian4.mal9ervxbfh1dwr4lls1qEJ.Z67ZWWUL88A+S01zdCr4AafMObCr4QafMOdCr4IafMe4JsQ0we+XIOHI9GXLpu9ajLLRl.RmJf9c3nOUXO
                  

                  DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                  https://dhplugins.com/ | https://dcbreaks.com/
                  London, UK

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

                  54

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  101.8k

                  Posts