Play notes in sync with host

rootstudio
rootstudio Member Posts: 6 Newcomer
edited January 9 in Scripting Workshop

I would like to have Kontakt play itself like so:

In my GUI, I have a representation of a one-octave keyboard. I can click each key to activate it. Let's say I click the 'C' key.

When I start the host, the C should repeat in sync with the host tempo. I can probably figure out how to do subdivisions etc., but I don't know how to trigger a note using just the host clock without actually playing a note on my MIDI keyboard.

Thanks

Comments

  • medusa
    medusa Member Posts: 81 Helper

    You can do it, use the listener callback.

    on init
    set_listener($NI_SIGNAL_TIMER_BEAT, 2)
    declare ui_switch $C
    end on
    
    on listener
    if($C = 1)
    play_note(60, 60, 0, $DURATION_SIXTEENTH)
    end if
    end on
    
    
    
    
  • rootstudio
    rootstudio Member Posts: 6 Newcomer

    Ooh, thanks for pointing that out. That will give me something to try out :)

  • rootstudio
    rootstudio Member Posts: 6 Newcomer

    Got it to work, thanks so much. Now how do I mark this as solved in this forum??

Back To Top