BrandonSpendlove

Kontakt - AHDSR - Control all groups

Mar 28th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. on init
  2. make_perfview
  3.  
  4. declare $count
  5.  
  6. declare ui_knob $Attack (0,1000000,1)
  7. declare ui_knob $Hold (0,1000000,1)
  8. declare ui_knob $Decay (0,1000000,1)
  9. declare ui_knob $Sustain (0,1000000,1)
  10. declare ui_knob $Release (0,1000000,1)
  11.  
  12. set_knob_unit($Attack, $KNOB_UNIT_MS)
  13. set_knob_unit($Hold, $KNOB_UNIT_MS)
  14. set_knob_unit($Decay, $KNOB_UNIT_MS)
  15. set_knob_unit($Sustain, $KNOB_UNIT_DB)
  16. set_knob_unit($Release, $KNOB_UNIT_MS)
  17.  
  18. $Attack := get_engine_par($ENGINE_PAR_ATTACK, 0, find_mod(0,"ENV_AHDSR"), -1)
  19. $Hold := get_engine_par($ENGINE_PAR_HOLD, 0, find_mod(0,"ENV_AHDSR"), -1)
  20. $Decay := get_engine_par($ENGINE_PAR_DECAY, 0, find_mod(0,"ENV_AHDSR"), -1)
  21. $Sustain := get_engine_par($ENGINE_PAR_SUSTAIN, 0, find_mod(0,"ENV_AHDSR"), -1)
  22. $Release := get_engine_par($ENGINE_PAR_RELEASE, 0, find_mod(0,"ENV_AHDSR"), -1)
  23.  
  24. make_persistent($Attack)
  25. make_persistent($Hold)
  26. make_persistent($Decay)
  27. make_persistent($Sustain)
  28. make_persistent($Release)
  29.  
  30. read_persistent_var($Attack)
  31. read_persistent_var($Hold)
  32. read_persistent_var($Decay)
  33. read_persistent_var($Sustain)
  34. read_persistent_var($Release)
  35.  
  36. set_knob_label($Attack, get_engine_par_disp($ENGINE_PAR_ATTACK, 0, find_mod(0,"ENV_AHDSR"), -1))
  37. set_knob_label($Hold, get_engine_par_disp($ENGINE_PAR_HOLD, 0, find_mod(0,"ENV_AHDSR"), -1))
  38. set_knob_label($Decay, get_engine_par_disp($ENGINE_PAR_DECAY, 0, find_mod(0,"ENV_AHDSR"), -1))
  39. set_knob_label($Sustain, get_engine_par_disp($ENGINE_PAR_SUSTAIN, 0, find_mod(0,"ENV_AHDSR"), -1))
  40. set_knob_label($Release, get_engine_par_disp($ENGINE_PAR_RELEASE, 0, find_mod(0,"ENV_AHDSR"), -1))
  41.  
  42. message("")
  43. end on
  44.  
  45.  
  46. on ui_control ($Attack)
  47. $count := -1 {I've change here and all the others to -1, this controls all groups instead of the 1st Instrument group in Kontakt}
  48. while ($count < $NUM_GROUPS)
  49. set_engine_par($ENGINE_PAR_ATTACK, $Attack, $count, find_mod(0,"ENV_AHDSR"), -1)
  50. inc($count)
  51. end while
  52.  
  53. set_knob_label($Attack, get_engine_par_disp($ENGINE_PAR_ATTACK, 0, 0, -1))
  54. end on
  55.  
  56. on ui_control ($Hold)
  57. $count := -1
  58. while ($count < $NUM_GROUPS)
  59. set_engine_par($ENGINE_PAR_HOLD, $Hold, $count, find_mod(0,"ENV_AHDSR"), -1)
  60. inc($count)
  61. end while
  62.  
  63. set_knob_label($Hold, get_engine_par_disp($ENGINE_PAR_HOLD, 0, 0, -1))
  64. end on
  65.  
  66. on ui_control ($Decay)
  67. $count := -1
  68. while ($count < $NUM_GROUPS)
  69. set_engine_par($ENGINE_PAR_DECAY, $Decay, $count, find_mod(0,"ENV_AHDSR"), -1)
  70. inc($count)
  71. end while
  72.  
  73. set_knob_label($Decay, get_engine_par_disp($ENGINE_PAR_DECAY, 0, 0, -1))
  74. end on
  75.  
  76. on ui_control ($Sustain)
  77. $count := -1
  78. while ($count < $NUM_GROUPS)
  79. set_engine_par($ENGINE_PAR_SUSTAIN, $Sustain, $count, find_mod(0,"ENV_AHDSR"), -1)
  80. inc($count)
  81. end while
  82.  
  83. set_knob_label($Sustain, get_engine_par_disp($ENGINE_PAR_SUSTAIN, 0, 0, -1))
  84. end on
  85.  
  86. on ui_control ($Release)
  87. $count := -1
  88. while ($count < $NUM_GROUPS)
  89. set_engine_par($ENGINE_PAR_RELEASE, $Release, $count, find_mod(0,"ENV_AHDSR"), -1)
  90. inc($count)
  91. end while
  92.  
  93. set_knob_label($Release, get_engine_par_disp($ENGINE_PAR_RELEASE, 0, 0, -1))
  94. end on
Advertisement
Add Comment
Please, Sign In to add comment