#N canvas 455 51 558 590 10;
#X obj 2 346 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 458 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 529 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 86 354 cnv 17 3 74 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 86 465 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 86 436 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 86 486 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 86 507 cnv 17 3 17 empty empty 2 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 2 564 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X text 158 352 -;
#X text 125 352 bang;
#X text 158 370 -;
#X text 119 370 float;
#X text 158 416 -;
#X text 158 398 -;
#X text 125 398 list;
#X text 158 437 -;
#X text 119 437 float;
#X text 158 467 -;
#X text 119 467 float;
#X text 158 487 -;
#X text 119 487 float;
#X text 158 509 -;
#X text 125 509 bang;
#X text 173 437 y value of an x/y pair;
#X obj 291 267 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 173 487 on a "next" message \, the difference with the previous x value, f 61;
#X text 173 509 when the end of the buffer is reached, f 60;
#X text 173 467 the y value of a pair;
#X obj 108 267 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 108 236 cyclone/funbuff;
#C restore;
#X obj 291 191 hradio 15 1 0 3 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X floatatom 291 213 2 0 0 0 - - - 0;
#X text 277 189 x;
#X text 271 266 y;
#X text 180 204 y;
#X text 95 203 x;
#X obj 195 205 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 108 205 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#N canvas 393 166 795 446 examples 0;
#X obj 582 270 bng 15 250 50 0 empty empty empty 0 -6 0 8 #dcdcdc #000000 #000000;
#X msg 481 186 next;
#X msg 470 161 goto 0;
#X obj 517 271 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 453 271 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 451 289 y value;
#X text 515 185 outputs and goes to next;
#X text 603 270 <= reached the end;
#X obj 453 247 cyclone/funbuff;
#X f 22;
#C restore;
#X text 409 45 When using the next message \, the midle outlet outputs the difference from the current 'x' value to the previous one. The right outlet sends a bang when reaching the end of the buffer. The next message needs a pointer position \, this can be set by giving it an 'x' value or by the 'goto' message.;
#X msg 490 216 min;
#X msg 522 216 max;
#X text 548 216 outputs minimum/maximum 'y' value;
#N canvas 712 227 654 315 interpolation 0;
#X msg 158 130 interp 18;
#X obj 132 179 cyclone/funbuff;
#C restore;
#X text 350 80 stored pairs: "10 100" and "30 200";
#X obj 132 80 cyclone/loadmess set 10 100 30 200;
#X text 247 121 The value '18' is compared to 'x' values in funbuff and is found in between the values 10 and 30 If you consider the difference from 30 to 10 (which is 20) to 100% \, the value 18 is 40% over 10 and 60% under 30;
#X obj 132 214 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 247 184 The corresponding 'y' value from 18 is also an interpolated value from the corresponding 'y' values of 10 and 30 \, which are 100 and 200 \, so it should be 140 (40% of the way from 100 to 200). Click and check.;
#X obj 43 42 hsl 128 15 10 30 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 40 72 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 40 105 interp \$1;
#X text 183 43 <= move the slider and check the interpolated values;
#X connect 0 0 1 0;
#X connect 1 0 5 0;
#X connect 3 0 1 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 1 0;
#X restore 643 339 pd interpolation;
#X text 467 340 More examples:;
#N canvas 608 186 758 344 copy/paste 0;
#X msg 86 92 select 3 5;
#X msg 117 132 cut;
#X msg 148 132 copy;
#X msg 186 181 undo;
#X msg 185 132 paste;
#X obj 86 308 cyclone/funbuff;
#C restore;
#X msg 204 239 delete 5;
#X text 262 214 deletes matching pair;
#X text 219 179 or paste operation;
#X text 201 163 undoes the latest cut;
#X text 261 240 deletes the pair where x = 5;
#X msg 30 51 1 2 \, 2 3 \, 3 4 \, 4 5 \, 5 6 \, 6 7 \, 7 8 \, 8 9 \, 9 10 \, 10 11;
#X obj 206 272 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X msg 575 178 paste;
#X obj 575 248 cyclone/funbuff;
#C restore;
#X msg 601 210 undo;
#X text 235 273 print information in Pd window;
#X obj 545 146 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 228 132 clipboard operation;
#X obj 30 27 loadbang;
#X text 163 79 selects 5 elements staring from element 3 - the region from pointer 3 to 3 + 5 (8). Used for clipboard operations: cut \, copy and paste., f 47;
#X msg 193 213 delete 3 4;
#X text 508 93 A cut/copy operation can be pasted onto a different [funbuff] object!, f 34;
#X connect 0 0 5 0;
#X connect 1 0 5 0;
#X connect 2 0 5 0;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 6 0 5 0;
#X connect 11 0 5 0;
#X connect 12 0 5 0;
#X connect 13 0 14 0;
#X connect 15 0 14 0;
#X connect 17 0 14 0;
#X connect 19 0 11 0;
#X connect 21 0 5 0;
#X restore 614 387 pd copy/paste & delete;
#X obj 70 134 cyclone/funbuff;
#C restore;
#X msg 70 79 4;
#X obj 70 165 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 203 93 the last sent message;
#X obj 172 398 print X;
#X obj 227 398 print Y;
#X obj 172 369 cyclone/funbuff;
#X f 19;
#C restore;
#X msg 118 79 4 10 \, 4 4;
#X msg 133 100 4 5 \, 4 40;
#X text 409 15 'goto' \, 'next' & 'min'/'max' messages:;
#X obj 453 135 cyclone/loadmess set 1 1 3 2 5 3 6 2;
#X text 516 289 difference from previous 'x';
#X text 517 160 sets pointer to the first element;
#N canvas 812 273 425 303 find 0;
#X msg 82 90 find 4;
#X msg 117 150 0 4 \, 2 4 \, 1 1 \, 5 3 \, 7 4;
#X obj 117 127 loadbang;
#X obj 82 244 print find;
#X obj 82 185 cyclone/funbuff;
#C restore;
#X obj 82 215 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 132 89 find 'x' that correspond to '4';
#X text 40 28 The 'find' message looks for 'x' values that correspond to the given 'y'.;
#X connect 0 0 4 0;
#X connect 1 0 4 0;
#X connect 2 0 1 0;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X restore 570 340 pd find;
#X msg 172 311 set 1 2 3 4 5 6 7 8;
#X msg 192 339 dump;
#X msg 122 329 clear;
#X text 28 203 'set' \, 'clear' and 'dump' messages:;
#N canvas 378 115 809 371 read/write 0;
#X msg 544 160 write;
#X msg 502 160 read;
#X msg 587 161 write funbuff.txt;
#X msg 597 187 read funbuff.txt;
#X msg 181 149 embed \$1;
#X obj 181 125 tgl 15 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 181 290 pack;
#X obj 181 261 cyclone/funbuff;
#C embed 1;
#C set 13 22 26 12 35 53;
#C restore;
#X msg 211 181 dump;
#X text 33 27 You can save the stored values of a [funbuff] into the patch with the 'embed' message. If you send it 'embed 1' \, when you save the patch \, it also save the currently stored values into [funbuff]. If you send it 'embed 0' and save the patch \, it won't save the contents and also clear if it had its contents saved.;
#X msg 227 219 set 13 22 35 53 26 12;
#X obj 181 318 print pairs:;
#X msg 614 219 set 13 22 35 53 26 12;
#X msg 470 127 dump;
#X obj 522 323 print pairs:;
#X text 425 27 You can also save (with the 'write' message) and load (with the 'read' message) from files. The argument sets a file name to load and read from at startup. The 'read' and 'write' messages without a filename symbol opens a dialog box to open/save files.;
#X obj 522 258 cyclone/funbuff funbuff.txt;
#C restore;
#X obj 522 295 pack;
#X connect 0 0 16 0;
#X connect 1 0 16 0;
#X connect 2 0 16 0;
#X connect 3 0 16 0;
#X connect 4 0 7 0;
#X connect 5 0 4 0;
#X connect 6 0 11 0;
#X connect 7 0 6 0;
#X connect 7 1 6 1;
#X connect 8 0 7 0;
#X connect 10 0 7 0;
#X connect 12 0 16 0;
#X connect 13 0 16 0;
#X connect 16 0 17 0;
#X connect 16 1 17 1;
#X connect 17 0 14 0;
#X restore 468 381 pd read/write files \; save contents (embed);
#X text 22 15 There can only be one 'x' value and a corresponding 'y'value. So you can rewrite a 'y' value by sending another pair message.;
#X text 185 79 the value of 'y' is from;
#X text 29 233 The set message can add several pairs at once. The clear message erases all set pairs from the memory. The dump message dumps all pairs to the middle (y value) and left (x value) outlets;
#X floatatom 283 342 5 0 0 0 - - - 0;
#X connect 1 0 8 0;
#X connect 2 0 8 0;
#X connect 8 0 4 0;
#X connect 8 1 3 0;
#X connect 8 2 0 0;
#X connect 10 0 8 0;
#X connect 11 0 8 0;
#X connect 16 0 18 0;
#X connect 17 0 16 0;
#X connect 22 0 20 0;
#X connect 22 1 21 0;
#X connect 23 0 16 0;
#X connect 24 0 16 0;
#X connect 26 0 8 0;
#X connect 30 0 22 0;
#X connect 31 0 22 0;
#X connect 32 0 22 0;
#X connect 38 0 22 1;
#X restore 472 265 pd examples;
#X text 101 416 messages;
#X text 87 144 If there's no matching 'x' \, [funbuff] uses the closest smaller 'x' and outputs its corresponding 'y' value., f 60;
#X text 94 265 y;
#X text 433 212 sets x/y pairs;
#X text 172 398 two elements stores a x/y number pair in the buffer;
#X text 173 352 prints object's information in the Pd main window, f 60;
#X obj 265 213 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 173 416 see complete list of messages:;
#X msg 51 203 clear;
#X text 85 85 [funbuff] stores \, manages and recalls x/y pairs of integers.;
#N canvas 748 172 536 397 All_Messages 0;
#X text 120 317 prints status information in Pd main window, f 68;
#X text 120 115 undoes the latest cut or paste operation, f 68;
#X text 67 22 clear -;
#X text 73 66 copy -;
#X text 79 82 cut -;
#X text 73 161 dump -;
#X text 79 285 min -;
#X text 79 301 max -;
#X text 73 209 next -;
#X text 67 98 paste -;
#X text 67 317 print -;
#X text 19 333 read <symbol> -;
#X text 73 115 undo -;
#X text 25 193 goto <float> -;
#X text 19 177 embed <float> -;
#X text 25 226 find <float> -;
#X text 13 242 interp <float> -;
#X text 37 6 set <list> -;
#X text 13 361 write <symbol> -;
#X text 120 132 if one float is given \, deletes a pair for a matching 'x' value \, if two floats are given \, deletes a matching x/y pair, f 68;
#X text 19 132 delete <f \, f> -;
#X text 19 38 select <f \, f> -;
#X text 120 66 copies the selected x/y pair to the clipboard, f 68;
#X text 120 82 copies the selected x/y pair to the clipboard and deletes it, f 68;
#X text 120 98 adds the cut or copied x/y pairs, f 68;
#X text 120 177 non-0 value saves the contents of the buffer when the patch is saved, f 68;
#X text 120 161 dumps all pairs to the middle (y value) and left (x value) outlets, f 68;
#X text 120 193 sets the buffer pointer to the specified <float> buffer element, f 68;
#X text 120 242 if a given 'x' doesn't exist \, interpolates the 'y' value from 2 neighbouring x/y pair, f 68;
#X text 1 269 interptab <f \, s> -;
#X text 120 285 sends the lowest 'y' value in the buffer to the left outlet, f 68;
#X text 120 302 sends the highest 'y' value in the buffer to the left outlet, f 68;
#X text 120 333 reads buffer contents from the file name specified by the symbol. If no symbol is given \, a file open box is shown, f 68;
#X text 120 360 writes buffer contents to the file name specified by the symbol. If no symbol is given \, a file open box is shown, f 68;
#X text 120 5 sets x/y pairs in the buffer (more than one pair is allowed), f 68;
#X text 120 22 erases all pairs from the buffer, f 68;
#X text 120 209 outputs the y value of the buffer element and goes to next pointer, f 68;
#X text 120 226 finds the 'x' values which have a 'y' that matches the given number, f 68;
#X text 120 270 same as interp \, but uses the table specified by the symbol <s>, f 68;
#X text 120 38 selects a number of x/y pairs (specified by the 2nd float) starting from an index (specified by the 1st float) - for copy/cut/paste, f 68;
#X restore 359 417 pd All_Messages;
#X text 158 539 1) symbol - sets a file name to load in the buffer;
#X msg 346 212 0 1 \, 1 2 \, 2 3;
#X obj 346 190 loadbang;
#X text 86 101 If a 'y' value is sent to the right inlet \, the next input to the left inlet sets the value of 'x' and the pair is stored \, otherwise an 'x' input does output its corresponding 'y'.;
#X text 173 370 x value of a x/y pair - saves the x/y pair if a y value was sent before to the right inlet \, outputs a y value otherwise, f 60;
#X obj 291 239 cyclone/funbuff;
#C restore;
#X obj 3 2 ./header funbuff;
#X text 24 62 Stores pairs of integers;
#X text 131 312 see also:;
#X obj 199 313 cyclone/coll;
#C restore;
#X obj 309 313 cyclone/table;
#C restore;
#X connect 30 0 29 0;
#X connect 31 0 32 0;
#X connect 32 0 56 0;
#X connect 37 0 30 1;
#X connect 38 0 30 0;
#X connect 46 0 56 0;
#X connect 48 0 30 0;
#X connect 52 0 56 0;
#X connect 53 0 52 0;
#X connect 56 0 25 0;
