Forum

    • Register
    • Login
    • Search
    • Categories

    while note is held

    Scripting Forum
    2
    2
    59
    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.
    • M
      matifena last edited by

      Hi, i just started using hise, and its my first time posting in here , english is not my mother tongue so sorry if i write something wrong.
      In kontakt you can use " while ($NOTE_HELD = 1) " to make something happend while a key is pressed and held, is there a function like that one in hise scripting?

      Thank you

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

        No that is not possible. Script callbacks are supposed to return immediately so any kind of "thread management" (sleep, while, etc) is not available.

        What you need to do is to set a variable to true in the onNoteOn callback, then query it somehow (either using a timer callback or other callbacks) and reset it to false in the onNoteOff callback.

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

        18
        Online

        1.1k
        Users

        6.7k
        Topics

        62.1k
        Posts