Advertisement
BrandonSpendlove

Kontakt - Filter Script Example

Nov 29th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. {Make sure the 4-POLE LP FILTER is in the INSERT FX's first SLOT, This small script provides a on/off button for the fitler to be switched on/off}
  2.  
  3. {Here is a link to the NKI example itself + Script:
  4.  
  5. http://www.newgrounds.com/dump/item/ec6948e2d3b534411534f09138c067e1
  6.  
  7. }
  8.  
  9.  
  10. on init
  11.  
  12.  
  13.  
  14. message ("")
  15.  
  16.  
  17.  
  18. make_perfview
  19.  
  20. set_ui_height_px (100)
  21.  
  22.  
  23.  
  24.  
  25.  
  26. declare ui_knob $cutoff (0,1000000,1)
  27.  
  28. declare ui_knob $reso (0,1000000,1)
  29.  
  30.  
  31.  
  32. declare ui_button $power
  33.  
  34.  
  35.  
  36. set_text($cutoff, "Cutoff")
  37.  
  38. set_text($reso, "Reso")
  39.  
  40. set_text($power, "Filter Off")
  41.  
  42.  
  43.  
  44. move_control($cutoff, 6,1)
  45.  
  46. move_control($reso, 5,1)
  47.  
  48.  
  49.  
  50. set_knob_label($cutoff,get_engine_par_disp($ENGINE_PAR_CUTOFF,-1,0,1))
  51.  
  52. set_knob_label($reso,get_engine_par_disp($ENGINE_PAR_RESONANCE,-1,0,1))
  53.  
  54.  
  55.  
  56. set_engine_par($ENGINE_PAR_CUTOFF,$cutoff, -1, 0, 1)
  57.  
  58. set_engine_par($ENGINE_PAR_RESONANCE,$reso, -1, 0, 1)
  59.  
  60.  
  61.  
  62. set_knob_unit($cutoff,$KNOB_UNIT_PERCENT)
  63.  
  64. set_knob_unit($reso,$KNOB_UNIT_HZ)
  65.  
  66.  
  67.  
  68. end on
  69.  
  70.  
  71.  
  72. on ui_control ($cutoff)
  73.  
  74.  
  75.  
  76. set_engine_par($ENGINE_PAR_CUTOFF,$cutoff, -1, 0, 1)
  77.  
  78.  
  79.  
  80. set_knob_label($cutoff,get_engine_par_disp($ENGINE_PAR_CUTOFF,-1,0,1))
  81.  
  82.  
  83.  
  84. end on
  85.  
  86.  
  87.  
  88. on ui_control ($reso)
  89.  
  90.  
  91.  
  92. set_engine_par($ENGINE_PAR_RESONANCE,$reso, -1, 0, 1)
  93.  
  94.  
  95.  
  96. set_knob_label($reso,get_engine_par_disp($ENGINE_PAR_RESONANCE,-1,0,1))
  97.  
  98.  
  99.  
  100. end on
  101.  
  102.  
  103.  
  104. on ui_control ($power)
  105.  
  106.  
  107.  
  108. if ($power = 1)
  109.  
  110.  
  111.  
  112. set_engine_par($ENGINE_PAR_EFFECT_BYPASS,0,-1,0,1)
  113.  
  114.  
  115.  
  116. set_text($power, "Filter On")
  117.  
  118.  
  119.  
  120. end if
  121.  
  122.  
  123.  
  124. if ($power = 0)
  125.  
  126.  
  127.  
  128. set_engine_par($ENGINE_PAR_EFFECT_BYPASS,1,-1,0,1)
  129.  
  130.  
  131.  
  132. set_text($power, "Filter Off")
  133.  
  134.  
  135.  
  136. end if
  137.  
  138.  
  139.  
  140. end on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement