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.
    • d.healeyD
      d.healey
      last edited by d.healey

      I found a redundant if statement.

        if (Synth.isLegatoInterval())
                  {
                      local dif = LastNote - Message.getNoteNumber();
                      if (AllKeys.getValue() == 1 && Synth.isLegatoInterval() == false)
      

      The second isLegatoInterval() will never be false. This isn't part of the issue though.

      A quick fix to the error you're getting is to alter your port script's note off callback like so:

                          if (Message.isArtificial())
                              Synth.noteOffByEventId(tid);
      

      You'll get some nice new hanging note issues to fix when the mono script is disabled :)

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

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

        @d-healey said in Synth.isNote(eventID):

        if (Message.isArtificial())
        Synth.noteOffByEventId(tid);

        Thanks yeah the redundant if statement I know about - being lazy again...

        So this sorta works - in that it fixes the problem if I check in the porta script if mono is running and handle each case slightly differently.

        But this breaks all sorts of encapsulation guidelines I'd really like to keep to....

        HISE Development for hire.
        www.channelrobot.com

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

          @Lindon so back to my first point/question(s)

          any one know if this is do-able and would be willing to give it a shot?

          HISE Development for hire.
          www.channelrobot.com

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

            @Lindon I think it's doable, but I think I'd need to rewrite the port script somewhat. Could you give me a breakdown of what the port script should do so I don't have to reverse engineer yours?

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

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

              @d-healey yeah I mean give it a shot at adding in the C++ code to get us to

              Synth.isNote(EventId);

              HISE Development for hire.
              www.channelrobot.com

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

                @Lindon Oh I meant independent mono and poly scripts working in harmony was doable, I'm sure the isNote thing is doable too but not sure how to tackle it.

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

                LindonL ? 2 Replies Last reply Reply Quote 0
                • 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

                          25

                          Online

                          1.7k

                          Users

                          11.8k

                          Topics

                          102.7k

                          Posts