From 82b9227757129b179c0e96f0ebe2c4a4acb0c260 Mon Sep 17 00:00:00 2001 From: porres Date: Tue, 11 Jun 2024 13:12:51 -0300 Subject: [PATCH] buffer --- cyclone_objects/abstractions/buffer~.pd | 275 +++++++++++------------ documentation/help_files/buffer~-help.pd | 14 +- 2 files changed, 142 insertions(+), 147 deletions(-) diff --git a/cyclone_objects/abstractions/buffer~.pd b/cyclone_objects/abstractions/buffer~.pd index a4e2d346..8d09674b 100644 --- a/cyclone_objects/abstractions/buffer~.pd +++ b/cyclone_objects/abstractions/buffer~.pd @@ -1,5 +1,4 @@ -#N canvas 319 281 814 272 10; -#X declare -path /Users/porres/Documents/Pd/externals/cyclone; +#N canvas 321 155 813 307 10; #X obj 24 24 inlet; #N canvas 172 51 533 410 rename 0; #X obj 319 189 r \$0-name; @@ -36,17 +35,7 @@ #X connect 14 0 16 0; #X connect 15 0 14 0; #X restore 64 100 pd rename; -#N canvas 206 153 479 442 \$0-buffers 1; -#X obj 6 20 cnv 15 448 80 empty empty empty 3 10 2 14 #e0e0e0 #404040 0; -#N canvas 0 22 450 300 ch0_1110 0; -#X array 0-buff1_1003 87741 float 2; -#X coords 0 1 87741 -1 450 82 2 0 0; -#X restore 5 19 pd ch0_1110; -#X obj 6 120 cnv 15 448 80 empty empty empty 3 10 2 14 #e0e0e0 #404040 0; -#N canvas 0 22 450 300 ch1_1110 0; -#X array 1-buff1_1003 87741 float 2; -#X coords 0 1 87741 -1 450 82 2 0 0; -#X restore 5 119 pd ch1_1110; +#N canvas 206 153 479 442 \$0-buffers 0; #X coords 0 0 0 0 10 20 0; #X restore 627 59 pd \$0-buffers; #N canvas 386 286 457 330 clear 0; @@ -361,7 +350,7 @@ #X connect 19 2 9 0; #X connect 19 3 20 0; #X restore 228 124 pd fill; -#N canvas 0 22 450 300 vis 0; +#N canvas 727 241 450 300 vis 0; #X msg 241 123 vis \$1; #X msg 241 96 1; #X msg 273 96 0; @@ -1226,21 +1215,22 @@ #X connect 26 0 23 0; #X connect 26 1 20 0; #X restore 514 101 pd crop; -#N canvas 602 260 489 406 soundfiler 0; -#X obj 192 102 list prepend; -#X obj 192 129 list; -#X obj 65 104 list append; -#X obj 65 164 list trim; -#X obj 166 198 r \$0-resize; -#X obj 65 198 soundfiler; -#X msg 166 230 1; -#X obj 65 233 spigot; -#X obj 65 266 s \$0-size; -#X obj 192 43 inlet; -#X obj 65 42 inlet; -#X msg 192 74 \$1-\$2; -#X obj 148 43 inlet; -#X msg 148 71 \$2; +#N canvas 602 260 386 366 soundfiler 0; +#X obj 162 112 list prepend; +#X obj 162 139 list; +#X obj 65 174 list append; +#X obj 65 214 list trim; +#X obj 166 248 r \$0-resize; +#X obj 65 248 soundfiler; +#X msg 166 280 1; +#X obj 65 283 spigot; +#X obj 65 316 s \$0-size; +#X obj 162 32 inlet; +#X obj 65 32 inlet; +#X msg 162 82 \$1-\$2; +#X obj 118 32 inlet; +#X msg 118 82 \$2; +#X obj 219 185 r \$0-reset-buf-names; #X connect 0 0 1 0; #X connect 1 0 0 1; #X connect 1 0 2 1; @@ -1255,18 +1245,21 @@ #X connect 11 0 0 0; #X connect 12 0 13 0; #X connect 13 0 1 0; -#X restore 581 142 pd soundfiler; -#N canvas 836 309 267 305 load-args 0; -#N canvas 148 313 507 387 channels 0; -#X obj 123 180 v ch_\$0; -#X obj 210 223 r \$0-name; -#X obj 239 251 r \$0-size; -#X obj 95 220 cyclone/uzi 1 0; -#X obj 182 293 pack f s f; -#X obj 182 336 outlet; -#X obj 68 184 sel 1; -#X obj 68 280 pack f s f; -#X obj 68 336 outlet; +#X connect 14 0 0 1; +#X connect 14 0 2 1; +#X connect 14 0 1 1; +#X restore 581 172 pd soundfiler; +#N canvas 836 309 401 335 load-args 0; +#N canvas 269 140 533 499 channels 0; +#X obj 123 260 v ch_\$0; +#X obj 210 303 r \$0-name; +#X obj 239 331 r \$0-size; +#X obj 95 300 cyclone/uzi 1 0; +#X obj 182 373 pack f s f; +#X obj 182 416 outlet; +#X obj 68 264 sel 1; +#X obj 68 360 pack f s f; +#X obj 68 416 outlet; #X obj 123 27 inlet; #X obj 168 27 inlet; #X obj 291 26 inlet; @@ -1322,6 +1315,12 @@ #X obj 291 88 trigger float float; #X obj 291 139 select 1 0; #X obj 374 173 float; +#X obj 123 187 change; +#X obj 65 25 inlet; +#X obj 341 345 send pd-\$0-buffers; +#X msg 341 316 clear; +#X obj 123 223 t f b; +#X obj 341 282 s \$0-reset-buf-names; #X connect 1 0 4 1; #X connect 1 0 7 1; #X connect 2 0 4 2; @@ -1337,8 +1336,7 @@ #X connect 12 0 18 0; #X connect 13 0 14 0; #X connect 14 0 15 0; -#X connect 15 0 0 0; -#X connect 15 0 6 0; +#X connect 15 0 21 0; #X connect 16 0 19 0; #X connect 17 0 14 0; #X connect 18 0 16 0; @@ -1346,7 +1344,14 @@ #X connect 19 0 17 0; #X connect 19 1 20 0; #X connect 20 0 14 0; -#X restore 72 196 pd channels; +#X connect 21 0 25 0; +#X connect 22 0 14 0; +#X connect 24 0 23 0; +#X connect 25 0 0 0; +#X connect 25 0 6 0; +#X connect 25 1 24 0; +#X connect 25 1 26 0; +#X restore 72 216 pd channels; #N canvas 454 149 739 500 2nd_arg 0; #X obj 209 187 t b f; #X obj 462 358 s \$0-size; @@ -1423,7 +1428,7 @@ #X connect 33 0 34 0; #X connect 35 0 33 0; #X connect 36 0 35 0; -#X restore 75 109 pd 2nd_arg; +#X restore 75 129 pd 2nd_arg; #N canvas 544 110 822 542 3rd_arg_(size) 0; #X obj 363 291 t b f; #X obj 546 432 s \$0-size; @@ -1482,9 +1487,9 @@ #X connect 25 0 26 0; #X connect 25 1 0 0; #X connect 26 0 0 0; -#X restore 132 137 pd 3rd_arg_(size); -#X obj 72 238 outlet; -#X obj 135 237 outlet; +#X restore 132 157 pd 3rd_arg_(size); +#X obj 72 258 outlet; +#X obj 135 257 outlet; #N canvas 469 182 463 361 buffer_arg 0; #X obj 35 85 list append \$1; #X obj 80 241 print Warning:; @@ -1509,50 +1514,41 @@ #X connect 9 1 2 0; #X connect 9 2 6 0; #X connect 10 0 0 0; -#X restore 75 69 pd buffer_arg; +#X restore 75 101 pd buffer_arg; #N canvas 577 23 425 361 init 0; #X obj 40 28 loadbang; -#X obj 138 100 samplerate~; -#X obj 138 129 s \$0-sr; -#X obj 232 139 send pd-\$0-buffers; -#X msg 232 91 clear; +#X obj 92 203 samplerate~; +#X obj 92 232 s \$0-sr; #X obj 40 307 outlet; #X text 276 83 just in case the abstraction gets corrupted, f 17; -#X obj 104 198 pdcontrol; -#N canvas 241 23 474 169 \$0-declare 0; -#X obj 50 50 declare -path /Users/porres/Documents/Pd/externals/cyclone; -#X restore 243 178 pd \$0-declare; -#X obj 104 251 send pd-\$0-declare; -#X msg 104 224 clear \, obj 50 50 declare -path \$1; #X obj 40 59 trigger bang bang; -#X msg 104 169 dir 1; -#X connect 0 0 11 0; +#X obj 266 180 send pd-\$0-buffers; +#X msg 266 132 clear; +#X connect 0 0 5 0; #X connect 1 0 2 0; -#X connect 4 0 3 0; -#X connect 7 0 10 0; -#X connect 10 0 9 0; -#X connect 11 0 5 0; -#X connect 11 1 1 0; -#X connect 11 1 12 0; -#X connect 11 1 4 0; -#X connect 12 0 7 0; -#X restore 75 41 pd init; +#X connect 5 0 3 0; +#X connect 5 1 1 0; +#X connect 5 1 7 0; +#X connect 7 0 6 0; +#X restore 75 70 pd init; +#X obj 42 12 inlet; #X connect 0 0 3 0; #X connect 0 1 4 0; -#X connect 1 0 0 0; -#X connect 1 1 0 1; +#X connect 1 0 0 1; +#X connect 1 1 0 2; #X connect 1 2 2 0; -#X connect 2 0 0 0; -#X connect 2 1 0 2; +#X connect 2 0 0 1; +#X connect 2 1 0 3; #X connect 5 0 1 0; #X connect 6 0 5 0; -#X restore 675 101 pd load-args; +#X connect 7 0 0 0; +#X restore 675 131 pd load-args; #N canvas 274 23 884 660 read/write 0; #X obj 121 206 symbol; #X obj 36 85 route bang; #X obj 36 126 openpanel; #X obj 319 248 cyclone/fromsymbol @separator ., f 18; -#X obj 145 147 r \$0-file; +#X obj 142 147 r \$0-file; #X obj 232 204 list; #X obj 258 337 t l l, f 6; #X msg 291 371 \$2; @@ -1566,7 +1562,7 @@ #X obj 199 313 sel 0 1; #X obj 221 344 list; #X obj 207 108 savepanel; -#X obj 121 608 outlet; +#X obj 95 608 outlet; #X obj 36 23 inlet; #X msg 319 310 \$2; #X obj 319 282 list; @@ -1650,53 +1646,50 @@ #X connect 6 0 5 0; #X connect 6 1 0 0; #X restore 353 330 pd size; -#N canvas 93 74 401 299 ch 0; -#X obj 100 157 cyclone/pak -skip 0; -#X obj 106 111 cyclone/mstosamps~; -#X obj 106 87 max 0; -#X obj 211 135 expr rint($f1); -#X obj 91 133 r \$0-read; -#X obj 91 200 outlet; +#N canvas 93 74 384 299 ch 0; #X obj 106 53 inlet; -#X obj 178 207 r \$0-resize; -#X msg 178 233 read -resize -maxsize 1e+18; -#X connect 0 0 5 0; -#X connect 1 1 3 0; +#X obj 158 141 v ch_\$0; +#X obj 158 98 r \$0-read; +#X obj 125 198 outlet; +#X connect 0 0 3 0; +#X connect 1 0 3 0; #X connect 2 0 1 0; -#X connect 3 0 0 1; -#X connect 4 0 5 0; -#X connect 6 0 2 0; -#X connect 7 0 8 0; #X restore 424 329 pd ch; -#X obj 101 390 trigger symbol bang; #X obj 101 554 outlet; #X obj 332 554 outlet; #X obj 158 364 print Warning; #X msg 158 328 [buffer~]\$1 file not found, f 15; #X obj 101 210 t l b; #X obj 145 211 s \$0-read; -#X connect 0 0 12 0; -#X connect 0 1 16 0; +#X obj 101 390 trigger symbol bang bang, f 28; +#X obj 409 442 f; +#X obj 409 554 outlet; +#X connect 0 0 18 0; +#X connect 0 1 15 0; #X connect 1 0 0 0; #X connect 2 0 4 0; #X connect 3 0 1 0; #X connect 3 1 9 0; -#X connect 4 0 17 0; +#X connect 4 0 16 0; #X connect 5 0 7 0; #X connect 6 0 5 0; -#X connect 7 0 14 0; +#X connect 7 0 13 0; #X connect 8 0 5 1; #X connect 9 0 8 0; #X connect 9 1 10 0; #X connect 9 2 11 0; #X connect 10 0 7 1; -#X connect 12 0 13 0; -#X connect 12 1 6 0; -#X connect 16 0 15 0; -#X connect 17 0 3 0; -#X connect 17 1 18 0; -#X restore 145 177 pd check; -#X obj 121 255 list prepend; +#X connect 11 0 19 1; +#X connect 15 0 14 0; +#X connect 16 0 3 0; +#X connect 16 1 17 0; +#X connect 18 0 12 0; +#X connect 18 1 6 0; +#X connect 18 2 19 0; +#X connect 19 0 20 0; +#X restore 142 177 pd check; +#X obj 95 255 list prepend; +#X obj 187 610 outlet; #X connect 0 0 3 0; #X connect 0 0 42 0; #X connect 1 0 2 0; @@ -1761,47 +1754,48 @@ #X connect 40 0 36 5; #X connect 41 0 0 0; #X connect 41 1 42 1; +#X connect 41 2 43 0; #X connect 42 0 18 0; #X restore 581 101 pd read/write; -#N canvas 147 315 743 423 init-buffers 0; -#X obj 340 246 send pd-\$0-buffers; -#X msg 340 85 \$1; -#X obj 313 61 t l l; -#X obj 313 31 inlet; -#X obj 438 123 - 1; -#X obj 389 98 + 20; -#X obj 389 120 t f f; -#X obj 389 75 * 100; -#X obj 340 149 pack float float float \$0; -#X obj 235 215 list append \$0; -#X obj 340 107 t f f; -#X msg 340 178 obj 6 \$2 cnv 15 448 80 empty empty empty 3 10 2 14 -233017 -66577 0 \, obj 5 \$3 pd ch\$1_\$4; -#X msg 276 276 \; pd-ch\$1_\$4 array \$1-\$2 \$3 float 2 \, coords 0 1 \$3 -1 450 82 2 0 0 \, vis 0; -#X obj 152 33 inlet; -#X obj 74 268 list append \$0; -#X obj 153 74 t l l; -#X msg 115 329 \; pd-ch\$1_\$4 array \$2 \$3 float 2 \, coords 0 1 \$3 -1 450 82 2 0 0 \, vis 0; -#X connect 1 0 10 0; -#X connect 2 0 9 0; -#X connect 2 1 1 0; -#X connect 3 0 2 0; -#X connect 4 0 8 2; -#X connect 5 0 6 0; -#X connect 6 0 8 1; -#X connect 6 1 4 0; -#X connect 7 0 5 0; +#N canvas 470 100 737 464 init-buffers 0; +#X obj 340 296 send pd-\$0-buffers; +#X msg 340 135 \$1; +#X obj 235 33 inlet; +#X obj 438 173 - 1; +#X obj 389 148 + 20; +#X obj 389 170 t f f; +#X obj 389 125 * 100; +#X obj 340 199 pack float float float \$0; +#X obj 235 282 list append \$0; +#X obj 340 157 t f f; +#X msg 340 228 obj 6 \$2 cnv 15 448 80 empty empty empty 3 10 2 14 -233017 -66577 0 \, obj 5 \$3 pd ch\$1_\$4; +#X msg 276 326 \; pd-ch\$1_\$4 array \$1-\$2 \$3 float 2 \, coords 0 1 \$3 -1 450 82 2 0 0 \, vis 0; +#X obj 74 33 inlet; +#X obj 74 318 list append \$0; +#X msg 115 379 \; pd-ch\$1_\$4 array \$2 \$3 float 2 \, coords 0 1 \$3 -1 450 82 2 0 0 \, vis 0; +#X obj 235 74 t l l; +#X obj 74 74 t l l; +#X connect 1 0 9 0; +#X connect 2 0 15 0; +#X connect 3 0 7 2; +#X connect 4 0 5 0; +#X connect 5 0 7 1; +#X connect 5 1 3 0; +#X connect 6 0 4 0; +#X connect 7 0 10 0; #X connect 8 0 11 0; -#X connect 9 0 12 0; -#X connect 10 0 8 0; -#X connect 10 1 7 0; +#X connect 9 0 7 0; +#X connect 9 1 6 0; +#X connect 10 0 0 0; #X connect 11 0 0 0; -#X connect 12 0 0 0; -#X connect 13 0 15 0; -#X connect 14 0 16 0; -#X connect 15 0 14 0; +#X connect 12 0 16 0; +#X connect 13 0 14 0; +#X connect 14 0 0 0; +#X connect 15 0 8 0; #X connect 15 1 1 0; -#X connect 16 0 0 0; -#X restore 675 142 pd init-buffers; +#X connect 16 0 13 0; +#X connect 16 1 1 0; +#X restore 675 172 pd init-buffers; #X obj 24 69 route clear name set open wclose fill apply setsize size sizeinsamps samps normalize crop, f 89; #X text 319 185 porres \, barber \, 2017-2024 \; for cyclone; #X connect 0 0 14 0; @@ -1810,6 +1804,7 @@ #X connect 11 1 10 2; #X connect 11 1 13 1; #X connect 12 0 10 0; +#X connect 12 1 11 0; #X connect 14 0 3 0; #X connect 14 1 1 0; #X connect 14 2 1 0; diff --git a/documentation/help_files/buffer~-help.pd b/documentation/help_files/buffer~-help.pd index 3d847fc9..2d42d0f9 100644 --- a/documentation/help_files/buffer~-help.pd +++ b/documentation/help_files/buffer~-help.pd @@ -145,8 +145,8 @@ #X text 139 331 - sets buffer size in samples (you can also use 'samps'*), f 59; #X text 148 363 * as these are attributes names; #X text 58 40 read ; -#X text 139 40 -, f 1; -#X text 151 39 needs a symbol file name to load and optional args (just 'read' opens dialog box) \, 1st is start in ms \, 2nd is duration in ms and 3rd number of channels, f 57; +#X text 139 40 -; +#X text 151 39 needs a symbol file name to load and optional args (just 'read' opens dialog box) \, 1st arg is start in ms \, 2nd is duration in ms and 3rd is number of channels, f 57; #X restore 374 290 pd All_Messages; #X text 124 291 click to open and check all messages: =>; #X text 175 352 - buffer name, f 60; @@ -157,12 +157,12 @@ #X text 25 58 Audio buffer; #X obj 431 166 declare -stdpath ./; #X obj 2 2 header buffer~; -#X obj 109 234 cyclone/buffer~ buff1_\$0 stereo.aif, f 19; #X text 62 89 [buffer~] stores audio in a memory buffer (an array). It read/writes multichannel audio files and can be used in conjunction with [play~] and other related objects. This is an abstraction without the full functionalitites or compatibility to the MAX original., f 68; +#X obj 109 234 cyclone/buffer~ buff1_\$0 stereo.aif, f 19; #X connect 13 0 26 0; -#X connect 14 0 32 0; -#X connect 19 0 32 0; -#X connect 20 0 32 0; -#X connect 21 0 32 0; +#X connect 14 0 33 0; +#X connect 19 0 33 0; +#X connect 20 0 33 0; +#X connect 21 0 33 0; #X connect 26 0 28 0; #X connect 26 1 28 1;