yet another noob KSP question

Sampler and Sampling discussion (techniques, tips and tricks, etc.)
Post Reply New Topic
RELATED
PRODUCTS

Post

A question about Kontakt scripting. I wonder, if anyone has some experience in this. Is there a way to trigger a callback event within one script, not counting psg and listener callbacks? I thought a controller or rpn callback would do this, but it looks like the script does not react to controller changes it generates itself.

Post

If you need to trigger various stuff, usually you'd use a user function, then trigger it from wherever you want. Other than that, no, you cannot trigger different callbacks at will (except triggering note callback with play_note() and triggering ui_control callback of ui_file_selector with fs_navigate() in K5...)

Post

This is something I really miss in KSP. I wanted to trigger some animated event from another script slot, it involved a lot of waiting in-between steps. I cannot call this from within "on psg change", because of the way it works, psg change will not be updated in any script slot, until current psg callback is executed, so it effectively blocks all communication until finished. I need to move it out of psg callback, but there is no other callback I can call from within a script. Workaround is having listener callback constantly check on some variable, but it's way tedious.

Post

I don't see a reason why not to use PGS here... when you want to invoke the animation in another script slot, just send a dedicated PGS event from a different script slot to run it. Not a problem to do that at all.

Post

I have four script pages, which communicate via psg, Kontakt will not update 'psg changed status' until a psg callback ends, so if one psg callback is waiting for something, others will not trigger.
BTW. do you know if it's possible to assign midi channel to notes Kontakt is sending to outside world, that are generated by an instrument's ksp? I was trying $EVENT_PAR_MIDI_CHANNEL, but it seems it does not work from instrument level.

Post

Zombie Queen wrote:BTW. do you know if it's possible to assign midi channel to notes Kontakt is sending to outside world, that are generated by an instrument's ksp? I was trying $EVENT_PAR_MIDI_CHANNEL, but it seems it does not work from instrument level.
Nope, not possible.


Regarding PGS, you can delimit when something needs or needs not to be done in a PGS callback by using pgs_key_exists() along with testing if the pgs key value has changed. I usually have multiple PGS keys for different stuff that needs to be done, and this helps in executing only parts of PGS callback, not the whole of it. So usually a key has two indices: one that is actually carrying the data value that needs to be transferred, and the other that is just a R/W flag, I set it to 1 when I want the PGS executed, and then in that branch within PGS callback I set it back to 0, denoting that it's finished with sending what's needed.

Post

Yes. But, as I said, when one psg callback hasn't finish, another won't trigger, it won't detect any psg value changes until the last one comes to 'end on' line.

Post

In that case, I would use the listener callback instead, in a similar fashion as PGS example I laid out above. That should work.

Post Reply

Return to “Samplers, Sampling & Sample Libraries”