# $engine_par_output_channel



## jdawg (May 27, 2012)

Hi, 
Can't seem to find any examples or references for 

$ENGINE_PAR_OUTPUT_CHANNEL

variables so I can change the channel in script. 

ANy examples around?


Thanks you
~o) (o)


----------



## mk282 (May 27, 2012)

Easy enough.

set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL,<value -1 to 63>,<group>,-1,-1)


sets the selected group to default value (instrument) if using -1, or one of up to 64 outputs available in Kontakt's output section (not counting the Aux outputs, depending on how many channels you create there, etc.) if using 0 to 63.


This is further expanded in Kontakt 5 for usage with Kontakt's bus system. You can use $NI_BUS_OFFSET (which is basically just a constant with value of 1024) plus a number from 0 to 15 to select a bus to which the group will be routed.

set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL,$NI_BUS_OFFSET + 4,<group>,-1,-1)

This will select Bus 5 as output for the chosen group.


----------



## jdawg (Jun 11, 2012)

Oh brilliant, 
is there a way to search for the outputs you have already created in kontakt?

Or should you create outputs in the output pop up relative to the ouputs you select in script?

(o)


----------



## Tod (Jun 11, 2012)

Not sure if this will help or not, this is simplified from what I basically used recently in K4. Of course this is only good for one group and may not work but might give you the idea.  


```
on init
  declare $cnt1
  declare ui_menu $Out_men
    add_menu_item($Out_men,"Default Out",-1)
    $cnt1 := 0
  while($cnt1 < $NUM_OUTPUT_CHANNELS)
    add_menu_item($Out_men,output_channel_name($cnt1),$cnt1)
    inc($cnt1)
  end while
end on  

on ui_control ($Out_men)
  set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL,$Out_men,0,-1,-1)
end on
```


----------



## olmerk (Sep 28, 2018)

Not to start a new thread... I have a question on how to couple $ENGINE_PAR_OUTPUT_CHANNEL and a instrument's reverb (insert fx). 

It's known that $ENGINE_PAR_OUTPUT_CHANNEL bypasses instrument's insert fx, so when I route via $ENGINE_PAR_OUTPUT_CHANNEL certain groups to a particular output channel, they play without reverb. 

What can be done in this case? How can apply a reverb effect to multi-channel instrument? 

Thanks!


----------



## Tod (Sep 28, 2018)

You can use "Group Sends" to send to the Send Effects. I seldom use Group Sends but this code should be close. In this case it would be sending an IDs value from the group-3 send which is on slot 7 of the Group Effects. This would be going to slot 5 in the Send Effects. 


```
set_engine_par($ENGINE_PAR_SENDLEVEL_5,get_control_par(%Knb_ID[2],$CONTROL_PAR_VALUE),3,7,1)
      set_control_par_str(%KnbVal_ID[2],$CONTROL_PAR_TEXT,get_engine_par_disp(%EP_Nm[2],3,7,1))
```

Like I said, I seldom use Group Sends and someone might correct me on this.


----------



## olmerk (Sep 29, 2018)

Tod said:


> You can use "Group Sends" to send to the Send Effects.



I have several hundreds of groups. That would be tedious to add the same reverb to each of it.


----------



## EvilDragon (Sep 29, 2018)

No it wouldn't, select multiple groups for editing, add Send Levels module in one of group FX slots, voila. It's easy too loop through to set the relevant engine parameter.


----------



## olmerk (Sep 29, 2018)

EvilDragon said:


> No it wouldn't, select multiple groups for editing, add Send Levels module in one of group FX slots, voila.



Indeed it worked! Thought mutiple groups editing would have glitches with inserting an FX... Thanks!


----------

