So I'm hopeless at Kontakt Scripting..

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

Post

Up until Saturday I didn't even dare click on the scripts section of Kontakt but I'm looking at making my own library in the very distant future so I decided to have a go at making my own front panel with a few of the basics (volume asdr, a simple filter, filter asdr, env>flt, lfo>filter, some fx on switches).

So after an intensive day of pulling my hair out half paying attention to tutorial videos on youtube and browsing here, the NI forum and vi-control I managed to assemble something that appears to be semi-working at best (it's not giving me any errors in the script info so yay!).

I've run into a problem however. I've inserted a filter on Group Insert FX Slot 0. Whenever I insert a new group the Cutoff Knob that I've set to control it doesn't impact the new group. Is there any quick way to change this in my script or am I better off using the Instrument Insert FX for the filter since?

Here's my shoddy work so far.

Code: Select all

on init
	make_perfview
	set_script_title("Controls")
	set_ui_height_px(300)
    set_control_par_str($INST_WALLPAPER_ID,$CONTROL_PAR_PICTURE,"utopia_gui.png")
	message("")

{declare labels}

{fx labels}

declare ui_label $fx (2,1)
	set_text ($fx,"Effects")
	set_control_par(get_ui_id($fx),$CONTROL_PAR_TEXT_ALIGNMENT,1)

	move_control($fx,1,2)

{envelope}

	declare ui_label $Envelope (4,1)
	set_text ($Envelope,"Envelope")
	set_control_par(get_ui_id($Envelope),$CONTROL_PAR_TEXT_ALIGNMENT,1)

	move_control($Envelope,3,2)

{filter}

declare ui_label $Filter (2,1)
	set_text ($Filter,"Filter")
	set_control_par(get_ui_id($Filter),$CONTROL_PAR_TEXT_ALIGNMENT,1)

	move_control($Filter,1,7)

{filter envelope}

	declare ui_label $FilterEnvelope (4,1)
	set_text ($FilterEnvelope,"Filter Envelope")
	set_control_par(get_ui_id($FilterEnvelope),$CONTROL_PAR_TEXT_ALIGNMENT,1)

	move_control($FilterEnvelope,3,7)


{declare knobs}

{filter env amount}
    
	declare ui_knob $FilterAmount (0,1000000,1)
    move_control($FilterAmount,1,10)
    set_text($FilterAmount,"Env")
    set_knob_unit($FilterAmount,$KNOB_UNIT_PERCENT)
    set_knob_defval($FilterAmount,500000)
    make_persistent($FilterAmount)
    set_knob_label($FilterAmount,get_engine_par_disp($ENGINE_PAR_INTMOD_INTENSITY,0,1,-1))

{LFO amount}

  declare ui_knob $LFOAmount (0,1000000,1)
    move_control($LFOAmount,2,10)
    set_text($LFOAmount,"LFO")
    set_knob_unit($LFOAmount,$KNOB_UNIT_PERCENT)
    set_knob_defval($LFOAmount,500000)
    make_persistent($LFOAmount)
    set_knob_label($LFOAmount,get_engine_par_disp($ENGINE_PAR_INTMOD_INTENSITY,0,2,-1))  


{cutoff}

	declare ui_knob $knobCutoff(0,1000000,1)
	move_control($knobCutoff,1,8)
	set_text($knobCutoff,"Cutoff")
	set_knob_unit($knobCutoff,$KNOB_UNIT_HZ)
	set_knob_defval($knobCutoff,1000000)
	set_knob_label($knobCutoff,get_engine_par_disp($ENGINE_PAR_CUTOFF,0,0,-1))
	make_persistent($knobCutoff)

	declare ui_knob $knobRES(0,1000000,1)
	move_control($knobRES,2,8)
	set_text($knobRES,"Resonance")
	set_knob_unit($knobRES,$KNOB_UNIT_PERCENT)
	set_knob_defval($knobRES,350000)
	set_knob_label($knobRES,get_engine_par_disp($ENGINE_PAR_RESONANCE,0,0,-1))
	make_persistent($knobRES)

{volume envelope}

	declare ui_knob $knobATTACK(0,1000000,1)
	move_control($knobATTACK,3,3)
	set_text($knobATTACK,"Attack")
	set_knob_unit($knobATTACK,$KNOB_UNIT_MS)
	set_knob_defval($knobATTACK,0)
	set_knob_label($knobATTACK,get_engine_par_disp($ENGINE_PAR_ATTACK,0,0,-1))
	make_persistent($knobATTACK)

	declare ui_knob $knobDECAY(0,1000000,1)
	move_control($knobDECAY,4,3)
	set_text($knobDECAY,"Decay")
	set_knob_unit($knobDECAY,$KNOB_UNIT_MS)
	set_knob_defval($knobDECAY,500000)
	set_knob_label($knobDECAY,get_engine_par_disp($ENGINE_PAR_DECAY,0,0,-1))
	make_persistent($knobDECAY)

	declare ui_knob $knobSUSTAIN(0,1000000,1)
	move_control($knobSUSTAIN,5,3)
	set_text($knobSUSTAIN,"Sustain")
	set_knob_unit($knobSUSTAIN,$KNOB_UNIT_MS)
	set_knob_defval($knobSUSTAIN,1000000)
	set_knob_label($knobSUSTAIN,get_engine_par_disp($ENGINE_PAR_SUSTAIN,0,0,-1))
	make_persistent($knobSUSTAIN)

	declare ui_knob $knobRELEASE(0,1000000,1)
	move_control($knobRELEASE,6,3)
	set_text($knobRELEASE,"Release")
	set_knob_unit($knobRELEASE,$KNOB_UNIT_MS)
	set_knob_defval($knobRELEASE,250000)
	set_knob_label($knobRELEASE,get_engine_par_disp($ENGINE_PAR_RELEASE,0,0,-1))
	make_persistent($knobRELEASE)

{filter envelope}

	declare ui_knob $knobATTACK2(0,1000000,1)
	move_control($knobATTACK2,3,8)
	set_text($knobATTACK2,"Attack")
	set_knob_unit($knobATTACK2,$KNOB_UNIT_MS)
	set_knob_defval($knobATTACK2,0)
	set_knob_label($knobATTACK2,get_engine_par_disp($ENGINE_PAR_ATTACK,0,1,-1))
	make_persistent($knobATTACK2)

	declare ui_knob $knobDECAY2(0,1000000,1)
	move_control($knobDECAY2,4,8)
	set_text($knobDECAY2,"Decay")
	set_knob_unit($knobDECAY2,$KNOB_UNIT_MS)
	set_knob_defval($knobDECAY2,500000)
	set_knob_label($knobDECAY2,get_engine_par_disp($ENGINE_PAR_DECAY,0,1,-1))
	make_persistent($knobDECAY2)
	
	declare ui_knob $knobSUSTAIN2(0,1000000,1)
	move_control($knobSUSTAIN2,5,8)
	set_text($knobSUSTAIN2,"Sustain")
	set_knob_unit($knobSUSTAIN2,$KNOB_UNIT_MS)
	set_knob_defval($knobSUSTAIN2,1000000)
	set_knob_label($knobSUSTAIN2,get_engine_par_disp($ENGINE_PAR_SUSTAIN,0,1,-1))
	make_persistent($knobSUSTAIN2)

	declare ui_knob $knobRELEASE2(0,1000000,1)
	move_control($knobRELEASE2,6,8)
	set_text($knobRELEASE2,"Release")
	set_knob_unit($knobRELEASE2,$KNOB_UNIT_MS)
	set_knob_defval($knobRELEASE2,250000)
	set_knob_label($knobRELEASE2,get_engine_par_disp($ENGINE_PAR_RELEASE,0,1,-1))
	make_persistent($knobRELEASE2)
	

{filter on button}

declare ui_button $button_filter_on
set_text($button_filter_on, "Filter On")
move_control($button_filter_on,3,10)
make_persistent($button_filter_on)


end on

{filter}

on ui_control($knobCutoff)
	set_engine_par($ENGINE_PAR_CUTOFF,$knobCutoff,0,0,-1)
	set_knob_label($knobCutoff,get_engine_par_disp($ENGINE_PAR_CUTOFF,0,0,-1))
end on

on ui_control($knobRES)
	set_engine_par($ENGINE_PAR_RESONANCE,$knobRES,0,0,-1)
	set_knob_label($knobRES,get_engine_par_disp($ENGINE_PAR_RESONANCE,0,0,-1))
end on

{volume adsr}

on ui_control($knobATTACK)
	set_engine_par($ENGINE_PAR_ATTACK,$knobATTACK,0,0,-1)
	set_knob_label($knobATTACK,get_engine_par_disp($ENGINE_PAR_ATTACK,0,0,-1))
end on

on ui_control($knobDECAY)
	set_engine_par($ENGINE_PAR_DECAY,$knobDECAY,0,0,-1)
	set_knob_label($knobDECAY,get_engine_par_disp($ENGINE_PAR_DECAY,0,0,-1))
end on

on ui_control($knobSUSTAIN)
	set_engine_par($ENGINE_PAR_SUSTAIN,$knobSUSTAIN,0,0,-1)
	set_knob_label($knobSUSTAIN,get_engine_par_disp($ENGINE_PAR_SUSTAIN,0,0,-1))
end on

on ui_control($knobRELEASE)
	set_engine_par($ENGINE_PAR_RELEASE,$knobRELEASE,0,0,-1)
	set_knob_label($knobRELEASE,get_engine_par_disp($ENGINE_PAR_RELEASE,0,0,-1))
end on

{filter adsr}

on ui_control($knobATTACK2)
	set_engine_par($ENGINE_PAR_ATTACK, $knobATTACK2, 0, find_mod(0, "ENV_FLT"), -1)
	set_knob_label($knobATTACK2,get_engine_par_disp($ENGINE_PAR_ATTACK,0,find_mod(0, "ENV_FLT"),-1))
end on

on ui_control($knobDECAY2)
	set_engine_par($ENGINE_PAR_DECAY, $knobDECAY2, 0, find_mod(0, "ENV_FLT"), -1)
	set_knob_label($knobDECAY2,get_engine_par_disp($ENGINE_PAR_DECAY,0,find_mod(0, "ENV_FLT"),-1))
end on

on ui_control($knobSUSTAIN2)
	set_engine_par($ENGINE_PAR_SUSTAIN, $knobSUSTAIN2, 0, find_mod(0, "ENV_FLT"), -1)
	set_knob_label($knobSUSTAIN2,get_engine_par_disp($ENGINE_PAR_SUSTAIN,0,find_mod(0, "ENV_FLT"),-1))
end on

on ui_control($knobRELEASE2)
	set_engine_par($ENGINE_PAR_RELEASE, $knobRELEASE2, 0, find_mod(0, "ENV_FLT"), -1)
	set_knob_label($knobRELEASE2,get_engine_par_disp($ENGINE_PAR_RELEASE,0,find_mod(0, "ENV_FLT"),-1))
end on


{filter mod amount}

on ui_control ($FilterAmount)
	set_engine_par($ENGINE_PAR_INTMOD_INTENSITY,$FilterAmount,0,find_mod(0, "ENV_FLT"),-1) 
	set_knob_label($FilterAmount,get_engine_par_disp($ENGINE_PAR_INTMOD_INTENSITY,0,find_mod(0, "ENV_FLT"),-1))

end on

{lfo mod amount}

  on ui_control ($LFOAmount)
	set_engine_par($ENGINE_PAR_INTMOD_INTENSITY,$LFOAmount,0,find_mod(0, "LFO_ENV"),-1) 
	set_knob_label($LFOAmount,get_engine_par_disp($ENGINE_PAR_INTMOD_INTENSITY,0,find_mod(0, "LFO_ENV"),-1))

end on
  
{filter on button}

on ui_control ($button_filter_on)
	set_engine_par($ENGINE_PAR_EFFECT_BYPASS, abs($button_filter_on -1), 0, 0, 0)
	end on


Post

You could save yourself some work getting Hollow Sun's Shell:
http://www.hollowsun.com/HS2/products/g ... /index.htm

For a simple sample library Kontakt is maybe a bit advanced, MaizeSampler is less to get to grips with, and still lets one add the needed functions in the interface:
http://www.maizesoft.com/cms/?page_id=48

Post

I do already own that in fact!

The idea well down the line is to release a nice cheap library on sampleism so I would really like to create my own simple little interface.

Post

OK, then I understand :)

I would just like to add If you plan to sell it, I think it would be better to use MaizeSampler because the buyer wouldn't need Kontakt full version then, would give you a bigger possible customer base.

I thought Maize Sampler was rather limited what kind of interface it lets user build, but this drum synth released last month goes to show that it isn't so: http://www.kvraudio.com/forum/viewtopic ... e#p6074446

Post

Numanoid wrote:OK, then I understand :)

I would just like to add If you plan to sell it, I think it would be better to use MaizeSampler because the buyer wouldn't need Kontakt full version then, would give you a bigger possible customer base.
I could maybe see offering a library in multiple formats, but certainly not to the exclusion of Kontakt. It is by far the leading platform for sample libraries with the largest installed user base. Why wouldn't a developer publish to that format?

It's kind of like suggesting that a Massive patch library should be created for Synth1 instead because not everyone owns Massive.
Incomplete list of my gear: 1/8" audio input jack.

Post

deastman wrote:It's kind of like suggesting that a Massive patch library should be created for Synth1 instead because not everyone owns Massive.
But that is exactly what MaizeSampler lets you do.

When you have set up your samples and interface in MaizeSampler you "print out" a VSTi, that can be used in any DAW that allows for VSTis (which most do)

It can "print" both to 32 and 64 bit, and both for PC and Mac

You can have a look at Bass Engine for example, that is a VSTi that has been created with MaizeSampler: http://www.kvraudio.com/forum/viewtopic ... 1&t=426339

Post

You'd probably be far better served by becoming a member of the NI forum and posting this question here:

http://www.native-instruments.com/forum ... kshop.205/

Evil Dragon and several other Kontakt experts hang out there and are extremely helpful for questions like yours.

Edit: Oh yeah, and I forgot to mention this:

http://www.amazon.com/KSP-Scripting-1-M ... 3839150515

It's a fairly good book on KSP. It was written for Kontakt 4, but most of its content is quite relevant for Kontakt 5. If you are serious about becoming a KSP ace, it's a great place to start.

Post

Numanoid wrote:
deastman wrote:It's kind of like suggesting that a Massive patch library should be created for Synth1 instead because not everyone owns Massive.
But that is exactly what MaizeSampler lets you do.

When you have set up your samples and interface in MaizeSampler you "print out" a VSTi, that can be used in any DAW that allows for VSTis (which most do)

It can "print" both to 32 and 64 bit, and both for PC and Mac

You can have a look at Bass Engine for example, that is a VSTi that has been created with MaizeSampler: http://www.kvraudio.com/forum/viewtopic ... 1&t=426339
Yes, I get that it prints VSTi's and that you like it. But the fact remains that Kontakt is by far the most popular leading platform for sample libraries.
Incomplete list of my gear: 1/8" audio input jack.

Post

You need to set the value for each group separately, as different groups can have different effects in different slots. So your callback would look like this:

Code: Select all

on ui_control($knobCutoff)
	$count := 0
	while ($count < $NUM_GROUPS)
		set_engine_par($ENGINE_PAR_CUTOFF,$knobCutoff,$count,0,-1)
		inc($count)
	end while
end on
This will set cutoff value on all groups, assuming you have the effect in each group in the same slot.

or you can just repeat the command for groups of choice:

Code: Select all

on ui_control($knobCutoff)
	set_engine_par($ENGINE_PAR_CUTOFF,$knobCutoff,0,0,-1)
	set_engine_par($ENGINE_PAR_CUTOFF,$knobCutoff,1,0,-1)
end on
Don't forget to include "declare $count" in init callback.

Post

Zombie Queen wrote:You need to set the value for each group separately, as different groups can have different effects in different slots. So your callback would look like this:

Code: Select all

on ui_control($knobCutoff)
	$count := 0
	while ($count < $NUM_GROUPS)
		set_engine_par($ENGINE_PAR_CUTOFF,$knobCutoff,$count,0,-1)
		inc($count)
	end while
end on
This will set cutoff value on all groups, assuming you have the effect in each group in the same slot.

Don't forget to include "declare $count" in init callback.
This worked a treat so thank you very much for your help.

Post

dmbaer wrote: Edit: Oh yeah, and I forgot to mention this:

http://www.amazon.com/KSP-Scripting-1-M ... 3839150515

It's a fairly good book on KSP. It was written for Kontakt 4, but most of its content is quite relevant for Kontakt 5. If you are serious about becoming a KSP ace, it's a great place to start.
Is there an English ebook of this out there to buy anywhere? Don't really fancy a hardcopy version and the ibook store only has a German version.

Post

ADSR has a very easy to understand guide to how to get started:

http://www.adsrsounds.com/kontakt-tutor ... ance-view/

Post

"KSP Reference Manual" is really all you need, this and study factory scripts.

Post

ctype wrote:
dmbaer wrote:Is there an English ebook of this out there to buy anywhere? Don't really fancy a hardcopy version and the ibook store only has a German version.
Not to my knowledge. There can't be all that big of a potential customer base for something as specific as this. We're fortunate that somebody choose to write such a tutorial in the first place, IMO.

Post

Not that its beautiful like the Dragon's work, but you can use my little script / alleged interface as a jumping off point if you like.
http://bigcatinstruments.blogspot.com/2 ... a-pad.html

Or a bit more advanced in that it tells which articulation is in use and modifies the keyboard range for each articulation.
http://bigcatinstruments.blogspot.com/2 ... oject.html

Or the Gunshot SFX / With a Bullet has a rebuilt, by an internet friend, EQ.
http://bigcatinstruments.blogspot.com/2015/03/sfx.html
Image

Post Reply

Return to “Samplers, Sampling & Sample Libraries”