HISE Logo Forum
    • Categories
    • Register
    • Login

    How do I send 'noteOff' messages from UI Button?

    Scheduled Pinned Locked Moved Solved Scripting
    7 Posts 2 Posters 72 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.
    • ChazroxC
      Chazrox
      last edited by

      Pretty much what the title says.

      ChazroxC 1 Reply Last reply Reply Quote 0
      • ChazroxC
        Chazrox @Chazrox
        last edited by

        @Chazrox

        found this...see if it works...

        Synth.noteOffFromUI(int channel, int noteNumber)

        VirtualVirginV 1 Reply Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin @Chazrox
          last edited by

          @Chazrox said in How do I send 'noteOff' messages from UI Button?:

          @Chazrox

          found this...see if it works...

          Synth.noteOffFromUI(int channel, int noteNumber)

          I haven't use that one, but this is the one I use and it works for me:

          Synth.addNoteOff(int channel, int noteNumber, int timeStampSamples)
          

          You can listen to my orchestral mockups here:
          https://www.virtualvirgin.net/

          ChazroxC 2 Replies Last reply Reply Quote 1
          • ChazroxC
            Chazrox @VirtualVirgin
            last edited by

            @VirtualVirgin Thanks! What do you recommend for timeStampSamples? How is that applied here? This is my first time doing something like this.

            VirtualVirginV 1 Reply Last reply Reply Quote 0
            • VirtualVirginV
              VirtualVirgin @Chazrox
              last edited by VirtualVirgin

              @Chazrox use timeStampSamples = 0

              There is also another method depending on how you need to handle noteOn and noteOff.

              If you use

              Synth.addNoteOn(int channel, int noteNumber, int velocity, int timeStampSamples)
              

              to add your notes I believe it returns the eventId.

              With that you can use

              Synth.noteOffByEventId(int eventId) 
              

              to match notes you made with the first method.

              So for example:

              local  eventId = Synth.addNoteOn(1, 60, 127,0);
              

              Then you can supply that eventId to make the matching noteOff.

              You can listen to my orchestral mockups here:
              https://www.virtualvirgin.net/

              ChazroxC 1 Reply Last reply Reply Quote 1
              • ChazroxC
                Chazrox @VirtualVirgin
                last edited by

                @VirtualVirgin Thank you 🙏 This looks promising. I'm gonna try this out now!

                1 Reply Last reply Reply Quote 0
                • ChazroxC
                  Chazrox @VirtualVirgin
                  last edited by

                  @VirtualVirgin This worked best for me! Thank You! I got it working with my chord script perfectly. 🙏

                  Bingo:
                  Screenshot 2025-06-20 at 11.38.07 PM.png

                  The script:

                  		for (i = 0; i < chord1.length; i++)
                  		{
                  			Engine.setKeyColour(i, NoKeyColour);
                  			Synth.addNoteOff(1, chord1[i] + 60 + Octave1 + Chord1Choice - 1, 0);
                  		}
                  
                  //THANK YOU!
                  
                  1 Reply Last reply Reply Quote 1
                  • ChazroxC Chazrox marked this topic as a question
                  • ChazroxC Chazrox has marked this topic as solved
                  • First post
                    Last post

                  24

                  Online

                  1.8k

                  Users

                  12.0k

                  Topics

                  104.2k

                  Posts