소스 검색

patch structuring

created subpatch dedicated to OSC/serial part and an abstraction
"stepper" to handle each steppers by index
Etienne Landon 7 년 전
부모
커밋
fb6280048f
2개의 변경된 파일102개의 추가작업 그리고 51개의 파일을 삭제
  1. 63 51
      OSCstepperCtl.pd
  2. 39 0
      stepper.pd

+ 63 - 51
OSCstepperCtl.pd

@@ -1,43 +1,6 @@
-#N canvas 1066 118 742 243 10;
-#N canvas 978 417 450 300 slipSerial 1;
-#X obj 95 179 mrpeach/slipdec 65536;
-#X obj 99 47 mrpeach/slipenc 65536;
-#X obj 303 65 loadbang;
-#X obj 299 22 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
--1;
-#X obj 76 16 inlet;
-#X obj 95 200 outlet;
-#X obj 261 46 inlet;
-#X obj 57 157 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
--1;
-#X obj 99 120 comport;
-#X obj 301 199 print errors;
-#X msg 390 42;
-#X obj 226 19 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
--1;
-#X msg 394 122 devices;
-#X msg 132 95 devicename /dev/ttyACM0 \, pollintervall 1;
-#X msg 296 142 baud 9600;
-#X connect 0 0 5 0;
-#X connect 1 0 8 0;
-#X connect 2 0 13 0;
-#X connect 2 0 14 0;
-#X connect 4 0 1 0;
-#X connect 6 0 8 0;
-#X connect 8 0 0 0;
-#X connect 8 0 7 0;
-#X connect 8 1 9 0;
-#X connect 11 0 8 0;
-#X connect 12 0 8 0;
-#X connect 13 0 8 0;
-#X connect 14 0 8 0;
-#X restore 59 160 pd slipSerial;
-#X obj 59 102 mrpeach/packOSC;
+#N canvas 333 476 742 563 10;
 #X obj 59 76 r OSCout;
-#X obj 59 202 s OSCin;
-#X obj 59 181 mrpeach/unpackOSC;
 #X msg 197 152 close;
-#X obj 136 211 print;
 #X msg 126 28 /test;
 #X floatatom 194 31 5 0 0 0 - - -, f 5;
 #X msg 240 21 /stepper/currentPos;
@@ -45,17 +8,66 @@
 4 \, verbose 1;
 #X msg 309 53 /stepper/acceleration 0 100000;
 #X msg 203 81 send /stepper/maxSpeed 0 1e+07;
-#X msg 159 54 /stepper/moveTo 0 \$1;
-#X connect 0 0 4 0;
-#X connect 1 0 0 0;
-#X connect 2 0 1 0;
-#X connect 4 0 3 0;
-#X connect 4 0 6 0;
-#X connect 5 0 0 1;
-#X connect 7 0 1 0;
-#X connect 8 0 13 0;
-#X connect 9 0 1 0;
-#X connect 10 0 0 1;
-#X connect 11 0 1 0;
-#X connect 12 0 1 0;
+#N canvas 305 148 783 472 SerialOSC 0;
+#X obj 99 6 inlet;
+#X obj 99 332 outlet;
+#X obj 99 200 comport;
+#X obj 301 279 print errors;
+#X msg 590 173 devices;
+#X obj 112 299 s /fromOSC;
+#X obj 122 49 r /toOSC;
+#X msg 398 112 open 0 \, baud 115200 \, pollintervall 1 \, verbose
+1;
+#X obj 368 52 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+1;
+#X obj 368 72 route 0 1;
+#X msg 368 134 close;
+#X obj 59 391 mrpeach/unpackOSC;
+#X obj 99 231 mrpeach/slipdec 65536;
+#X obj 99 261 mrpeach/unpackOSC;
+#X obj 99 97 mrpeach/packOSC;
+#X obj 99 122 mrpeach/slipenc 65536;
+#X connect 0 0 14 0;
+#X connect 2 0 12 0;
+#X connect 2 1 3 0;
+#X connect 4 0 2 0;
+#X connect 6 0 14 0;
+#X connect 7 0 2 0;
+#X connect 8 0 9 0;
+#X connect 9 0 10 0;
+#X connect 9 1 7 0;
+#X connect 10 0 2 0;
+#X connect 12 0 13 0;
 #X connect 13 0 1 0;
+#X connect 13 0 5 0;
+#X connect 14 0 15 0;
+#X connect 15 0 2 0;
+#X coords 0 -1 1 1 85 60 1 300 50;
+#X restore 65 454 pd SerialOSC;
+#X obj 59 202 s /toOSC;
+#X obj 361 220 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+1;
+#X obj 455 188 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+1;
+#X msg 361 292 /stepper/moveTo 0 1000;
+#X obj 361 240 metro 2000;
+#X obj 455 208 metro 2000;
+#X msg 455 260 /stepper/moveTo 0 0;
+#X obj 187 514 print OSCin;
+#X obj 125 350 stepper 0;
+#X msg 159 54 /stepper/moveTo 0 \$1;
+#X obj 188 468 r /fromOSC;
+#X obj 188 490 route /stepper/status;
+#X obj 223 353 stepper 1;
+#X connect 3 0 18 0;
+#X connect 6 0 9 0;
+#X connect 7 0 9 0;
+#X connect 10 0 13 0;
+#X connect 11 0 14 0;
+#X connect 12 0 9 0;
+#X connect 13 0 12 0;
+#X connect 14 0 15 0;
+#X connect 15 0 9 0;
+#X connect 18 0 9 0;
+#X connect 19 0 20 0;
+#X connect 20 1 16 0;

+ 39 - 0
stepper.pd

@@ -0,0 +1,39 @@
+#N canvas 1 57 1205 375 10;
+#X obj 61 22 r /fromOSC;
+#X obj 61 44 t a a;
+#X obj 93 92 == \$1;
+#X obj 61 135 spigot;
+#X obj 237 134 print;
+#X obj 61 159 route /stepper/status;
+#X msg 93 70 \$1;
+#X obj 61 181 unpack f f f f f;
+#X floatatom 87 212 5 0 0 0 - - -, f 5;
+#X floatatom 117 242 5 0 0 0 - - -, f 5;
+#X floatatom 147 272 5 0 0 0 - - -, f 5;
+#X floatatom 177 302 5 0 0 0 - - -, f 5;
+#X text 135 212 current;
+#X text 161 241 target;
+#X text 191 273 speed;
+#X text 228 298 maxspeed;
+#X msg 518 282 /stepper/\$1 \$3 \$2;
+#X obj 518 250 pack s f f;
+#X obj 585 227 f \$1;
+#X obj 585 205 loadbang;
+#X msg 521 142 move 5000;
+#X obj 518 304 s /toOSC;
+#X connect 0 0 1 0;
+#X connect 1 0 3 0;
+#X connect 1 1 6 0;
+#X connect 2 0 3 1;
+#X connect 3 0 5 0;
+#X connect 5 0 7 0;
+#X connect 6 0 2 0;
+#X connect 7 1 8 0;
+#X connect 7 2 9 0;
+#X connect 7 3 10 0;
+#X connect 7 4 11 0;
+#X connect 16 0 21 0;
+#X connect 17 0 16 0;
+#X connect 18 0 17 2;
+#X connect 19 0 18 0;
+#X connect 20 0 17 0;