From a86d36109abcdf80b6cb69d81ec07b14fecc5e1e Mon Sep 17 00:00:00 2001 From: "N.N." Date: Thu, 8 Nov 2012 09:39:23 +0000 Subject: share_mem : updating examples svn path=/trunk/externals/share_mem/; revision=16529 --- examples/4.table_fifo.pd | 60 ++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 22 deletions(-) (limited to 'examples/4.table_fifo.pd') diff --git a/examples/4.table_fifo.pd b/examples/4.table_fifo.pd index 5298a14..edf331b 100644 --- a/examples/4.table_fifo.pd +++ b/examples/4.table_fifo.pd @@ -1,9 +1,9 @@ -#N canvas 229 287 614 675 10; +#N canvas 105 79 843 675 10; #X declare -path ..; #N canvas 0 22 450 300 (subpatch) 0; #X array data 100 float 2; -#X coords 0 1 99 -1 200 140 1 0 0; -#X restore 372 333 graph; +#X coords 0 1 99 -1 200 140 1; +#X restore 304 227 graph; #X text 30 23 Basic sharing of memory data between two pd instances ; #X msg 44 306 pd~ stop; @@ -11,16 +11,11 @@ #X msg 512 41 \; pd dsp 1; #X text 29 260 launch subprocess; #X obj 39 52 declare -path ..; -#X obj 54 473 t f f; -#X obj 81 498 ==; -#X obj 81 518 sel 1; -#X obj 81 540 print erreur de syncro; -#X obj 27 453 sel 0; -#X text 30 81 in order to share quicklly updated table \, in a syncronised -way \, we need a data fifo; -#X text 30 113 only the index of the wrinting position is passed throw -stdout of the pd~ \, in order to keep data syncronisation; -#X text 134 509 thanks to the fifo \, there are no more syncronisation +#X obj 212 499 t f f; +#X obj 239 524 ==; +#X obj 239 544 sel 1; +#X obj 185 479 sel 0; +#X text 315 383 thanks to the fifo \, there are no more syncronisation problem; #X text 30 165 Round trip fifo is set to 50 blocs (72ms at 44.1KHz) ; @@ -28,21 +23,42 @@ problem; = 25 bang; #X text 28 208 So \, lets use a memory size of 2500; #X obj 27 434 shmem 1004 2500; -#X msg 27 413 memdump \$1 data; #X msg 27 279 pd~ start 4.table_fifo-subprocess.pd; #X obj 27 374 route syncro; #X obj 27 394 * 100; #X obj 27 353 pd~ -ninsig 0 -noutsig 0 -fifo 50; -#X connect 2 0 23 0; +#X obj 27 468 t f b; +#X obj 102 517 f; +#X obj 102 540 + 1; +#X obj 102 561 % 100; +#X msg 27 414 memdump \$1 data \, memread \$1; +#N canvas 0 22 450 300 (subpatch) 0; +#X array data_history 100 float 2; +#X coords 0 1 99 -1 200 140 1; +#X restore 514 226 graph; +#X obj 27 582 tabwrite data_history; +#X obj 239 566 print synchro_error; +#X text 29 70 In order to quickly share an updated table in a synchronised +way \, we need a data fifo.; +#X text 29 103 Only the index of the written position is passed through +stdout of the pd~ \, in order to keep data syncronisation; +#X connect 2 0 19 0; #X connect 3 0 4 0; #X connect 7 0 8 1; #X connect 7 1 8 0; #X connect 8 0 9 0; -#X connect 9 0 10 0; -#X connect 11 1 7 0; -#X connect 18 0 11 0; -#X connect 19 0 18 0; -#X connect 20 0 23 0; +#X connect 9 0 27 0; +#X connect 10 1 7 0; +#X connect 15 0 10 0; +#X connect 15 0 20 0; +#X connect 16 0 19 0; +#X connect 17 0 18 0; +#X connect 18 0 24 0; +#X connect 19 0 17 0; +#X connect 20 0 26 0; +#X connect 20 1 21 0; #X connect 21 0 22 0; -#X connect 22 0 19 0; -#X connect 23 0 21 0; +#X connect 22 0 23 0; +#X connect 23 0 21 1; +#X connect 23 0 26 1; +#X connect 24 0 15 0; -- cgit v1.2.1