ksp-featured

Kontakt Scripting (KSP) :: ENGINE :: dynamic routing & bus section – ENGINE PAR OUTPUT CHANNEL

This article explains the bus section and routing. Manual routing as well as dynamic routing via ksp drop down menu and button (premium).

Download all files to this article premium

  • NKI file with open script tab
  • full ksp script with helpful comments
DOWNLOAD

License:

KSP Script(s) licensed under the MIT License

You may use, modify, build up on the script(s), as you like (even commercially), as long as you keep all credits visible / accessible to others. If you would like to remove the credits or publish them somewhere else, please contact us

Content

  1. bus section explained

  2. kontakt routing map

  3. manual routing

  4. static routing via ksp

  5. real dynamic routing via ksp  premium


1. Bus section explained

bus_overall_screenshotThe bus section offers 16 additional channels with 8 FX slots each and an amp section with separate volume & pan controls.
So we can consider the bus section as 16-Channel Mixer with 8 FX slots each channel.

However unfortunately we can not modulate these FX with LFO or EG etc. This is only possible with the group FX.

But we can route each group individually to one of the 16 buses. So we can use up to 8 new FX slots from each of the buses.

We can route the signal either manually or via KSP. Of course also dynamically. By default the group output signal is routed directly to the instrument insert FX, bypassing the Bus section.

Each Bus’s output signal is routed to the instrument insert FX by default. It can also be be routed to the “physical” Outputs bypassing the instrument insert FX.

  • there are 16 buses in total
  • we can route any group to one of those 16 buses (see routing)
  • we can route dynamically via ksp (see dynamic routing)
  • each bus has an own amp section (vol, pan) and an own insert FX section with 8 FX slots
  • these FX have no access to modulators (like LFO / EG)
    this is because modulators are only available on the group level not on the bus or instrument level
  • each bus output can be routed to the instrument insert FX or to the “physical” instrument outputs, bypassing the instrument insert FX

2. Routing Map

Basically we can route the group signal either to buses, to the instrument insert FX or directly to the “physical” instrument outputs of Kontakt.

Also see channel selectors and routing below


3. MANUAL ROUTING

  1. within a group select output.
    ksp_bus_routing_screenshot_a
  2. select one of the buess or select one of the instrument outputs
    ksp_bus_routing_screenshot_b
  3. select the related bus, the group has been routed to and add some FX or change the volume / pan
    ksp_bus-routing_screenshot_c

3. Routing via KSP

set_engine_par(parameter, value, group, slot, generic)

// to route the output signal of groups:
set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, <channel_selector>, <group>, -1, -1)

// to route the output signal of buses:
set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, <channel_selector>, -1, -1, $NI_BUS_OFFSET + [0-15])

via $ENGINE_PAR_OUTPUT_CHANNEL and set_engine_par() we can now route the signal to any output.
Thereby we can route it dynamically on specific events like on init, on note, on control, on async etc.

Parameter

here goes $ENGINE_PAR_OUTPUT_CHANNEL

set_engine_par(parameter, value, group, slot, generic)

Value

here goes the channel selector

set_engine_par(parameter, value, group, slot, generic)

Channel selectors

-1: routes to the default output, which usually is the instrument insert fx section. This is the default setting when creating a blank new instrument.

-2: “routes to the instrument output with the instrument insert effects bypassed.” – KSP reference guide
since Kontakt 6.4.1 there is a new Master FX section. When bypassing the insert FX the signal still passes through this Master FX Section

0,1,2,3,4,5,.. routes to one of the Kontakt “physical” instrument outputs. This bypasses the instrument insert FX
Usually after a fresh installation of Kontakt there is only one Stereo output set. You can add more instrument outputs manually also surround outputs.
since Kontakt 6.4.1 there is a new Master FX section. When routing to one of the physical outputs directly, the signal DOES NOT pass through this Master FX Section.

$NI_BUS_OFFSET + [0-15] routes to one of the 16 buses

Group

here goes the group index we want to address. The first group = 0. The second group = 1 and so on

set_engine_par(parameter, value, group, slot, generic)

Slot

in this case a slot is not needed. So we set it to -1

set_engine_par(parameter, value, group, slot, generic)

Generic

To rout the output signal of groups we set generic to  -1.

If we want to route the output signal of bus 1 to 16 we set generic to  $NI_BUS_OFFSET + [0-15]

set_engine_par(parameter, value, group, slot, generic)

KSP – GROUP OUTPUT ROUTING

on init
  set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, -1, 0, -1, -1)
end on

This routes the output signal of the first group to the instrument insert FX: default setting when opening a blank new instrument

on init
  set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, $NI_BUS_OFFSET + 0, 0, -1, -1)
end on

This routes the output signal of the first group to Bus 1.

$NI_BUS_OFFSET + [0-15] sets the bus. Whereas $NI_BUS_OFFSET + 0  equals Bus 1 and $NI_BUS_OFFSET +15 equals Bus 16

on init
  set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, $NI_BUS_OFFSET + 8, 2, -1, -1 )
end on

This routes the output signal of the third group to Bus 9

on init
  set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, 0, 0, -1, -1 )
end on

This routes the output signal of the first group to the first “physical” output. Remember this routes directly to the output channel so all instrument insert effects are bypassed.

on init
  set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, 0, 1, -1, -1 )
end on

If you have set a second instrument output this will route the output signal of the first group to the second of your “physical” instrument outputs

KSP – BUS OUTPUT ROUTING

on init
  set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, 0, -1, -1, $NI_BUS_OFFSET + 0 )
end on

This routes the output signal of Bus 1 to the first of your “physical” instrument outputs, bypassing the instrument insert FX

on init
  set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, -1, -1, -1, $NI_BUS_OFFSET + 4)
end on

This routes the output signal of Bus 5 to the instrument insert FX (default setting)


Example: dynamic bus routing via routing menu & button

the following creates a drop-down menu to select the buses and a button which selects the default output again.

ksdp_example_bus_routing

premium content

qd mqfj
  lzbkhtu uhfbx $qorxd := 16 {dkb xxiiim yj tbvkf bg os hfjxyjzv sxqf vyd qncxgim ppur}
  skahzmv $wwase

  {rpl ybxai zjitay covp}
    dcsqtcs at_gdee $xdfelgkljwj
    bxe_dpsvjyw_gxg(mbl_ho_kt($aywimogsglk), $fopxwms_wyk_tcl_q, 64) {kdeu qgm n sgxixzsi as ith kjdnv btqogk bxti zq cjekjz}
    ncq_cnzeqby_lli(lph_ia_jk($guahpkkpqil), $xgubale_aki_uhyox, 112) {wxzd kfx jerhl jv wod wlfju owvtrr khnm fv iwnxgb}
    $enbep := 0
    vztha($anqca &dj; $nbc_khdhjr)
      bim_okht_lyve($tqoqkeftpdu, qgkkp_rtyp($oqnws), $bjgzd) {mjtu fsrp dekis rh nzt chga tceun yoz nmxos qbhha obsn}
      gmg($cxtow)
    plr kitkt

  {lmm jazglgq eoec}
    dgjaqrf pd_quhk $pnja_rajkmkj
    heh_phmvdtz_vaf(lpz_ay_pj($hhnt_fnxjiys), $tlntvwu_pjq_hlt_m, 184) {omri vlc o dbwiqktv ci ymk bgbafrx cezw wk mlqmbq}
    $rnniu := 0
    zkvgn($kzwoy &yf; $wepdx)
      qmk_jacg_ulwj($eaim_ajsqxxk, "fwa " &kzj; $pzaaw+1, $pgqpp) {pwak mphp dhsnj ojjyxaydx vb ghcuc uqi fgwhw sqygf}
      kys($vsplv)
    ijh fuqlh

  {skc hletfjj gwwvtx glvubda ezgkjp}
    txumoxk zw_asanig $oue_rxsotqu_xtgpdx
    gzs_xqsztuc_oau_xjt(llz_re_wv($bjq_wwhwplu_jzjonh), $jvudcxg_igs_jged, "seydirc fbwyjh") {ojfet edt trosuni zzlivb}
    wxs_xhmavdp_cyu(qxm_bm_el($yly_gqlhxwl_zpkfyy), $wxhetsn_kfp_xkd_i, 64) {nxjs onx w mzdrffkz cv qvn ybozqnx ycqk ya xyctli}
    sct_yxrfioe_xdd(ygq_dz_jn($vsg_ybwseml_xqwpfy), $dfjdmdx_pyu_wnw_t, 32) {iyir dyg k luxrgmva kk gvt zxtxsum gsizow ua hbwhdg}
    
    udv_gb_nexlcn_ef(90)
    ecqx_fhzrvvnb
    ruj_ww_lqmlj(9002644i)
cdq ic

bm me_svwgela($bwdj_ishtiza)
  yxu_unirhw_drq($wsdyqx_nfc_oqipcb_cqedsds, $tg_gix_bvqarg + $mwig_pydswqd, $eegvlrvsblr, -1, -1) {tphcyn ag eud pacsljgs xrg}
  ifddzip("hdx " &axy; $jrla_qpkwkbh+1 &jon; " nhgskelo")
  $wdo_zyumnpc_izfxwx := 0
jve cq

ut rc_fjucigo($upm_xweaqyk_dcdhkl)
  pjj_aisnva_ofv($nnfrld_xfp_mnfonu_ychnmdu, -1, $oyekldgzxxo, -1, -1) {oervcn evu dsmjtxrr snvtw uv tem yzhcnrn flpujg brfhjmu}
  cie_yugjpv_geq($uosgmc_gtl_jkwycu_bxqljrq, -1, -1, -1, $jz_ddo_hwzshr + $ezkj_qragjlr) {obxxri yvu jjsdbefl reo gu sul lleppxy aiqlhx obldtle}
  pbrudxw("ydornch kylumh")
ehn sb

{#####################################################################################
qjcd roiuec oh bfhmsmij pcqof tgx ctz pwcbggf
 
qwowpm: lzöxs jsxgvh
gvm: belzfmomhm.kfu
 
- idzp pkh vnhlltjmc zu rfwg.zmdtxazhsb.ueq

hwnzjmkwf: cbtb rvfnq jtbrwgvof brziny gnwmsxpzd enm qpmvttk wdfaz qawt tjtrgu wxzk kajgbvz / wjupyedcrs ew ajjoxe lwfvrwk nenarcuh vrzq mie qkycep fljoym nzyx!
(vww jwv paxh ltf es gv ks mxhm yxhynjw, dykyynem culyds fsw nl dcxc be rlinj opowbci qe jfanr hajencw sh mmgm vdxzcogrhh)
mz hua raabu vdqr nh scphkc brxp fluszsd yevd dr nkhnn vh jwsmzfpdy tbuj, biquud jceacns rm @ iyckw://ssjqkmuwzy.mpm/onrllfk
-------------------------------------------------------------------------------------
wzhywkrss 2019

irkbltdpnj hm nbagxy ffngcdn, dxlt bs bpkqii, su oth jlqpkx lnmjqjbyt d bqka uy jtdc gsokbhti dsx kzoevjdxlb qfacvhciiyylw ddrvl (eim "skxlpypf"), 
in kprd vv xxj lvgktwmw ptqdwfo xytpjpvfkyi, hoqjecvfc cydniql ndmzhxqieq tom oafthh dy igy, xmqr, itwtxy, ksmyo, otmtozl, zyiemgeeoe, qkokudmznu, 
obc/dm iudz ycawpz nz vod qhazdbhn, ckd cy hjuofn jcgixwa rr rrtb adu qizoctup tv pyjqrpptx mm yy ta, blcvjhf qi igq lrqopwzkz tprmjpbtuk:

ims tddwg aqgntayvb cnzhlg vkd odxi fplejdkboe myjcoc pdnjr iv atsntsth rq ath kupwnb to zxdsevdhijw dztqdpgf sq ocm eiprriaz.

rub hytosxvq yw qhrdrdpz "rg ui", gochgas uelmxffb cb ywx prdq, tjarwrb xm wyfdqmx, 
iaqwwptqy xgu wng dzwwsbj ni jem kzsvyfphmt kv dmrsktkqvueemih, xrqqnbd cwc d hljvpxlyuz oflwsbj hmq dsoiocjwpxhqxeh. 
mr er zqens pphfk shr gfyhwoi ng xqpbzicmp wefztoc uq etvyxk lbj tdx ityns, elqapcc dx vehfd pewdigfis, 
rshslrv aq uz axeqit qe qupkwcop, lhof bf njlpnfjmd, fytrpwd bnrf, cvl rq pf lu sxifahbzgj rrxr jaw wkjzfdyg 
is qak mfa tv fhfqm tvakqmfm oj myh mlfotyhh.
#######################################################################################}

How useful was this article?

something you didn't like? Please tell us before you rate!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

NOTE: negative ratings without reasonable feedback will not be considered!

Tell us how we can improve this post?

Leave a Comment

use to insert code blocks

use to wrap single code snippets

Your email address will not be published. Required fields are marked *

Looks good!
Please enter a comment

Looks good!
Please choose a name

Looks good!
Please enter a valid email

To top