benedict_naebers

OsciiBot Xtouch

Dec 29th, 2020
33
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @input osc_in OSC "4.0.0.1:9000" //Loopback Port
  2. @output osc_out OSC "4.0.0.1:8000" 2048 0 //Loopback port
  3. @input midi_in MIDI "X-TOUCH MINI" //name of MIDI Device
  4.  
  5. @init
  6. up = 30;
  7. down = 80;
  8.  
  9. @midimsg
  10. printf("%d, %d, %d\n", msg1, msg2, msg3);
  11.  
  12.  
  13.  
  14. //-------------------------------------------------------------------
  15. //Parameter select and FX Link
  16. //-------------------------------------------------------------------
  17.  
  18. msg1 == 154 ? (
  19. //Int
  20. msg2 == 0 ? (
  21. osc_button_number = 6101;
  22. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  23.  
  24. );
  25.  
  26. //Pan Tilt
  27. msg2 == 1 ? (
  28. osc_button_number = 6102;
  29. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  30. );
  31.  
  32. //Color
  33. msg2 == 2 ? (
  34. osc_button_number = 6103;
  35. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  36. );
  37.  
  38. //Gobo
  39. msg2 == 3 ? (
  40. osc_button_number = 6104;
  41. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  42. );
  43.  
  44. //Beam
  45. msg2 == 4 ? (
  46. osc_button_number = 6105;
  47. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  48. );
  49.  
  50. //FX
  51. msg2 == 5 ? (
  52. osc_button_number = 6201;
  53. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  54. );
  55. msg2 == 6 ? (
  56. osc_button_number = 6202;
  57. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  58. );
  59. msg2 == 7 ? (
  60. osc_button_number = 6203;
  61. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  62. );
  63. msg2 == 8 ? (
  64. osc_button_number = 6205;
  65. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  66. );
  67. );
  68.  
  69. msg1 == 154 ? (
  70. msg2 == 22 ? (
  71. osc_button_number = 5103;
  72. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  73. );
  74. msg2 == 23 ? (
  75. osc_button_number = 5401;
  76. oscsend(osc_out, "i/Mx/button/%d", 1, osc_button_number);
  77. );
  78.  
  79. );
  80. msg1 == 138 ? (
  81. msg2 == 22 ? (
  82. osc_button_number = 5103;
  83. oscsend(osc_out, "i/Mx/button/%d", 0, osc_button_number);
  84. );
  85. msg2 == 23 ? (
  86. osc_button_number = 5401;
  87. oscsend(osc_out, "i/Mx/button/%d", 0, osc_button_number);
  88. );
  89.  
  90. );
  91.  
  92.  
  93. //-------------------------------------------------------------------
  94. //Encoder
  95. //-------------------------------------------------------------------
  96.  
  97. //Belt 1
  98. msg1 == 186 && msg2 == 1 ? (
  99. osc_encoder_number = 6112;
  100. msg3 < up ? (
  101. i=0;
  102. while(
  103. printf("up: %d\n", i);
  104. oscsend(osc_out, "i/Mx/belt/%d", 1, osc_encoder_number);
  105. i=i+1;
  106. i < msg3;
  107. );
  108. ) : (
  109. i=127;
  110. while(
  111. oscsend(osc_out, "i/Mx/belt/%d", -1, osc_encoder_number);
  112. i=i-1;
  113. printf("down: %d\n", i);
  114. i >= msg3;
  115. );
  116. );
  117. );
  118. //Belt 2
  119. msg1 == 186 && msg2 == 2 ? (
  120. osc_encoder_number = 6122;
  121. msg3 < up ? (
  122. i=0;
  123. while(
  124. printf("up: %d\n", i);
  125. oscsend(osc_out, "i/Mx/belt/%d", 1, osc_encoder_number);
  126. i=i+1;
  127. i < msg3;
  128. );
  129. ) : (
  130. i=127;
  131. while(
  132. oscsend(osc_out, "i/Mx/belt/%d", -1, osc_encoder_number);
  133. i=i-1;
  134. printf("down: %d\n", i);
  135. i >= msg3;
  136. );
  137. );
  138. );
  139. //Belt 3
  140. msg1 == 186 && msg2 == 3 ? (
  141. osc_encoder_number = 6132;
  142. msg3 < up ? (
  143. i=0;
  144. while(
  145. printf("up: %d\n", i);
  146. oscsend(osc_out, "i/Mx/belt/%d", 1, osc_encoder_number);
  147. i=i+1;
  148. i < msg3;
  149. );
  150. ) : (
  151. i=127;
  152. while(
  153. oscsend(osc_out, "i/Mx/belt/%d", -1, osc_encoder_number);
  154. i=i-1;
  155. printf("down: %d\n", i);
  156. i >= msg3;
  157. );
  158. );
  159. );
  160. //Belt 4
  161. msg1 == 186 && msg2 == 4 ? (
  162. osc_encoder_number = 6142;
  163. msg3 < up ? (
  164. i=0;
  165. while(
  166. printf("up: %d\n", i);
  167. oscsend(osc_out, "i/Mx/belt/%d", 1, osc_encoder_number);
  168. i=i+1;
  169. i < msg3;
  170. );
  171. ) : (
  172. i=127;
  173. while(
  174. oscsend(osc_out, "i/Mx/belt/%d", -1, osc_encoder_number);
  175. i=i-1;
  176. printf("down: %d\n", i);
  177. i >= msg3;
  178. );
  179. );
  180. );
  181. //Belt 5
  182. msg1 == 186 && msg2 == 5 ? (
  183. osc_encoder_number = 6212;
  184. msg3 < up ? (
  185. i=0;
  186. while(
  187. printf("up: %d\n", i);
  188. oscsend(osc_out, "i/Mx/belt/%d", 1, osc_encoder_number);
  189. i=i+1;
  190. i < msg3;
  191. );
  192. ) : (
  193. i=127;
  194. while(
  195. oscsend(osc_out, "i/Mx/belt/%d", -1, osc_encoder_number);
  196. i=i-1;
  197. printf("down: %d\n", i);
  198. i >= msg3;
  199. );
  200. );
  201. );
  202. //Belt 6
  203. msg1 == 186 && msg2 == 6 ? (
  204. osc_encoder_number = 6222;
  205. msg3 < up ? (
  206. i=0;
  207. while(
  208. printf("up: %d\n", i);
  209. oscsend(osc_out, "i/Mx/belt/%d", 1, osc_encoder_number);
  210. i=i+1;
  211. i < msg3;
  212. );
  213. ) : (
  214. i=127;
  215. while(
  216. oscsend(osc_out, "i/Mx/belt/%d", -1, osc_encoder_number);
  217. i=i-1;
  218. printf("down: %d\n", i);
  219. i >= msg3;
  220. );
  221. );
  222. );
  223. //Belt 7
  224. msg1 == 186 && msg2 == 7 ? (
  225. osc_encoder_number = 6232;
  226. msg3 < up ? (
  227. i=0;
  228. while(
  229. printf("up: %d\n", i);
  230. oscsend(osc_out, "i/Mx/belt/%d", 1, osc_encoder_number);
  231. i=i+1;
  232. i < msg3;
  233. );
  234. ) : (
  235. i=127;
  236. while(
  237. oscsend(osc_out, "i/Mx/belt/%d", -1, osc_encoder_number);
  238. i=i-1;
  239. printf("down: %d\n", i);
  240. i >= msg3;
  241. );
  242. );
  243. );
  244. //Belt 8
  245. msg1 == 186 && msg2 == 8 ? (
  246. osc_encoder_number = 6242;
  247. msg3 < up ? (
  248. i=0;
  249. while(
  250. printf("up: %d\n", i);
  251. oscsend(osc_out, "i/Mx/belt/%d", 1, osc_encoder_number);
  252. i=i+1;
  253. i < msg3;
  254. );
  255. ) : (
  256. i=127;
  257. while(
  258. oscsend(osc_out, "i/Mx/belt/%d", -1, osc_encoder_number);
  259. i=i-1;
  260. printf("down: %d\n", i);
  261. i >= msg3;
  262. );
  263. );
  264. );
  265.  
  266. @oscmsg
  267. //printf("------------------------%s\n", oscstr)
RAW Paste Data