Hi all,
Here's a script that allows to check the interactions between all the controls available, as well as priority of each control over the others. Hopefully this will turn out useful.
To show a control of a specific type, just enable its related button.
on init
make_perfview...
play_note doesn't trigger the note callback. You can test this by adding a message command into the NCB, no output is returned.
Allowing/disallowing groups is an event-level operation. In your case, you'll need to activate/deactivate the groups needed within the UI control callback. To handle...
Menu, buttons and switches share the same internal handling. They are pretty much alternatives to the same control, so that behaviour is expectable, but doesn't hold true for any other UI control.
Unfortunately the layering happens consistently only visually-wise. Everything underneath a UI control with a higher Z layer will be clickable. That's unfortunate and has been reported by many Beta testers already (including yours truly) but apparently there is no solution to this.
Actually I've just run some tests and I'd like to follow up to this.
With Kontakt 6's new UI controls, the order appears to be as follows:
TEXT EDIT - Highest
XY
TABLE
MENU
VALUE_EDIT
BUTTON
SWITCH
SLIDER
KNOB
LEVEL METER
WAVETABLE
WAVEFORM - Lowest
You need to set it up differently in order to handle frequency change smoothly. Instead of feeding the sin/cos functions straight with the frequency, you want to use a phasor and increment it upon every round of LCB. Basically, you need a Numerically Controlled Oscillator (NCO).
The concept is...
Why delete it? It might be helpful or inspirational to other people. You never know if someone else will stumble upon something useful for his/her job :)
I'm not sure if this question was posted before - the search option on this forum seems not to be working this morning.
Perhaps this is a dumb question, but never had a chance to do this before. Is there any way to retrieve the file name of a played sample? I thought there was some function...
If you still need help on this, in Koala I have added recently a function called math.scale that might help you with that kind of operations. Take a look at this https://github.com/magneto538/Koala/wiki/9.1---Math#mathscale
I guess the only case where it might be needed is if a new NCB is executed exactly when the current NCB is between the two lines in the if ($total_round_robin > 1) statement - which is a really unlikely event. Really unlikely. Close to impossible I would say.
That's really nice! Now that I think about it, I have used something vaguely similar (but much simpler as I didn't need that kind of precision) in an older project. There is a bit of +1/-1 to take care of according to the format you need the output to be (either zero or 1-based) but this one is...
Actually, you have a much higher rate of getting the same number generated twice in a row with less Round Robins. If you have 2 RRs, there is a 50% chance (theoretically) to get the same number that was generated in the previous call to the random() function, thus the while loop might perform...
The problem with this is: if you don't have a lot of round robins, the while loop might (potentially) be executed a ridiculous amount of times, so there should be a control over the amount of times the loop is executed.
Also, if you are using Koala, there is a pretty useful scaling function similar to Max MSP's 'scale' object. I have added it recently so perhaps people still don't know about it. You can set the min and max input value and the min and max output value. You can learn more here: math.scale
I have a drum library. As many drum libraries out there, I have an "external" mapping - C1 is Kick, E1 is Snare etc. - and an "internal" mapping that I use to handle Round Robins, alternates and stuff. Each note on the internal mapping is a different Drum Kit (I have RRs mapped over velocity).
I...
Really nasty indeed, but I cannot think of a better solution either. I have a bunch of different commands that trigger the async callback, so in my case it wouldn't be a clean solution at all - but I guess I'll have to stick to it.
Quote from KSP manual in regards of mf_reset() command:
This command is also asynchronous, and thus calls the async_complete callback
Now, if a command triggers the Async callback, it means that its Async ID could be stored in a variable in order to use it in the Async callback itself (just...
Not an option on my end - I cannot make the UI sloppy when the user is tweaking stuff. Bad UX indeed :) But in some cases this could actually be a solution.
Should I file a bug report for this one? Honestly I'm not sure how - but I am also sure that you know how to report this (and probably...
I totally confirm this.
I can totally confirm this and, after running some tests, I'd like to add something more: ANY UI related stuff in LCB causes this issue, including for instance changing a picture's state. Basically, anything that uses set_control_par(). The affected UI elements are...
Do you have any hint about what might be causing the issue? Is it a matter of time, or is there some operation that is causing this? I'm asking because I'm not at my computer right now so I can't check that myself.
I'm not sure whether this topic has been solved or not - I wasn't able to find anything on this forum.
I'm sure that many people have experienced this issue. Basically, when the Listener callback is being executed - actually, when SOME operations in the LCB are executed - I cannot type either...
Just to complete the stream of consciousness, here's my detailed(ish) solution.
I have to send the data in a string array from Slot 5 to Slot 1. This has to happen only upon loading the instrument. I have an int PGS key and a str PGS key. I have a for loop in Slot 5 that looks like this:
on...
That's how I'm doing it as well. Still, when you have to handle string PGS keys, that's where the mess begins. I see no clean solutions - apart, maybe, for having another PGS key used as a flag and set whenever a string key is changed. But that doesn't seem a clean solution to me.
+1 for David. The complexity about true legato is not about true legato at all - it's more about allowing the correct groups, being able to support a flexible (aka, not necessarily consistent) groups structure, handling different legato types (e.g. some articulations might have true legato...
If you are working with many PGS keys (which may be a common scenario), you might have a pretty dense PGS callback with many operations inside, one per each PGS key. Most likely, you want to avoid performing useless operations over data that haven't been changed by the PGS key that has...
Perhaps I haven't explained well what I'm trying to accomplish.
...which is exactly why I'm using it in the scripts above, the purpose of which is to measure how much time is necessary to perform one full loop of LCB.
Since LCB is supposed to be executed at regular time intervals, it's odd to...
Isn't it supposed to be used to "test the efficiency of script and not to make musical calculations" (quote from the manual)? How come it is unreliable?
As unreliable as it may be, anyways, the data I read match what I am experiencing.
So I did some tests and the outcome is, frankly, a bit scary.
First of all, I managed to change my script in order to match exactly the way West Africa deals with each step. Instead of worrying about the time elapsed since the sequencer was triggered (as I used to do before), I am now counting...
I'm sure it works, but the listener callback is there to perform these very operations. Plus, it gives you a lot more flexibility and precision when it comes to shift events over time (both back and forth). I'm running 16 parallel step sequencers from on listener and they work just fine - apart...
Hey folks,
I'm working on a step sequencer that has to be started when a MIDI key is pressed. This means no sync to the DAW transport, but obviously I need the tempo information coming from the DAW.
I need the sequencer to be able to handle realtime tempo changes. This means that when the BPM...
Not if I can send the active group from the first slot to the next one, right? I'd just have to be careful with ignore_event(). I haven't tried this solution on my specific case, which is why I'm just bubbling things, but I don't foresee any particular bottleneck.
Definitely makes sense. I'm working on a "slave" script that is meant to be used on various instruments with different features, and I need to get some info from the played note and store it in order to play that exact note with the exact same characteristics again. I'm trying to reduce as much...
Hey all,
I'm wrapping my mind up to understand if the activated group(s) per each note may be passed through script slots following the EVENT_PAR logic (thus, following the script slots order). The easy way would be using the assignable EVENT_PAR constants to send the active group, which is what...
KOALA - v2.2.0 AVAILABLE!
Added the new Live Monitor to the Debugger! Take a look at how it works at the Wiki on GitHub. Snippets for SublimeText updated to the latest version with all the recent additions.
The current version is 2.2.0. Follow the Installation guide in Koala's Official Wiki in...
This piece of code effectively turns the sample playback off after 60 seconds.
Forget about while() loops, meet the listener callback :)
{Deactivate instrument's playback after a while}
on init
declare $start_time
$start_time := $ENGINE_UPTIME
declare const $INST_KILL_TIME :=...
I see two issues here:
1) get_purge_state returns 1 as soon as the group is loaded. It doesn't wait for all the samples within the group to be loaded - I think. I'll give this a try, but I'm not optimistic.
2) I'm pretty sure that purge_group doesn't trigger the Async callback. In fact...
Hi all,
Is anybody aware of a way to check the status of each sample? I want to do something like "wait for the group to be loaded and then do something".
Thanks for sharing this Luca!
I've come up with a similar solution derived from your job.I 'm not sure that the behaviour of my take is exactly the same as yours as I didn't have much time to test it, but I'm confident it would be easy to be edited.
The aim here was to get rid of the on...
Doing this with scripting is as easy as it's difficult to do it without scripting. I'd stick with the scripting. Is there a particular reason why you'd rather not handle this with code?
Another workaround that works perfectly for me, as someone suggested, is to enclose the declarations in init callback within an always-true if statement. To save lines, instead of using x = 0, I would recommend the following (SublimeText only)
on init
if 1=1
// Declarations...
Here's another MASSIVE update for Koala.
I haven't been updating this thread in a while now, so here's the full changelog since the last version.
New snippets available as well
The current version is 2.1.6. Follow the Installation guide in Koala's Official Wiki in order to get you up and...
Unless the instrument you are working on is very simple, the scripts you will find on the internet are unlikely to be ready to be used out of the box. You will have to customize them to your needs. In this case, the script should be working if I'm not mistaken, but if you want a custom solution...
Hey folks. Reviving this thread because I'm working on a Kontakt library compatible with the Player (so it has to be signed and licensed by NI). I have never went through this process, as I've never worked on Player-compatible libraries. Since there aren't many informations available, is there...
Look for "fade_out" function in KSP Reference Manual. fade_out has three parameters: the first one is the Event ID you want to fade. You can store the Event ID of the currently playing events in a variable by assigning the play_note function to a variable, like this:
event_id := play_note(...)...
Definitely a nice idea - although it's not necessary for what I'm working on.
Using the principle stated above, I successfully got to have ramp, sine, unipolar sine and triangle wave, and that's enough for me at the moment. I will consider adding these into Koala so that these resources could...
Thank you for your answer Darius. Actually I got to the same conclusion and already set up things in the way you suggested. A topic that helped me quite a lot about this can be found on https://dsp.stackexchange.com/questions/124/how-to-implement-a-digital-oscillator .
Hello folks,
This is a math-related question.
I am using the majestic new Math features in Kontakt 5.6.5. Basically I am building an LFO using the script (so without the LFO module, which - for a number of reasons - is not an option in this case). I am using the sin() function to generate the...
I could have been more specific actually.
Yes, the main issue we all experienced seems to be fixed (haven't used much level meters on K5.6.5, but seems to be ok). The issue persists if you try to process the level meter afterwards (e.g. moving it or resizing it), which is an unlikely event to...
That's a UI bug in Kontakt. I have experienced it so many times now but seems not to have been fixed in K5.6.5 either. Could you provide more info about the script, Kontakt version etc.?
Eventually I worked it out by using the async callback, but the issue persists. Now I just have to be careful not to use the logger inside the scan function.
Yeah, but I have to be careful not to mess up all the presets once they are 'official'... The logger should have its own dedicated callback, but until NI won't let us define custom callbacks I don't think there are other solutions.
I am not saving and loading the same array. The logger is...
Ok, I think I came up with something about this.
I am using Sam Windell's fork of SublimeKSP. As you may know, it features a live logging system thru its activate_logger() function. This function adds some script at the end of the compiled Persistence callback:
while (9=9)
if...
Hi all.
I am setting up an NKA-based presets management system. In order to easily import NKAs, I will have the user triggering manually the scan using the File Selector (just like it happens with the scan in Output Exhale).
I have two UI elements here, a button (presets_scan) and a File...
Ok, got it. It was pretty easy. I am using array_equal and I was comparing two different-sized arrays. I lost it in the vaste script I am working on. :)
A brand new Script Warning popped up today. I had never seen this before.
As much as its meaning seems crystal clear, I am not sure where to look at in order to fix this. I mean, this kind of error is commonly handled by "array index out of bounds". In addition to that, I don't know why the...
Hi everybody,
I am very pleased to announce the release of Koala 2.1.0.
This new version adds full support for Kontakt 5.6.x, thus includes new math functions based on real numbers, XY Pad with advanced functions, new snippets and a lot more stuff.
The update is available through...
I see why sort() and array_equal() work only with int arrays (even though sounds like a useless limitation to me), but num_elements should definitely work even with real arrays as the size of an array is an int value. We'll see what NI says about this.
Hello (again).
I am having issues with num_elements and XY pad. It appears not to be working, even if the XY pad is an array-based UI control, just like tables - the difference is that XY pads are based on real numbers arrays instead of integers.
"Standard" real arrays appear to be working...
Clear as crystal. I didn't have a chance to use automation so far, so I didn't have any experience with that. I also thought that CONTROL_PAR_AUTOMATION_ID was introduced with K5.6 actually (the changelog calls it a "new control parameter" under K5.6 section...). Thanks for helping Mario :)
Thanks for the heads-up. I had already checked the manual, but it doesn't really explain how to handle that, nor it has any example. I mean, there is no info about how to process those IDs anywhere in the manual (or, at least, I couldn't find any) so I'm not sure about what has to be done after...
Hello folks,
I'm getting into Kontakt 5.6.x these days (finally!) and I am collecting info about the new features included in the new version in order to update Koala.
As far as I've seen, very little informations are provided by NI about the new CONTROL_PAR_AUTOMATION_ID, as well as how it...
20000-30000 lines usually, but I have been working on quite complex stuff so far and I love using macros with text replace, so I guess it might be less than that... Let's just say I like to have a few more lines if that can save me hours of copying and pasting stuff.
Hello Paolo,
And as usual it's great to hear your opinion, you know it's really important to me. :)
The downloadable version is a Lite version so the Full one is going to be more complete (some of the features you listed are already there, in fact), although I see some future developments. The...
Here's the Lite version beta! Anybody interested in testing the Full version please contact me at [email protected], I'm still looking for testers.
https://www.dropbox.com/s/4npvtnw8fxevbjn/Koala%20GUI%20Maker%20-%200.9.0%20LITE.zip?dl=0
Cheers!
The day has finally come (what an introduction).
Meet Koala GUI Maker.
This tool is a Kontakt instrument that allows the Developer to build the GUI for his/her Kontakt instruments. The tool is able to generate an output script which can be compiled using Koala library (info here...
A great way to handle things would be using an NKA for each preset and have a function which scans all the NKAs on startup, retrieves each preset's name (from the NKA file name) and loads a menu with them. Each time I click on a menu entry, the NKA whose name is the same as the menu entry is...
I see. But the issue with Snapshots is that you cannot decide which controls have to be recalled and which need to preserve their value.
Let's say I have a Preferences pane in my instrument. I don't want the controls in the Preference pane to change when I load a Snapshot: they must retain...
Hello folks,
I have my own method to handle presets inside Kontakt - I basically have an easy way to hard-code factory presets and handle all the user presets with a single, separate multidimensional array.
I am looking for an easier way to handle this. The best thing would be to use separate...
Great job! I am currently working on an addition to Koala, my own library, to create a GUI and export its script. This will allow any GUI to be processed using the extremely advanced functions of Koala - which turns out to be useful in development.
Hello guys.
I am trying to create an endless encoder in Kontakt. I am using a slider with an encoder picture on. Originally, my idea was to do so:
1. in on ui_control callback, check when the slider reaches its maximum or minimum value
2. when the maximum is reached, set automatically the...
Hello guys.
Not sure anybody already released any info about this... Is Nils Liberg going to release any update to SublimeKSP to integrate the new Kontakt 5.6 additions? I am looking forward to update Koala with new stuff.
Hello people.
Today I am pleased to announce the release of Koala v2.0. It has a ton of brand new stuff which will make your scripting even easier and faster.
Koala and its snippets are available from Package Control. The installation has changed a bit since v1.0, so make sure to check out...
$NI_CB_TYPE_ASYNC_COMPLETE works. The problem is that Sublime Text (and SublimeKSP itself) does not recognize $NI_CB_TYPE_ASYNC_COMPLETE, therefore it won't compile anyway.
Hello folks,
I am trying to use $NI_CB_TYPE_ASYNC_OUT but the script won't apply. The error I get is "Variable $NI_CB_TYPE_ASYNC_OUT was not declared". I am running Kontakt 5.5.2. Is there anything special about this constant?
What is Koala?
Koala is an advanced scripting library for Kontakt KSP developers. The latest version is v1.0. The Koala project is open source and covered by MIT licensing system.
The official web page of the Koala project is available here.
This thread will be updated with updates and...
Right. Thanks for the advice. I changed the licensing to MIT, so you are free to use the library in any commercial product now.
I am going to create a separate thread for updates to the library in order to keep things organized.
Sorry people for the late response.
Thank you all guys for your support about GPL licensing. At this point I really need to consider another licensing system (which I am relatively new at, so any suggestion on this side?) which allows companies to use this library.
I'd love to expand the...
Thank you!
I am using some big arrays for each possible setting here, so that, let's say on position 10 of every array I have data for a specific UI control. E.g. I have a button which is UI control #10 (which follows the declaration order): all its data are stored in each array's position #10...
Hello guys.
[EDIT 2017-06-03]
Here's another MASSIVE update for Koala.
I haven't been updating this thread in a while now, so here's the full changelog since the last version.
New snippets available as well
The current version is 2.1.6. Follow the Installation guide in Koala's Official Wiki...
Yeah, I already added everything to KSP.tmLanguage, I forgot to mention that.
Sad news, though. I was really hoping to speed up a lot the workflow, as my library has a great amount of functions. But if you need to go and check the correct syntax on the manual everytime you need to write...
Hello people.
I am working at a custom library of functions for KSP developers. It's quite a massive job which took 9 months of work so far.
So I'd love to add my custom functions and macros to ksp_builtins_data.py in order to speed up the workflow.
Here's my problem. When I add a function...