# Koala KSP Library for developers - UPDATES THREAD



## magneto538 (May 31, 2016)

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 in order to get you up and running: https://github.com/magneto538/Koala/wiki

*Koala is available on GitHub and Packagecontrol.* Once again, please follow the Installation guide on Koala wiki to understand how to get it.


*____ FULL CHANGELOG v2.1.1 - v2.1.6 ___________________
*
* *Added new E2V and V2E INLINE functions* from BigBob's Math Library for Kontakt 5.6+.
* *ADDED EASING FUNCTIONS*! With Kontakt 5.6's new real Math operations, it's now possible to use easing functions to enhance your UI animations and handle complex curves for any kind of application, be it UI or Engine-based. Take a look here http://easings.net/ for more info! Kontakt 5.6+ only.
* *Added Family Masks!* now each UI control can be assigned to *multiple Families*! This allows you to create Subfamilies as well.

* Added a lot of new *Bool and Math functions*: math.fmod, math.note_to_freq, math.freq_to_note, math.trim, bool.is_greater, bool.is_not_greater and many more. Read the full list on the Wiki.
* Added new *real Math constants* (~MATH_2PI, ~MATH_LN2 and more)

* Added new *UI management* functions: scale_slider_out
* Added a *Show/Hide button* next to the UI control's name on UI view. This button allows you to temporary show/hide the currently selected UI Control.
* Bugfixes

Have fun scripting with Koala!


----------



## EvilDragon (May 31, 2016)

This is pretty cool!

I'm still pretty much ok with my method of working - which involves having ALL controls assigned to one UI ID array, and then having individual arrays for parameters that need text strings, which one big CONTROL_PAR array that holds all the other parameters for positioning, dimensioning, defvals, mouse units, fonts, visibility etc.

It is a bit more work, on the other hand I have more control over WHEN I want make_persistent to happen (in my case it's most often right after going through CONTROL_PAR array, but for some controls, like file browsers, I usually need persistence for them earlier), for example. And there's no overhead in lines of code that declaring sets of controls into families and individual arrays for control parameter values would have. On the other hand, if I need to add a control in the middle of the UI ID array, I'm a bit f'cked. Especially if there were custom ranged while loops downstream in the script. It doesn't happen often, but it does make me cringe when it does. :D

However it's nice to see people making their lives easier  The debug tool here might prove very useful to many.


----------



## magneto538 (May 31, 2016)

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 so that every information can be used and processed later (and shown in the Debugger, of course). It's the exact opposite of what you are doing, if I got it correctly, but it works both ways. 

Usually I don't like to use make_persistent over a single UI control. I'd rather store each UI control's value inside an UI status array (which can be done using a function inside Koala) in each ui_control callback and make that array as persistent. By doing so, it is much simpler to handle, for instance, an internal preset engine (which I always use in my projects), because I have one big array with each UI control's value available in any moment. So I don't really use make_persistent on individual UI controls, only on some variables and on the huge UI status array, which I recall when I reload the instrument. 

Families, though, are extremely useful to process groups of controls at a time: they cost - I think - 4 lines of code per UI control, but when it comes to hide and show UI controls by groups they save so much time you really don't give a sh*t about that :D


----------



## EvilDragon (May 31, 2016)

Here's an example of how I usually construct stuff:


----------



## EvilDragon (May 31, 2016)

On another matter, doesn't GPL licensing effectively make this library unusable for commercial projects, since GPL requires making full source code available?


----------



## tack (May 31, 2016)

EvilDragon said:


> On another matter, doesn't GPL licensing effectively make this library unusable for commercial projects, since GPL requires making full source code available?


Yup. I was just about to say that.


----------



## FrozenPlain (May 31, 2016)

Looks really interesting! The array functions look like the most useful to me. Fantastic work with the manual by the way, it's very well laid out and comprehensive.


----------



## tonaliszt (May 31, 2016)

Certainly, this is a very cool idea. However, it doesn't seem to be working correctly for me. 
I tried to create a simple GUI, and it wanted me to declare my wallpaper as a variable. After compiling and pasting into Kontakt, it didn't work there either. 
I am relatively new to KSP, so maybe there is something I am missing. I would love to know to know if this is working for anyone else. It seems like such a cool idea.


----------



## Reegs (May 31, 2016)

Great idea.

But yeah, GPL is an issue for any commercial use. It would mean that the scripting source code (secret sauce) of each library would have to be released alongside the nki's. MIT is probably the way to go here, if you're interested in seeing commercial adoption.

If you don't like MIT, there's a few others too: http://choosealicense.com/


----------



## tack (May 31, 2016)

Reegs said:


> But yeah, GPL is an issue for any commercial use. It would mean that the scripting source code (secret sauce) of each library would have to be released alongside the nki's.


I suppose by "commercial use" you mean closed source? It doesn't _have_ to mean that.

The source code wouldn't necessarily need to be _released_ alongside the NKIs. But under the terms of the GPL it _would _need to be made available to those who request it. The company could even charge for that -- although couldn't prevent redistribution by whoever paid, so there wouldn't be much point in charging.


----------



## Udo (May 31, 2016)

For some more details about Koala - https://en.wikipedia.org/wiki/Koala


----------



## Jdiggity1 (Jun 1, 2016)

tack said:


> I suppose by "commercial use" you mean closed source? It doesn't _have_ to mean that.
> 
> The source code wouldn't necessarily need to be _released_ alongside the NKIs. But under the terms of the GPL it _would _need to be made available to those who request it. The company could even charge for that -- although couldn't prevent redistribution by whoever paid, so there wouldn't be much point in charging.



Tack's right. You can still sell products built from this source code, but anybody is free to also take that code and sell it under their own name. This is how the Wordpress marketplace works too.


----------



## tack (Jun 1, 2016)

Jdiggity1 said:


> You can still sell products built from this source code, but anybody is free to also take that code and sell it under their own name.


Kind of, for certain values of "own name." GPL doesn't obviate copyright -- in fact it very much stands on its shoulders. So although one can _redistribute_ GPL licensed software, and could even charge for that redistribution, the original copyright notice (and owner) and GPL terms must be preserved in the redistribution, and the source must be in turn made available by request by the person redistributing non-source versions of the software.

But now we've veered terribly off course from the OP


----------



## FrozenPlain (Jun 1, 2016)

It would be cool to see this library using the new compiler  There are things that the new compiler features can do to make this library even better. For example the list_add() function instead of count variables and inc() commands to add elements. Or using the new UI property functions to set the an optional number of UI properties, so you only set what you actually need. Or using the UI arrays for batch making UI, and adding them to an array.


----------



## magneto538 (Jun 5, 2016)

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 developing team by keeping this library open source, so which licensing system should I consider using? Like, what are Nils Liberg's SublimeKSP and Big Bob's (RIP) Math Library using? Because I think that these are widely used for commercial products.



n.h said:


> Certainly, this is a very cool idea. However, it doesn't seem to be working correctly for me.
> I tried to create a simple GUI, and it wanted me to declare my wallpaper as a variable. After compiling and pasting into Kontakt, it didn't work there either.



Please contact me with the details at [email protected], I'll be glad to help! let's keep support requests out of this thread or we'll drown under them!


----------



## EvilDragon (Jun 5, 2016)

KScript or math library use no licensing whatsoever AFAIK.


----------



## FrozenPlain (Jun 5, 2016)

Nils' compiler uses a GPL2 licence. But the source code for the the compiler is in python, so it's a little different. You don't actually use the source code directly when you make a commercial library, while with a KSP library you would.


----------



## magneto538 (Jun 5, 2016)

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.


----------



## tack (Jun 5, 2016)

MIT is a great license for this kind of thing. It's my usual choice in recent times. Either that or public domain.

Sqlite being public domain was a real eye opener for me. It's crazy the things that embed sqlite. It's extremely high quality software, and the public domain license hasn't in any way prevented growth of community and development support. If anything, it's helped it tremendously because the permissive license lowers the barrier to entry.


----------



## neblix (Jun 10, 2016)

I can confirm, having worked on open-source audio software previously. MIT License is dope.


----------



## magneto538 (Jul 13, 2016)

Hello guys.
I am working on the next version of Koala. Do you have any particular suggestion/addition to make?

Thank you!


----------



## olmerk (Jul 13, 2016)

I've notice that empty if statments are indicated as errors. Can they be ommited?


----------



## EvilDragon (Jul 13, 2016)

Disable compiler option to warn on empty if statements. In Sublime Text 3, go to Tools->KSP: Signal error on empty if/else statements, uncheck.


----------



## magneto538 (Sep 14, 2016)

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 the new Wiki on Koala's GitHub page here.

Koala's GitHub page: https://github.com/magneto538/Koala
Support center: [email protected]

Happy scripting!


----------



## magneto538 (Mar 3, 2017)

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 PackageControl along with Snippets and the updated Wiki. You can get the new version directly from Koala's GitHub repository by clicking below, or just install it from Sublime Text 3.

In case you don't know what Koala is, you definitely want to check out the basics on the Wiki: https://github.com/magneto538/Koala/wiki. Instructions for installation are in the Wiki as well.

Looking forward to getting your feedback!

https://github.com/magneto538/Koala
https://l.facebook.com/l.php?u=http...kMSPfSqZzhS7rQnaLno5Jn3f6UxcQ68xUf4fGVB3c&s=1


----------



## magneto538 (Jun 3, 2017)

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 running: https://github.com/magneto538/Koala/wiki

*Koala is available on GitHub and Packagecontrol.* Once again, please follow the Installation guide on Koala wiki to understand how to get it.


*____ FULL CHANGELOG v2.1.1 - v2.1.6 ___________________
*
* *Added new E2V and V2E INLINE functions* from BigBob's Math Library for Kontakt 5.6+.
* *ADDED EASING FUNCTIONS*! With Kontakt 5.6's new real Math operations, it's now possible to use easing functions to enhance your UI animations and handle complex curves for any kind of application, be it UI or Engine-based. Take a look here http://easings.net/ for more info! Kontakt 5.6+ only.
* *Added Family Masks!* now each UI control can be assigned to *multiple Families*! This allows you to create Subfamilies as well.

* Added a lot of new *Bool and Math functions*: math.fmod, math.note_to_freq, math.freq_to_note, math.trim, bool.is_greater, bool.is_not_greater and many more. Read the full list on the Wiki.
* Added new *real Math constants* (~MATH_2PI, ~MATH_LN2 and more)
* Added new *UI management* functions: scale_slider_out
* Added a *Show/Hide button* next to the UI control's name on UI view. This button allows you to temporary show/hide the currently selected UI Control.
* Bugfixes

Have fun scripting with Koala!


----------



## magneto538 (Oct 16, 2017)

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 order to get you up and running: https://github.com/magneto538/Koala/wiki

*Koala is available on GitHub and Packagecontrol.* Once again, please follow the Installation guide on Koala wiki to understand how to get it.

If you are already using Koala, make sure to *replace the old KSP files* inside the "Koala" folder with the new ones.

*____ CHANGELOG v2.1.7 - v2.2.0 ___________________*

* Added new element to the Debugger: the *Live Monitor*! This extremely powerful section features two main elements: the Oscilloscope can be used to monitor in realtime the content of an array or the change of a value over time, and can also be used to generate your own lookup tables according to the content of the Oscilloscope itself; the Array view displays the content of an array along with some useful informations. These features are handled with two functions: DEBUG.osc_value() and DEBUG.osc_array. Check out the Wiki for more info about this.

* Added HOST_BPM and HOST_BPM_FLOAT
* Added math.set_bit, math.curve_alt, math.parity, math.clip, math.gate, math.clamp and bool.is_in_range
* Added Light Mode! Reduce the amount of compiled script lines (at a cost, but it's not so big)
* Fixes and optimizations (lighter visibility settings for the Debugger)
https://l.facebook.com/l.php?u=http...nMwmuX9Poc3k1SoEcnF54X0Tprqw2FD-Bnbppu18D2iNf


----------

