Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. on init
  2. make_perfview
  3.  
  4. declare $count {Used for Array counter}
  5.  
  6. {declare all ui buttons, knobs etc}
  7. declare ui_slider $attack (0, 127)
  8. declare ui_slider $decay (0, 127)
  9. declare ui_slider $sustain (0, 127)
  10. declare ui_slider $release (0, 127)
  11. declare ui_button $b1
  12. declare ui_button $b2
  13. declare ui_button $b3
  14. declare ui_button $b4
  15. declare ui_knob $k1 (0, 127, 1)
  16. declare ui_knob $k2 (0, 127, 1)
  17. declare ui_knob $k3 (0, 127, 1)
  18. declare ui_knob $k4 (0, 127, 1)
  19.  
  20. declare %gui[12] {move all IDs into array for easy recal}
  21. %gui[0] := get_ui_id($attack)
  22. %gui[1] := get_ui_id($decay)
  23. %gui[2] := get_ui_id($sustain)
  24. %gui[3] := get_ui_id($release)
  25. %gui[4] := get_ui_id($b1)
  26. %gui[5] := get_ui_id($b2)
  27. %gui[6] := get_ui_id($b3)
  28. %gui[7] := get_ui_id($b4)
  29. %gui[8] := get_ui_id($k1)
  30. %gui[9] := get_ui_id($k2)
  31. %gui[10] := get_ui_id($k3)
  32. %gui[11] := get_ui_id($k4)
  33.  
  34.  
  35. declare ui_menu $onoff {Show menu - set original value and position}
  36. add_menu_item ($onoff,"ADSR",0)
  37. add_menu_item ($onoff,"buttons",1)
  38. add_menu_item ($onoff,"knobs",2)
  39. $onoff := 0
  40. move_control($onoff,1,1)
  41.  
  42. $count :=0 {Show sliders/ Reverb controls - Hide others}
  43. while ($count < 4)
  44. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_PART_NOTHING)
  45. inc($count)
  46. end while
  47.  
  48. $count := 4
  49. while ($count < 12)
  50. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)
  51. inc($count)
  52. end while
  53.  
  54. end on
  55.  
  56.  
  57. on ui_control ($onoff)
  58. select ($onoff)
  59. case 0 {Show sliders - Hide buttons - Hide Knobs}
  60. $count :=0
  61. while ($count < 4)
  62. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_PART_NOTHING)
  63. inc($count)
  64. end while
  65.  
  66. $count := 4
  67. while ($count < 12)
  68. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)
  69. inc($count)
  70. end while
  71.  
  72. case 1 {Hides sliders - Show buttons - Hide Knobs}
  73. $count :=0
  74. while ($count < 4)
  75. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)
  76. inc($count)
  77. end while
  78.  
  79. $count := 4
  80. while ($count < 8)
  81. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_PART_NOTHING)
  82. inc($count)
  83. end while
  84.  
  85. $count := 8
  86. while ($count < 12)
  87. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)
  88. inc($count)
  89. end while
  90.  
  91. case 2 {Hides sliders and buttons - show Knobs}
  92.  
  93. $count :=0
  94. while ($count < 4)
  95. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)
  96. inc($count)
  97. end while
  98.  
  99. $count := 4
  100. while ($count < 8)
  101. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)
  102. inc($count)
  103. end while
  104.  
  105. $count := 8
  106. while ($count < 12)
  107. set_control_par(%gui[$count], $CONTROL_PAR_HIDE, $HIDE_PART_NOTHING)
  108. inc($count)
  109. end while
  110.  
  111. end select
  112. end on
  113.  
  114.  
  115.  
  116. on note
  117. {nothing at the moment just working on %gui}
  118. end on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement