How to create a simple Kontakt GUI

Sampler and Sampling discussion (techniques, tips and tricks, etc.)
RELATED
PRODUCTS

Post

Hi everyone!

Is there any tutorial out there how to use Kontakt scripts to create a simple GUI? I just want a background image with some controls, nothing to complicated :)

I know there is a book but I really just want to do this one simple thing. I'm working on my next free Kontakt instrument right now and it would be really nice if I could add a few controls to it :)

Thanks in advance!

Cheers
Dennis

Post


Post

I haven't tried it - BUT >>> :-o 8)
I'm not a musician, but I've designed sounds that others use to make music. http://soundcloud.com/obsidiananvil

Post

Shabdahbriah wrote:
I haven't tried it - BUT >>> :-o 8)
If you need to make bigger the front end and put a custom wallpaper there, just go to the script section of your instrument and paste this:

Code: Select all

on init
{Start of GUI Generator on init definitions}
    set_ui_height_px(350)
    make_perfview
    message("")
    declare $count := 0
{End of GUI Generator on init definitions}
end on
If you need to put a custom icon to your instrument, you need to put this below the "on init" line

Code: Select all

	set_control_par_str($INST_ICON_ID,$CONTROL_PAR_PICTURE,"filename")
Where "file name" is a custom .png of 35x36 pixels saved under the Kontakt icons folder.



I think that you need to invest some time since this is related to programming, but the "GUI Generator" program i posted first is a good help.
Another option is to take the instruments bundled with Kontakt and analyze them, since their scripts and gui are not locked. Taking them as templates, you can create your owns.

Post

marce wrote:Another option is to take the instruments bundled with Kontakt and analyze them, since their scripts and gui are not locked. Taking them as templates, you can create your owns.
This is a good advice.


The other good advice would be, you can contact me via PM for direct questions ;)

Post

Hi Bronto,
i bought the book "KSP Scripting 1" by Mike Novy which helped me alot. It's available in english and german language!
Got it from Amazon. It's rather for scripting beginners (like me :wink:) and I got some good results along with analyzing some unlocked Kontakt instruments.
EAT - SLEEP - SYNTH
http://soundcloud.com/pocvecem

Post

Thanks for the suggestions :)
That looks really interesting! Thanks for the link!
marce wrote:I think that you need to invest some time since this is related to programming
That's not a problem. I'm not the smartest guy but I usually learn this kind of things (programming/scripting languages) pretty fast :)
pocvecem wrote:Hi Bronto,
i bought the book "KSP Scripting 1" by Mike Novy which helped me alot. It's available in english and german language!
Got it from Amazon. It's rather for scripting beginners (like me ) and I got some good results along with analyzing some unlocked Kontakt instruments.
I saw that book but I thought that there has to be a free tutorial about the basics.
EvilDragon wrote:The other good advice would be, you can contact me via PM for direct questions
Thanks :)
I'll do that!

Thanks again!

Cheers
Dennis

Post

A while back I did a tutorial on Kontakt scripting that includes creation of gui elements -

http://kore.noisepages.com/2008/12/21/d ... downloads/

A couple of the graphics are missing from the tutorial but the script links should still work. Digital decay from a few too many Wordpress upgrades I reckon.

Post

~Pd~ wrote:A while back I did a tutorial on Kontakt scripting that includes creation of gui elements -

http://kore.noisepages.com/2008/12/21/d ... downloads/

A couple of the graphics are missing from the tutorial but the script links should still work. Digital decay from a few too many Wordpress upgrades I reckon.
I even read that when you first posted it. Totally forgot abou it. Thanks for the link!

I just learned a bit from the links you guys provided and already reached my goal: A simple knob that crossfades between two groups :hihi:

But I can't stop now. I will learn try to learn a bit more :)

Cheers
Dennis

Post

That's what I came up with by the way:

Code: Select all

on init
	make_perfview
	declare ui_knob $Mix(0,630000,630000)
end on
on ui_control($Mix)
	set_engine_par($ENGINE_PAR_VOLUME,$Mix,0,-1,-1)
	set_engine_par($ENGINE_PAR_VOLUME,630000 - $Mix,1,-1,-1)
end on
The knob range is a bit stupid but I wanted to keep it simple first :)

Cheers
Dennis

Post

If you needed an on/off button, you could've just used ui_switch there. :)

Code: Select all

on init
    make_perfview
    declare ui_switch $Mix
    make_persistent($Mix)
end on

on ui_control($Mix)
    set_engine_par($ENGINE_PAR_VOLUME,$Mix * 631000,0,-1,-1)
    set_engine_par($ENGINE_PAR_VOLUME,(1 - $Mix) * 631000,0,-1,-1)
end on
;)

Post

EvilDragon wrote:If you needed an on/off button, you could've just used ui_switch there. :)

Code: Select all

on init
    make_perfview
    declare ui_switch $Mix
    make_persistent($Mix)
end on

on ui_control($Mix)
    set_engine_par($ENGINE_PAR_VOLUME,$Mix * 631000,0,-1,-1)
    set_engine_par($ENGINE_PAR_VOLUME,(1 - $Mix) * 631000,0,-1,-1)
end on
;)
I just used ui_switch for the first time :)

This is what I got so far:

Code: Select all

on init
	make_perfview
	declare ui_knob $Mix(0,100,100)
	declare ui_knob $Reverb(0,100,100)
	declare ui_switch $Lofi
	declare $Mix2
	declare $Reverb2
end on

on ui_control($Mix)
	$Mix2 := $Mix * 6300
	set_engine_par($ENGINE_PAR_VOLUME,$Mix2,0,-1,-1)
	set_engine_par($ENGINE_PAR_VOLUME,630000 - $Mix2,1,-1,-1)
end on

on ui_control($Reverb)
	$Reverb2 := $Reverb * 6300
	set_engine_par($ENGINE_PAR_SENDLEVEL_0,$Reverb2,-1,1,1)
end on

on ui_control($Lofi)
	set_engine_par($ENGINE_PAR_EFFECT_BYPASS,$Lofi,-1,0,1)
end on
This whole scripting thing is really fun :)
Is there any way how I could invert the Lofi ui_switch?

Cheers
Dennis

Post

Yeah, inverting is easy for buttons:

Code: Select all

on ui_control($Lofi)
    set_engine_par($ENGINE_PAR_EFFECT_BYPASS,1 - $Lofi,-1,0,1)
end on
Last edited by EvilDragon on Tue Aug 02, 2011 9:56 am, edited 2 times in total.

Post

EvilDragon wrote:Yeah, inverting is easy for buttons:

Code: Select all

on ui_control($Lofi)
    set_engine_par($ENGINE_PAR_EFFECT_BYPASS,1 - $Lofi,-1,0,1)
end on
Makes sense :)
Thanks again for the help!

Cheers
Dennis

Post

BTW, I would do the Mix and Reverb knobs a bit differently, it will give you more resolution, but retain the 0-100 value display:

Code: Select all

on init
    make_perfview

    declare ui_knob $Mix(0,631000,1)
    declare ui_knob $Reverb(0,631000,1)
    declare ui_switch $Lofi

    make_persistent($Mix)
    make_persistent($Reverb)
    make_persistent($Lofi)

    read_persistent_var($Mix)
    read_persistent_var($Reverb)

    set_knob_unit($Mix,$KNOB_UNIT_PERCENT)
    set_knob_unit($Reverb,$KNOB_UNIT_PERCENT)

    set_knob_label($Mix,$Mix / 6310)
    set_knob_label($Reverb,$Reverb / 6310)
end on

on ui_control($Mix)
    set_engine_par($ENGINE_PAR_VOLUME,$Mix,0,-1,-1)
    set_engine_par($ENGINE_PAR_VOLUME,631000 - $Mix,1,-1,-1)
    set_knob_label($Mix,$Mix / 6310)
end on

on ui_control($Reverb)
    set_engine_par($ENGINE_PAR_SENDLEVEL_0,$Reverb,-1,1,1)
    set_knob_label($Reverb,$Reverb / 6310)
end on
;)



I hope you're aware that you're not getting an equal-power crossfade between groups 1 and 2 with this method of mix?

Post Reply

Return to “Samplers, Sampling & Sample Libraries”