[Gridflow-cvs] [svn] commit: r6590 - in /trunk: doc/flow_classes/#to~-help.pd src/classes3.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Wed Feb 9 13:31:44 EST 2011


Author: matju
Date: Wed Feb  9 13:31:43 2011
New Revision: 6590

Log:
[#to~]: report "buffer full" at most once per incoming grid.

Modified:
    trunk/doc/flow_classes/#to~-help.pd
    trunk/src/classes3.cxx

Modified: trunk/doc/flow_classes/#to~-help.pd
==============================================================================
--- trunk/doc/flow_classes/#to~-help.pd (original)
+++ trunk/doc/flow_classes/#to~-help.pd Wed Feb  9 13:31:43 2011
@@ -36,7 +36,7 @@
 #X obj 53 40 loadbang;
 #X floatatom 3 105 8 0 0 0 - - -;
 #X obj 26 160 s \$0-a;
-#X obj 26 124 tgl 15 0 empty empty empty 17 7 0 10 -204786 -1 -1 0
+#X obj 26 124 tgl 15 0 empty empty empty 17 7 0 10 -204786 -1 -1 1
 1;
 #X obj 160 47 t b b;
 #X obj 204 47 random 128;
@@ -50,7 +50,6 @@
 of size (16384 2) that is turned into two signals.;
 #X obj 220 292 lop~ 2000;
 #X obj 160 292 lop~ 500;
-#X obj 160 147 # >> (3 6);
 #X obj 3 374 doc_c 2;
 #X obj 14 426 doc_cc 1;
 #X obj 97 426 doc_m c1 float;
@@ -62,14 +61,15 @@
 #X text 232 426 number of samples (per channel) to keep in advance.
 this has to be a power of two.;
 #X obj 139 769 #from~;
-#X obj 160 258 #to~ 2;
 #X text 232 535 default is 16384 (thus it takes 64k per channel. note
 that GridFlow's own buffers don't take double the RAM when in 64-bit
 mode \, unlike [table]);
+#X obj 160 147 # >> (3 6);
+#X obj 160 258 #to~ 2;
 #X connect 3 0 2 0;
 #X connect 4 0 3 0;
 #X connect 5 1 23 0;
-#X connect 5 1 50 0;
+#X connect 5 1 49 0;
 #X connect 6 0 39 0;
 #X connect 7 0 33 0;
 #X connect 8 0 10 0;
@@ -93,14 +93,14 @@
 #X connect 35 0 24 0;
 #X connect 36 0 24 1;
 #X connect 37 0 6 0;
-#X connect 38 0 44 0;
-#X connect 39 0 51 0;
+#X connect 38 0 51 0;
+#X connect 39 0 52 0;
 #X connect 40 0 37 0;
 #X connect 42 0 36 0;
 #X connect 43 0 35 0;
-#X connect 44 0 40 0;
-#X connect 47 1 49 0;
-#X connect 47 1 48 0;
-#X connect 47 1 52 0;
-#X connect 51 0 43 0;
-#X connect 51 1 42 0;
+#X connect 46 1 48 0;
+#X connect 46 1 47 0;
+#X connect 46 1 50 0;
+#X connect 51 0 40 0;
+#X connect 52 0 43 0;
+#X connect 52 1 42 0;

Modified: trunk/src/classes3.cxx
==============================================================================
--- trunk/src/classes3.cxx (original)
+++ trunk/src/classes3.cxx Wed Feb  9 13:31:43 2011
@@ -74,16 +74,14 @@
 GRID_INLET(0) {
 	if (in.dim.n!=2) RAISE("expecting two dimensions: signal samples, signal channels");
 	if (in.dim[1]!=chans) RAISE("grid has %d channels, but this object has %d outlets",in.dim[1],chans);
-} GRID_FLOW {
-	if (size==capacity) return;
+	long samples = in.dim.prod()/chans;
+	if (samples+size>capacity) post("[#to~] buffer full: dropping %ld samples.",samples+size-capacity);
+} GRID_FLOW {
 	while (n && size<capacity) {
 		int i = ((start+size)&(capacity-1)) * chans;
 		COPY((T *)*blah+i,data,chans);
 		data+=chans; n-=chans; size++;
 	}
-	if (n>0) post("[#to~] buffer full: dropped %ld samples. will not report further till it's not full anymore.",long(n/chans));
-} GRID_FINISH {
-	//post("[#to~] buffer size : %d out of %d",size,capacity);
 } GRID_END
 \end class {
 	install("#to~",1,0); // actually it has outlets that are not registered with GF



More information about the Gridflow-cvs mailing list