BrandonSpendlove

Kontakt - Impulse Menu selecting

Apr 9th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.72 KB | None | 0 0
  1. {-----------------Scripted/programmed and sampled by:
  2. Andreas Hald----------------------------------------}
  3.  
  4. on init
  5.  
  6. make_perfview
  7. set_ui_height (4)
  8.  
  9.  
  10.  
  11. {These are not currently in use. They're used to make loops - see NI forum}
  12. declare $gx
  13. declare %GM[3] := (0,5)
  14.  
  15. {These above are not currently in use. They're used to make loops - see NI forum}
  16.  
  17.  
  18. {here the code for the knobs begins - that control volume on groups eg. mic placements}
  19.  
  20. {groups are indexed, so group one is 0, group two is 1 - and so on. 500000 equals -6dB}
  21.  
  22. message("") { this clears the status line so no error messages will be hidden }
  23. declare const $DefVol := 500000 { default initial volume, you can choose this to be whatever you want }
  24. set_ui_height (4)
  25. declare ui_knob $Volume0510(0, 1000000, 1)
  26. make_persistent($Volume0510)
  27. set_text($Volume0510,"Surround")
  28. $Volume0510 := $DefVol
  29. set_knob_defval($Volume0510,$DefVol)
  30. move_control_px($volume0510,66,2) { you can position this knob wherever you like }
  31. read_persistent_var($Volume0510)
  32. set_engine_par($ENGINE_PAR_VOLUME,$Volume0510,0,-1,-1)
  33. set_engine_par($ENGINE_PAR_VOLUME,$Volume0510,5,-1,-1)
  34. set_engine_par($ENGINE_PAR_VOLUME,$Volume0510,10,-1,-1)
  35. set_knob_label($Volume0510,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
  36. declare ui_knob $Volume1611(0, 1000000, 1)
  37. make_persistent($Volume1611)
  38. set_text($Volume1611,"Out")
  39. $Volume1611 := $DefVol
  40. set_knob_defval($Volume1611,$DefVol)
  41. move_control_px($Volume1611,158,2) { you can position this knob wherever you like }
  42. read_persistent_var($Volume1611)
  43. set_engine_par($ENGINE_PAR_VOLUME,$Volume1611,1,-1,-1)
  44. set_engine_par($ENGINE_PAR_VOLUME,$Volume1611,6,-1,-1)
  45. set_engine_par($ENGINE_PAR_VOLUME,$Volume1611,11,-1,-1)
  46. set_knob_label($Volume1611,get_engine_par_disp($ENGINE_PAR_VOLUME,1,-1,-1))
  47. declare ui_knob $Volume2712(0, 1000000, 1)
  48. make_persistent($Volume2712)
  49. set_text($Volume2712,"Decca")
  50. $Volume2712 := $DefVol
  51. set_knob_defval($Volume2712,$DefVol)
  52. move_control_px($Volume2712,250,2) { you can position this knob wherever you like }
  53. read_persistent_var($Volume2712)
  54. set_engine_par($ENGINE_PAR_VOLUME,$Volume2712,2,-1,-1)
  55. set_engine_par($ENGINE_PAR_VOLUME,$Volume2712,7,-1,-1)
  56. set_engine_par($ENGINE_PAR_VOLUME,$Volume2712,12,-1,-1)
  57. set_knob_label($Volume2712,get_engine_par_disp($ENGINE_PAR_VOLUME,27,-1,-1))
  58. declare ui_knob $Volume3813(0, 1000000, 1)
  59. make_persistent($Volume3813)
  60. set_text($Volume3813,"Close")
  61. $Volume3813 := $DefVol
  62. set_knob_defval($Volume3813,$DefVol)
  63. move_control_px($Volume3813,342,2) { you can position this knob wherever you like }
  64. read_persistent_var($Volume3813)
  65. set_engine_par($ENGINE_PAR_VOLUME,$Volume3813,3,-1,-1)
  66. set_engine_par($ENGINE_PAR_VOLUME,$Volume3813,8,-1,-1)
  67. set_engine_par($ENGINE_PAR_VOLUME,$Volume3813,13,-1,-1)
  68. set_knob_label($Volume3813,get_engine_par_disp($ENGINE_PAR_VOLUME,3813,-1,-1))
  69. declare ui_knob $Volume4914(0, 1000000, 1)
  70. make_persistent($Volume4914)
  71. set_text($Volume4914,"Mix S.")
  72. $Volume4914 := $DefVol
  73. set_knob_defval($Volume4914,$DefVol)
  74. move_control_px($Volume4914,433,2) { you can position this knob wherever you like }
  75. read_persistent_var($Volume4914)
  76. set_engine_par($ENGINE_PAR_VOLUME,$Volume4914,4,-1,-1)
  77. set_engine_par($ENGINE_PAR_VOLUME,$Volume4914,9,-1,-1)
  78. set_engine_par($ENGINE_PAR_VOLUME,$Volume4914,14,-1,-1)
  79. set_knob_label($Volume4914,get_engine_par_disp($ENGINE_PAR_VOLUME,4914,-1,-1))
  80.  
  81. {Mix buttons}
  82.  
  83. declare ui_button $surroundpower
  84. declare ui_button $outpower
  85. declare ui_button $deccapower
  86. declare ui_button $closepower
  87. declare ui_button $mixpower
  88.  
  89. move_control($surroundpower, 1,3)
  90. move_control($outpower, 2,3)
  91. move_control($deccapower,3,3)
  92. move_control($closepower,4,3)
  93. move_control($mixpower,5,3)
  94.  
  95. set_text($surroundpower, "Surround Off")
  96. set_text($outpower, "Out. Off")
  97. set_text($deccapower, "Decca. Off")
  98. set_text($closepower, "Close. Off")
  99. set_text($mixpower, "Mix. Off")
  100.  
  101. $surroundpower := 0
  102. $outpower := 0
  103. $deccapower := 0
  104. $closepower := 0
  105. $mixpower := 0
  106.  
  107. {AHDSR}
  108.  
  109. declare $count
  110.  
  111. declare ui_knob $Attack (0,1000000,1)
  112. declare ui_knob $Hold (0,1000000,1)
  113. declare ui_knob $Decay (0,1000000,1)
  114. declare ui_knob $Sustain (0,1000000,1)
  115. declare ui_knob $Release (0,1000000,1)
  116.  
  117. set_knob_unit($Attack, $KNOB_UNIT_MS)
  118. set_knob_unit($Hold, $KNOB_UNIT_MS)
  119. set_knob_unit($Decay, $KNOB_UNIT_MS)
  120. set_knob_unit($Sustain, $KNOB_UNIT_DB)
  121. set_knob_unit($Release, $KNOB_UNIT_MS)
  122.  
  123. {AHDSR, Simple and effective Method}
  124.  
  125. declare $ahdsr
  126.  
  127. $ahdsr := 1
  128.  
  129.  
  130. while($ahdsr > $NUM_GROUPS)
  131.  
  132. set_engine_par($ENGINE_PAR_ATTACK,$attack,$ahdsr,0,-1)
  133. set_engine_par($ENGINE_PAR_HOLD,$hold,$ahdsr,0,-1)
  134. set_engine_par($ENGINE_PAR_DECAY,$decay,$ahdsr,0,-1)
  135. set_engine_par($ENGINE_PAR_SUSTAIN,$sustain,$ahdsr,0,-1)
  136. set_engine_par($ENGINE_PAR_RELEASE,$release,$ahdsr,0,-1)
  137.  
  138. inc($ahdsr)
  139.  
  140. end while
  141.  
  142. move_control($Attack, 1,5)
  143. move_control($Hold,2,5)
  144. move_control($Decay,3,5)
  145. move_control($Sustain,4,5)
  146. move_control($Release,5,5)
  147.  
  148. make_persistent($Attack)
  149. make_persistent($Hold)
  150. make_persistent($Decay)
  151. make_persistent($Sustain)
  152. make_persistent($Release)
  153.  
  154. read_persistent_var($Attack)
  155. read_persistent_var($Hold)
  156. read_persistent_var($Decay)
  157. read_persistent_var($Sustain)
  158. read_persistent_var($Release)
  159.  
  160. set_knob_label($Attack, get_engine_par_disp($ENGINE_PAR_ATTACK, 0, find_mod(0,"ENV_AHDSR"), -1))
  161. set_knob_label($Hold, get_engine_par_disp($ENGINE_PAR_HOLD, 0, find_mod(0,"ENV_AHDSR"), -1))
  162. set_knob_label($Decay, get_engine_par_disp($ENGINE_PAR_DECAY, 0, find_mod(0,"ENV_AHDSR"), -1))
  163. set_knob_label($Sustain, get_engine_par_disp($ENGINE_PAR_SUSTAIN, 0, find_mod(0,"ENV_AHDSR"), -1))
  164. set_knob_label($Release, get_engine_par_disp($ENGINE_PAR_RELEASE, 0, find_mod(0,"ENV_AHDSR"), -1))
  165.  
  166. {CONVO REVERB}
  167.  
  168. declare ui_button $reverb
  169. set_text($reverb,"Convo. Off")
  170.  
  171. move_control($reverb,6,7)
  172.  
  173. declare ui_slider $convowet (0,1000000)
  174. declare ui_slider $convodry (0,1000000)
  175. declare ui_slider $convodelay (0,1000000)
  176. declare ui_slider $convoearlyir (0,1000000)
  177. declare ui_slider $convolateir (0,1000000)
  178.  
  179. move_control($convowet, 6,2)
  180. move_control($convodry, 6,3)
  181. move_control($convodelay,6,4)
  182. move_control($convoearlyir,6,5)
  183. move_control($convolateir,6,6)
  184.  
  185.  
  186. {Impulses, you have to define them as !}
  187. {$ Stores a single integer values}
  188. {% Store single integer values at specific indices}
  189. {! Stores text strings... We need to use ! for Samples, Impulses etc...}
  190.  
  191. declare $impulse
  192. declare const $impulse_samples := 9
  193. declare !ir_names[$impulse_samples]
  194.  
  195. {Names of the IR Samples}
  196.  
  197. !ir_names[0] := "IR_DrumRoom"
  198. !ir_names[1] := "IR_Fames_DT_01"
  199. !ir_names[2] := "IR_FiveColumns"
  200. !ir_names[3] := "IR_FiveColumnsShort"
  201. !ir_names[4] := "IR_FrenchSalon"
  202. !ir_names[5] := "IR_GoingHome_Dist"
  203. !ir_names[6] := "IR_Narrow"
  204. !ir_names[7] := "IR_ParkingGarage"
  205. !ir_names[8] := "IR_Silo"
  206.  
  207.  
  208. {Impulse Menu}
  209.  
  210. declare ui_menu $impulses
  211. move_control($impulses, 6, 8)
  212.  
  213. add_menu_item($impulses,"Impulses.....", -1)
  214.  
  215. while ($count < $impulse_samples)
  216.  
  217. add_menu_item($impulses,!ir_names[$count],$count)
  218.  
  219. inc($count)
  220.  
  221. end while
  222.  
  223. {You can delete these labels if you want!}
  224.  
  225. declare ui_label $ConvInfo (1,1)
  226. set_text($ConvInfo," Conv Settings")
  227.  
  228. move_control($ConvInfo, 6,1)
  229.  
  230. declare ui_label $ahdsrinfo (5,1)
  231. set_text($ahdsrinfo, "------------------------------------------AHDSR-----------------------------------------")
  232.  
  233. move_control($ahdsrinfo, 1,4)
  234.  
  235. end on
  236.  
  237. {Impulse Menu}
  238.  
  239. on ui_control ($impulses)
  240.  
  241. if ($impulses = -1)
  242.  
  243. else
  244.  
  245. load_ir_sample(!ir_names[$impulses],6,1) {6,1 is (slot) then (Generic).. Generic = 1 Insert effect, 0 Send effect}
  246.  
  247. end if
  248.  
  249. end on
  250.  
  251. on ui_control($Volume0510)
  252. set_engine_par($ENGINE_PAR_VOLUME,$Volume0510,0,-1,-1)
  253. set_engine_par($ENGINE_PAR_VOLUME,$Volume0510,5,-1,-1)
  254. set_engine_par($ENGINE_PAR_VOLUME,$Volume0510,10,-1,-1)
  255. set_knob_label($Volume0510,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
  256. end on
  257.  
  258. on ui_control($Volume1611)
  259. set_engine_par($ENGINE_PAR_VOLUME,$Volume1611,1,-1,-1)
  260. set_engine_par($ENGINE_PAR_VOLUME,$Volume1611,6,-1,-1)
  261. set_engine_par($ENGINE_PAR_VOLUME,$Volume1611,11,-1,-1)
  262. set_knob_label($Volume1611,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
  263. end on
  264.  
  265. on ui_control($Volume2712)
  266. set_engine_par($ENGINE_PAR_VOLUME,$Volume2712,2,-1,-1)
  267. set_engine_par($ENGINE_PAR_VOLUME,$Volume2712,7,-1,-1)
  268. set_engine_par($ENGINE_PAR_VOLUME,$Volume2712,12,-1,-1)
  269. set_knob_label($Volume2712,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
  270. end on
  271.  
  272. on ui_control($Volume3813)
  273. set_engine_par($ENGINE_PAR_VOLUME,$Volume3813,3,-1,-1)
  274. set_engine_par($ENGINE_PAR_VOLUME,$Volume3813,8,-1,-1)
  275. set_engine_par($ENGINE_PAR_VOLUME,$Volume3813,13,-1,-1)
  276. set_knob_label($Volume3813,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
  277. end on
  278.  
  279. on ui_control($Volume4914)
  280. set_engine_par($ENGINE_PAR_VOLUME,$Volume4914,4,-1,-1)
  281. set_engine_par($ENGINE_PAR_VOLUME,$Volume4914,9,-1,-1)
  282. set_engine_par($ENGINE_PAR_VOLUME,$Volume4914,14,-1,-1)
  283. set_knob_label($Volume4914,get_engine_par_disp($ENGINE_PAR_VOLUME,4914,-1,-1))
  284. end on
  285.  
  286. {MIX Buttons, Purging etc..}
  287.  
  288. on ui_control ($surroundpower)
  289.  
  290. if ($surroundpower = 0)
  291.  
  292. set_text($surroundpower,"Surround Off") {When the button is off, it will say it's off}
  293.  
  294. purge_group(0,0)
  295. purge_group(5,0) {Group Index, Mode - Surround Power being the first group, and unloaded if the button is off}
  296. purge_group(10,0)
  297. else
  298.  
  299. set_text($surroundpower,"Surround On") {When the button is on, it will say it's on!}
  300.  
  301. purge_group(0,1)
  302. purge_group(5,1) {Else (if it is on!) then load the samples in group 1}
  303. purge_group(10,1)
  304. end if
  305. end on
  306.  
  307. on ui_control ($outpower)
  308.  
  309. if ($outpower = 0)
  310.  
  311. set_text($outpower, "Out. Off")
  312.  
  313. purge_group(1,0)
  314. purge_group(6,0)
  315. purge_group(11,0)
  316.  
  317. else
  318.  
  319. set_text($outpower, "Out. On")
  320.  
  321. purge_group(1,1)
  322. purge_group(6,1)
  323. purge_group(11,1)
  324.  
  325. end if
  326.  
  327.  
  328. end on
  329.  
  330. on ui_control ($deccapower)
  331.  
  332. if ($deccapower = 0)
  333.  
  334. set_text($deccapower,"Decca. Off")
  335.  
  336. purge_group(2,0)
  337. purge_group(7,0)
  338. purge_group(12,0)
  339.  
  340. else
  341.  
  342. set_text($deccapower,"Decca. On")
  343.  
  344. purge_group(2,1)
  345. purge_group(7,1)
  346. purge_group(12,1)
  347. end if
  348.  
  349. end on
  350.  
  351. on ui_control ($closepower)
  352.  
  353. if ($closepower = 0)
  354.  
  355. set_text($closepower, "Out. Off")
  356.  
  357. purge_group(3,0)
  358. purge_group(8,0)
  359. purge_group(13,0)
  360.  
  361. else
  362.  
  363. set_text($closepower, "Close On")
  364.  
  365. purge_group(3,1)
  366. purge_group(8,1)
  367. purge_group(13,1)
  368. end if
  369.  
  370. end on
  371.  
  372. on ui_control ($mixpower)
  373.  
  374. if ($mixpower = 0)
  375.  
  376. set_text($mixpower, "Mix. Off")
  377.  
  378. purge_group(4,0)
  379. purge_group(9,0)
  380. purge_group(14,0)
  381.  
  382. else
  383.  
  384. set_text($mixpower, "Mix. On")
  385.  
  386. purge_group(4,1)
  387. purge_group(9,1)
  388. purge_group(14,1)
  389.  
  390. end if
  391.  
  392. end on
  393.  
  394. {AHDSR Workings}
  395.  
  396.  
  397. on ui_control ($Attack)
  398.  
  399. $ahdsr := 0
  400.  
  401. while($ahdsr < $NUM_GROUPS)
  402.  
  403. _set_engine_par($ENGINE_PAR_ATTACK,$Attack,$ahdsr,0,-1)
  404.  
  405. inc($ahdsr)
  406.  
  407. end while
  408.  
  409. set_knob_label($Attack, get_engine_par_disp($ENGINE_PAR_ATTACK, 0, 0, -1))
  410.  
  411. wait(10)
  412.  
  413. set_knob_label($Attack, get_engine_par_disp($ENGINE_PAR_ATTACK, 0, 0, -1))
  414.  
  415. end on
  416.  
  417.  
  418. on ui_control ($Hold)
  419.  
  420. $ahdsr := 0
  421.  
  422. while($ahdsr < $NUM_GROUPS)
  423.  
  424. _set_engine_par($ENGINE_PAR_HOLD,$Hold,$ahdsr,0,-1)
  425.  
  426. inc($ahdsr)
  427.  
  428. end while
  429.  
  430. set_knob_label($Hold, get_engine_par_disp($ENGINE_PAR_HOLD, 0, 0, -1))
  431.  
  432. wait(10)
  433.  
  434. set_knob_label($Hold, get_engine_par_disp($ENGINE_PAR_HOLD, 0, 0, -1))
  435.  
  436. end on
  437.  
  438. on ui_control ($Decay)
  439.  
  440. $ahdsr := 0
  441.  
  442. while($ahdsr < $NUM_GROUPS)
  443.  
  444. _set_engine_par($ENGINE_PAR_DECAY,$Decay,$ahdsr,0,-1)
  445.  
  446. inc($ahdsr)
  447.  
  448. end while
  449.  
  450. set_knob_label($Decay, get_engine_par_disp($ENGINE_PAR_DECAY, 0, 0, -1))
  451.  
  452. wait(10)
  453.  
  454. set_knob_label($Decay, get_engine_par_disp($ENGINE_PAR_DECAY, 0, 0, -1))
  455.  
  456. end on
  457.  
  458. on ui_control ($Sustain)
  459.  
  460. $ahdsr := 0
  461.  
  462. while($ahdsr < $NUM_GROUPS)
  463.  
  464. _set_engine_par($ENGINE_PAR_SUSTAIN,$Sustain,$ahdsr,0,-1)
  465.  
  466. inc($ahdsr)
  467.  
  468. end while
  469.  
  470. set_knob_label($Sustain, get_engine_par_disp($ENGINE_PAR_SUSTAIN, 0, 0, -1))
  471.  
  472. wait(10)
  473.  
  474. set_knob_label($Sustain, get_engine_par_disp($ENGINE_PAR_SUSTAIN, 0, 0, -1))
  475.  
  476. end on
  477.  
  478. on ui_control ($Release)
  479.  
  480. $ahdsr := 0
  481.  
  482. while($ahdsr < $NUM_GROUPS)
  483.  
  484. _set_engine_par($ENGINE_PAR_RELEASE,$Release,$ahdsr,0,-1)
  485.  
  486. inc($ahdsr)
  487.  
  488. end while
  489.  
  490. set_knob_label($Release, get_engine_par_disp($ENGINE_PAR_RELEASE, 0, 0, -1))
  491.  
  492. wait(10)
  493.  
  494. set_knob_label($Release, get_engine_par_disp($ENGINE_PAR_RELEASE, 0, 0, -1))
  495.  
  496. end on
  497.  
  498. {CONVOLUTION REVERB}
  499.  
  500. on ui_control ($reverb)
  501.  
  502. if ($reverb = 0)
  503.  
  504. set_text($reverb, "Convo. Off")
  505.  
  506. set_engine_par($ENGINE_PAR_SEND_EFFECT_BYPASS,1,-1,6,1)
  507.  
  508. else
  509.  
  510. set_text($reverb, "Convo. On")
  511.  
  512. set_engine_par($ENGINE_PAR_SEND_EFFECT_BYPASS,0,-1,6,1)
  513.  
  514. end if
  515.  
  516. end on
  517.  
  518. on ui_control ($convowet)
  519.  
  520. set_engine_par($ENGINE_PAR_SEND_EFFECT_OUTPUT_GAIN,$convowet,-1,6,1)
  521.  
  522. set_text($ConvInfo," Wet Slider")
  523.  
  524. end on
  525.  
  526. on ui_control ($convodry)
  527.  
  528. set_engine_par($ENGINE_PAR_SEND_EFFECT_DRY_LEVEL,$convodry,-1,6,1)
  529.  
  530. set_text($ConvInfo," Dry Slider")
  531.  
  532. end on
  533.  
  534. on ui_control ($convodelay)
  535.  
  536. set_engine_par($ENGINE_PAR_IRC_PREDELAY,$convodelay,-1,6,1)
  537.  
  538. set_text($ConvInfo," Delay Slider")
  539.  
  540. end on
  541.  
  542. on ui_control ($convoearlyir)
  543.  
  544. set_engine_par($ENGINE_PAR_IRC_LENGTH_RATIO_ER,$convoearlyir,-1,6,1)
  545.  
  546. set_text($ConvInfo," Early Ir")
  547.  
  548. end on
  549.  
  550. on ui_control ($convolateir)
  551.  
  552. set_engine_par($ENGINE_PAR_IRC_LENGTH_RATIO_LR,$convolateir,-1,6,1)
  553.  
  554. set_text($ConvInfo," Late Ir")
  555.  
  556. end on
  557.  
  558. {here begins code for the text, that Kontakt displays when certain notes are pressed down}
  559.  
  560. on note
  561.  
  562. select ($EVENT_NOTE)
  563.  
  564. case 24 {this is just the midi number for the key}
  565. message ("C octave (Ori.)")
  566.  
  567.  
  568. end select
  569.  
  570. end on
  571.  
  572.  
  573. {here begins code for the text, that Kontakt displays when notes are released}
  574.  
  575. on release
  576.  
  577. message ("Play a note")
  578.  
  579. end on
Advertisement
Add Comment
Please, Sign In to add comment