Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Commit

Permalink
Replace [import] with [declare] in examples.
Browse files Browse the repository at this point in the history
Fixes #61
  • Loading branch information
residuum committed May 6, 2022
1 parent b1c602e commit c505f1b
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 64 deletions.
9 changes: 5 additions & 4 deletions examples/purest-json-test.pd
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#N canvas 46 68 1298 769 10;
#X declare -path purest_json -stdlib zexy;
#X obj 415 136 json-encode;
#X msg 876 36 bang;
#X msg 874 82 clear;
#X obj 454 185 print json-encoded data;
#X obj 434 254 json-decode;
#X msg 309 42 add value 440;
#X obj 207 529 line;
#X floatatom 207 556 5 0 0 0 - - -;
#X floatatom 207 556 5 0 0 0 - - - 0;
#X obj 206 476 pack f f f;
#X msg 206 504 \$1 \, \$2 \$3;
#X msg 424 93 add start 10;
Expand Down Expand Up @@ -68,9 +69,9 @@
#X obj 604 319 rest http://127.0.0.1:5984/;
#X obj 206 329 json-decode;
#X obj 194 292 rest;
#X obj 888 549 import purest_json zexy;
#X obj 714 483 print array-done;
#X obj 860 483 print array-decode;
#X obj 888 549 declare -path purest_json -stdlib zexy;
#X connect 0 0 37 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
Expand Down Expand Up @@ -102,8 +103,8 @@
#X connect 28 0 40 0;
#X connect 29 0 35 0;
#X connect 30 0 29 0;
#X connect 31 0 44 0;
#X connect 31 1 45 0;
#X connect 31 0 43 0;
#X connect 31 1 44 0;
#X connect 35 0 31 0;
#X connect 37 0 24 0;
#X connect 37 1 4 0;
Expand Down
63 changes: 32 additions & 31 deletions examples/the-sound-of-money.pd
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#N canvas 422 63 1023 589 10;
#X declare -stdlib zexy -path purest_json;
#X obj 426 514 dac~;
#X obj 433 460 *~ 0;
#X obj 432 412 line \$1 20;
#X obj 658 60 import zexy purest_json;
#X obj 434 484 *~ 0;
#X obj 544 316 vsl 15 128 0 1 0 0 empty empty volume 0 -9 0 10 -262144
-1 -1 0 1;
#X obj 544 316 vsl 15 128 0 1 0 0 empty empty volume 0 -9 0 10 #fcfcfc
#000000 #000000 0 1;
#X obj 174 73 rest;
#X obj 81 68 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X floatatom 193 346 7 0 0 3 USD - -;
#X symbolatom 254 346 10 0 0 3 Date - -;
#X obj 81 68 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000
0 1;
#X floatatom 193 346 7 0 0 3 USD - - 0;
#X symbolatom 254 346 10 0 0 3 Date - - 0;
#X obj 432 434 osc~;
#X obj 181 153 t b b;
#N canvas 626 288 864 436 print-to-console 0;
Expand Down Expand Up @@ -96,28 +96,29 @@
#X obj 184 110 json-decode, f 12;
#X msg 174 44 GET https://ix.residuum.org/pd/bitcoin_example.php;
#X obj 32 322 print;
#X connect 1 0 4 0;
#X connect 2 0 10 0;
#X connect 4 0 0 1;
#X connect 4 0 0 0;
#X connect 5 0 4 1;
#X connect 6 0 12 0;
#X connect 6 1 17 0;
#X connect 6 1 19 0;
#X connect 7 0 12 3;
#X connect 10 0 1 0;
#X connect 11 0 16 0;
#X connect 11 1 13 0;
#X connect 13 0 8 0;
#X obj 655 60 declare -stdlib zexy -path purest_json;
#X connect 1 0 3 0;
#X connect 2 0 9 0;
#X connect 3 0 0 1;
#X connect 3 0 0 0;
#X connect 4 0 3 1;
#X connect 5 0 11 0;
#X connect 5 1 16 0;
#X connect 5 1 18 0;
#X connect 6 0 11 3;
#X connect 9 0 1 0;
#X connect 10 0 15 0;
#X connect 10 1 12 0;
#X connect 12 0 7 0;
#X connect 12 0 13 0;
#X connect 12 1 8 0;
#X connect 12 2 15 1;
#X connect 13 0 14 0;
#X connect 13 1 9 0;
#X connect 13 2 16 1;
#X connect 14 0 15 0;
#X connect 15 0 2 0;
#X connect 16 0 13 2;
#X connect 16 1 1 1;
#X connect 17 0 11 0;
#X connect 17 0 12 1;
#X connect 17 1 12 2;
#X connect 17 1 13 1;
#X connect 18 0 6 0;
#X connect 14 0 2 0;
#X connect 15 0 12 2;
#X connect 15 1 1 1;
#X connect 16 0 10 0;
#X connect 16 0 11 1;
#X connect 16 1 11 2;
#X connect 16 1 12 1;
#X connect 17 0 5 0;
22 changes: 12 additions & 10 deletions examples/twitter-client.pd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#N canvas 508 175 974 536 10;
#X declare -path purest_json -stdlib zexy -stdpath cyclone;
#N canvas 975 249 726 490 authorize 0;
#X msg 24 36 POST /oauth/request_token;
#X obj 24 255 print data1;
Expand Down Expand Up @@ -41,21 +42,21 @@ YOUR_TEMP_TOKEN YOUR_TEMP_SECRET;
#X obj 29 28 inlet;
#X text 118 66 Search;
#X obj 72 226 fifop;
#X obj 42 191 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 42 191 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 103 569 *~ 0;
#X obj 103 511 osc~;
#X obj 103 481 mtof;
#X obj 103 642 dac~;
#X obj 104 605 *~ 0;
#X obj 862 332 vsl 15 128 0 1 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X obj 862 332 vsl 15 128 0 1 0 0 empty empty empty 0 -9 0 10 #fcfcfc
#000000 #000000 0 1;
#X msg 153 466 0;
#X symbolatom 259 326 38 0 0 0 - - -;
#X symbolatom 259 340 80 0 0 0 - - -;
#X symbolatom 259 326 38 0 0 0 - - - 0;
#X symbolatom 259 340 80 0 0 0 - - - 0;
#X obj 209 464 f;
#X obj 72 262 unpack f s s s;
#X symbolatom 539 326 40 0 0 0 - - -;
#X symbolatom 539 326 40 0 0 0 - - - 0;
#X obj 104 539 *~;
#X obj 365 433 osc~;
#N canvas 1432 61 437 398 tweet-text-analysis 0;
Expand Down Expand Up @@ -186,8 +187,9 @@ YOUR_TEMP_TOKEN YOUR_TEMP_SECRET;
#X connect 22 0 18 0;
#X connect 23 0 0 0;
#X restore 375 261 pd sonify-it;
#X obj 712 22 import purest_json zexy cyclone;
#X msg 228 56 init https://api.twitter.com SEJpJksCRpcgyoP4nk73Ng FEHGi9k8jF3zTPrBLbnBonF94gbUGZLrGKMgl4Td5bc
YOUR_AUTH_TOKEN YOUR_AUTH_SECRET;
#X connect 4 0 1 0;
#X connect 4 0 2 0;
#X obj 618 479 declare -path purest_json -stdlib zexy -stdpath cyclone
;
#X connect 3 0 1 0;
#X connect 3 0 2 0;
21 changes: 11 additions & 10 deletions json-help.pd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#N canvas 79 63 1143 647 10;
#X declare -path purest_json;
#X obj 665 417 json-encode;
#X obj 665 486 json-decode;
#X obj 51 7 json-encode;
Expand All @@ -25,7 +26,7 @@ stored one;
#X obj -8 -147 json-encode;
#X msg -8 -101 add newest \$1;
#X obj -74 -274 bng 15 250 50 0 empty empty Click_to_create_a_nested_object
17 7 0 10 -262144 -1 -1;
17 7 0 10 #fcfcfc #000000 #000000;
#X obj -74 -244 t b b b;
#X obj -74 -30 t a a;
#X obj 11 2 print JSON_string;
Expand Down Expand Up @@ -53,18 +54,18 @@ stored one;
#X obj 94 -86 json-decode;
#X msg 218 -232 bang;
#X obj 218 -382 bng 15 250 50 0 empty empty Click_to_create_an_object
17 7 0 10 -262144 -1 -1;
17 7 0 10 #fcfcfc #000000 #000000;
#X obj 218 -352 t b b b b;
#X msg 269 -316 add duration 3000;
#X obj 218 -159 t a a a;
#X obj 387 -57 json-decode;
#X obj 418 87 line;
#X floatatom 418 120 5 0 0 0 - - -;
#X floatatom 418 120 5 0 0 0 - - - 0;
#X msg 418 67 \$1 \, \$2 \$3;
#X obj 418 2 route start end duration;
#X text 399 -78 wrong;
#X obj 157 72 line;
#X floatatom 157 105 5 0 0 0 - - -;
#X floatatom 157 105 5 0 0 0 - - - 0;
#X obj 157 -29 route start end duration;
#X obj 157 -58 list trim;
#X obj 418 -27 list trim;
Expand Down Expand Up @@ -165,7 +166,6 @@ internally.;
file.;
#X obj 347 247 qlist;
#X text 46 245 add \, read and write methods work analog to;
#X obj 49 608 import purest_json;
#X obj 458 584 print decoding_done;
#X obj 617 585 print decoded_data;
#X msg 714 138 add album dss;
Expand All @@ -181,10 +181,11 @@ the object is fully parsed \, the left outlet will issue a bang \,
so that you can differenciate between subsequent objects. The messages
will come as list key value. If the string cannot be decoded as JSON
\, then the right outlet will output a bang.;
#X obj 49 608 declare -path purest_json;
#X connect 0 0 17 0;
#X connect 1 0 36 0;
#X connect 1 1 37 0;
#X connect 1 2 40 0;
#X connect 1 0 35 0;
#X connect 1 1 36 0;
#X connect 1 2 39 0;
#X connect 6 0 0 0;
#X connect 8 0 0 0;
#X connect 10 0 0 0;
Expand All @@ -194,6 +195,6 @@ will come as list key value. If the string cannot be decoded as JSON
#X connect 17 1 21 0;
#X connect 22 0 0 0;
#X connect 23 0 0 0;
#X connect 37 0 0 0;
#X connect 38 0 0 0;
#X connect 39 0 0 0;
#X connect 41 0 1 0;
#X connect 40 0 1 0;
19 changes: 10 additions & 9 deletions urlparams-help.pd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#N canvas 44 51 687 503 10;
#X declare -path purest_json;
#X msg 211 140 add id 1;
#X text 208 107 Will add key id and value of 1 to object;
#X msg 253 170 add name Residuum;
Expand All @@ -8,7 +9,6 @@
#X text 22 335 This will clear the object;
#X text 359 346 output the value;
#X msg 360 365 bang;
#X obj 480 32 import purest_json;
#X obj 47 16 urlparams;
#X obj 229 404 urlparams;
#X text 43 44 [urlparams] has three methods: add \, clear and bang.
Expand All @@ -24,11 +24,12 @@ hashtag #Pd?;
parameters.;
#X text 314 285 adding a different value will overwrite the previously
stored one;
#X connect 0 0 11 0;
#X connect 2 0 11 0;
#X connect 3 0 11 0;
#X connect 4 0 11 0;
#X connect 5 0 11 0;
#X connect 8 0 11 0;
#X connect 11 0 14 0;
#X connect 15 0 11 0;
#X obj 480 32 declare -path purest_json;
#X connect 0 0 10 0;
#X connect 2 0 10 0;
#X connect 3 0 10 0;
#X connect 4 0 10 0;
#X connect 5 0 10 0;
#X connect 8 0 10 0;
#X connect 10 0 13 0;
#X connect 14 0 10 0;

0 comments on commit c505f1b

Please sign in to comment.