HISE Logo Forum
    • Categories
    • Register
    • Login

    Synth.isNote(eventID)

    Scheduled Pinned Locked Moved C++ Development
    25 Posts 5 Posters 1.2k 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.
    • LindonL
      Lindon @d.healey
      last edited by

      @d-healey - thanks.

      @Christoph-Hart - is there anything else we'd need other than what i outlined in the OP?

      HISE Development for hire.
      www.channelrobot.com

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Yes, you will need another method in EventIdHandler:

            /** Checks whether the event ID points to an active artificial event. */
            bool isArtificialEventId(uint16 eventId) const
            {
                return !artificialEvents[eventId % HISE_EVENT_ID_ARRAY_SIZE].isEmpty();
            }
        

        and call this instead of popNoteOnFromEventId(), because this method removes the event (hence the name pop...).

        However this is a pretty shallow advice. I can't guarantee that there are no unwanted side effects, as the system of assigning artificial event IDs is pretty delicate (AFAIK you can't have multiple artificial notes with the same note number and channel for performance reasons)...

        1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart
          last edited by

          BTW, you can query if a note is already artificial and use that info in the second script:

          HiseSnippet 794.3oc6VssaSCDDc2zXDIhhnB9.r5SIBnJtTtH3AZaRJJBRaDoTwaUasG2rp16ZYuNPTU+s36h+.XV63ZmV2aVphWXUjb14lOy3yryNJTZCQQxPBsw9yB.B8QFimITS5NgwEjA8HzGaLjEofPyTQaOKfEEANDJcoOoEPaTmjr98G2l4wD1PtHB4.I2F9B2mqxkNZyOy871g4.6y8KX8FaNvVJ5J8jwHdVxnCIfYeB6XXWl1rZFD5C56vUxvwJlBhPa1V5La7D4ODo1e.OhejGn2XQFiAJULo6DtmynrbMhPn0Gkm4Kkl4OyXH2get77JvSRTXl6QwZ.s1hPp9BPx5pfzNROGc.tB3Uq.7pmBuULFaGxCT4ZzX6oykliNqhvqVpVRseQMLciE1JtTXJE6JUvdhVsadZyFckhHoGrVPHWnZs5dByi.WYH7dyUMet4PLn3mf0NFT8mBB0.mVsa+gkaZhqLc9rSfsBUbWtMm40RqtjnxbQVzMGzlm07RH00sbn55dufULr2HXu.LwPnBkddPXJRufZMQubMycrkH1+HH7ElSYdwv4Fhe8Wjd071Quv9HEB0BFJECDb0dAv7VkLNPlDKx405hFkmWEkljNkXVtnKyoIcSwD9uuMnGSwPZNctLzt..+nnyPZOXJdlQJougQOH5DkL.O0nxcDquPCaVGg5V2QLFvxoy0SwZf+3tsxTyiJxwZmRAOM8gdcg2fTMAOfUJ.SdjICgzTX0Lh6YoO.uH3NEFt3xA5ZZs9Oe9eNeFmyHch8XpEG9nmxNWAVhWfKOP+1h3pYEmBeGlH0ozIRVkks2R3thwHtxdR43sVI3UOr6dFuymuurQeWWvVkC15F678pNL+N.kuJiUbwwCYpP9OITici8GiWwwFPjHDXiMJiVSynR22QuWWYFCBmjM+AWyUZo2SmqzJSIwmYGJOzNk1puAwCSjfXRjb4oF3s3v8lVjjFRzOiNq0g3iWr4Paaco3kH1K2m0qfOupB9rQE740Uvm2TAedaE74cWqO56TtUrR5m1lfBF0O4XDJsufgrrDFI4uPCl7HI
          

          So your Synth.isNote() function can be written in HiseScript like this:

          // You don't need the event id, just make sure you never call this method 
          // outside the `onNoteOn` / `onNoteOff` callbacks..
          inline function isNote()
          {
              return Message.isArtificial();
          }
          
          1 Reply Last reply Reply Quote 0
          • gorangroovesG
            gorangrooves
            last edited by

            @Christoph-Hart I'd like to add my vote to @Lindon's request. It appears that my plugins would benefit from it too :)

            Goran Rista
            https://gorangrooves.com

            Handy Drums and Handy Grooves
            https://library.gorangrooves.com

            1 Reply Last reply Reply Quote 0
            • ?
              A Former User @d.healey
              last edited by

              @d-healey many ways yes!

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

              20

              Online

              1.7k

              Users

              11.8k

              Topics

              102.7k

              Posts