buffer in abstraction

Feb 12, 2010 at 1:51pm

buffer in abstraction

I made an abstraction which contains both a buffer and a waveform. I set the buffername through an input (set name)

Im having some crashing-problems when I have a waveform in the working patch with the same name as the buffer/waveform in the abstraction. The crash happens when I open the abstraction from the patch

I dont have very much memory (256). Is this the problem or is it a problem with having buffer/waveform with identical names in both abstraction and patch at the same time

(using max 4.5)

#48439
Feb 14, 2010 at 6:34pm

Don’t use the same name, this is likely the cause. Use an argument in the abstraction like #1_buffer_name instead, or just give it a number like

sprintf set 1_buffer_name

where buffer_name is the name in the main patch.

#174203
Feb 16, 2010 at 9:49am

I almost get it
Shouldnt it be the exact name if you want thew content of the buffers to be identical?
The prosessing of the buffer is done in the abstraction and then I fetch the content in the main patch. Is this possible?

max v2;
#N vpatcher 167 44 1263 820;
#P origin -104 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 4;
#P comment 482 371 119 196617 If the recording is same or longer than the buffer the last n seconds are selected;
#P window linecount 5;
#P comment 355 371 119 196617 If the recording is shorter than the buffer the first part of the buffer is chosen , and silence removed;
#P window linecount 2;
#P comment 739 183 139 196617 Remove silence if recording is shorter than bufer length;
#P window linecount 3;
#P comment 854 523 175 196617 Output 1 and 2 is in case you want to monitor the buffer activity from a wave~ object;
#P window linecount 1;
#P comment 672 721 175 196617 Input 4: Buffer name;
#P window linecount 2;
#P comment 671 687 175 196617 Input 3: Buffer length. Seconds not milliseconds;
#P window linecount 5;
#P comment 671 617 175 196617 Input 2: Toggle: On starts recording. You can keep on recording for as long as you want and you will always get the last n seconds of the recording (length is set in input 3);
#P window linecount 1;
#P comment 671 594 175 196617 Input 1: Sound in;
#P window linecount 4;
#P comment 669 523 175 196617 This is an abstraction which lets you access the last n seconds of your jam oinstentaniously when you press stopp;
#P window linecount 1;
#P comment 174 41 46 196617 toggle;
#P outlet 358 658 15 0;
#P outlet 443 659 15 0;
#P newex 765 64 122 196617 r circularbuffer07-onoff;
#P newex 733 303 122 196617 r circularbuffer07-onoff;
#P newex 197 68 122 196617 s circularbuffer07-onoff;
#P newex 763 410 38 196617 s crop;
#P newex 641 410 38 196617 s crop;
#P newex 605 389 32 196617 del 2;
#P message 502 462 14 196617 1;
#P message 382 442 14 196617 1;
#P newex 382 466 29 196617 gate;
#P newex 502 484 29 196617 gate;
#P newex 690 303 27 196617 + 1;
#P newex 690 328 38 196617 gate 2;
#P newex 641 368 32 196617 sel 0;
#P newex 763 366 32 196617 sel 0;
#P message 691 411 55 196617 0 1038;
#P newex 691 389 62 196617 prepend set;
#P newex 691 434 58 196617 unpack 0 0;
#P newex 641 389 32 196617 del 1;
#P message 691 368 31 196617 0 $1;
#P newex 690 184 43 196617 / 1000;
#B color 5;
#P toggle 690 278 15 0;
#P newex 690 255 27 196617 > 0;
#P message 731 119 33 196617 clear;
#P newex 765 88 66 196617 metro 1000;
#P number 690 232 71 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 690 208 27 196617 -;
#P button 766 119 15 0;
#P newex 733 142 43 196617 timer;
#B color 5;
#P number 679 161 71 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 520 96 20 196617 t b;
#P newex 426 70 66 196617 loadmess 10;
#P newex 197 132 48 196617 loadbang;
#P message 652 54 18 196617 du;
#P newex 146 68 41 196617 sel 1 0;
#N comlet buffer name;
#P inlet 616 48 15 0;
#N comlet start (bang);
#P inlet 146 39 15 0;
#N comlet lengde (antall sekunder);
#P inlet 500 42 15 0;
#P newex 500 69 62 196617 prepend set;
#N comlet sound left;
#P inlet 25 38 15 0;
#P newex 286 447 38 196617 r crop;
#P newex 219 447 41 196617 r name;
#P newex 219 470 62 196617 prepend set;
#P newex 616 72 41 196617 s name;
#P newex 27 232 41 196617 r name;
#P newex 87 98 41 196617 s clear;
#P newex 41 360 41 196617 r clear;
#P message 161 161 29 196617 stop;
#P newex 27 256 62 196617 prepend set;
#P newex 92 359 27 196617 * 2;
#P newex 434 186 41 196617 * 44.1;
#P message 499 141 20 196617 10;
#P newex 422 163 44 196617 * 1000;
#P message 92 386 43 196617 size $1;
#P message 41 384 33 196617 clear;
#P newex 521 317 49 196617 + 60000;
#P newex 80 437 45 196617 loadbang;
#P message 286 470 28 196617 crop;
#P newex 80 415 140 196617 buffer~ Circ_Buffer 120000;
#P message 80 468 90 196617 set Circ_Buffer 1;
#P user waveform~ 142 509 490 93 3 9;
#W mode select;
#W mouseoutput continuous;
#W clipdraw 1;
#W unit ms;
#W grid 500.;
#W ticks 8;
#W labels 1;
#W vlabels 1;
#W vticks 1;
#W vzoom 0.12;
#W voffset 0.04;
#W bpm 120. 4.;
#W frgb 16 0 0;
#W brgb 94 166 169;
#W rgb2 63 112 185;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 169 165 207;
#W rgb6 108 108 108;
#W rgb7 78 74 220;
#P newex 304 219 64 196617 snapshot~ 5;
#P newex 345 270 66 196617 sampstoms~;
#P newex 204 305 93 196617 poke~ Circ_Buffer;
#B color 5;
#P newex 245 244 67 196617 +~ 2646000;
#P newex 146 184 112 196617 count~ 0 2646000 1 1;
#P newex 105 305 93 196617 poke~ Circ_Buffer;
#B color 5;
#P comment 46 39 46 196617 sound in;
#P user panel 661 114 258 244;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 350 364 538 142;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 25 0 21 0;
#P connect 23 0 15 0;
#P fasten 21 0 11 0 32 341 85 341;
#P connect 15 0 11 0;
#P connect 16 0 11 0;
#P fasten 13 0 10 0 85 460 85 460;
#P connect 11 1 10 0;
#P connect 35 0 24 0;
#P fasten 17 0 20 0 427 345 97 345;
#P connect 20 0 16 0;
#P connect 30 0 3 0;
#P connect 21 0 3 0;
#P fasten 21 0 9 0 32 493 147 493;
#P fasten 12 0 9 0 291 493 147 493;
#P connect 10 0 9 0;
#P connect 27 0 9 0;
#P connect 33 0 35 0;
#P connect 35 0 4 0;
#P connect 22 0 4 0;
#P connect 4 0 3 1;
#P connect 35 1 22 0;
#P connect 37 0 22 0;
#P connect 33 0 66 0;
#P connect 30 0 6 0;
#P connect 21 0 6 0;
#P connect 28 0 27 0;
#P fasten 4 0 5 0 151 240 250 240;
#P connect 5 0 6 1;
#P connect 19 0 4 1;
#P connect 29 0 12 0;
#P connect 19 0 5 1;
#P connect 4 0 8 0;
#P fasten 8 0 7 0 309 245 350 245;
#P connect 9 2 70 0;
#P connect 63 0 61 0;
#P connect 57 0 60 0;
#P connect 61 0 60 0;
#P connect 60 0 9 2;
#P connect 7 1 60 1;
#P fasten 52 0 60 1 696 454 406 454;
#P connect 18 0 17 0;
#P connect 17 0 19 0;
#P connect 9 3 69 0;
#P fasten 35 0 18 0 151 93 504 93;
#P connect 31 0 18 0;
#P connect 38 0 18 0;
#P connect 39 0 18 0;
#P connect 32 0 31 0;
#P connect 63 0 62 0;
#P connect 57 0 59 0;
#P connect 62 0 59 0;
#P connect 59 0 9 3;
#P connect 31 0 39 0;
#P fasten 7 1 14 0 406 307 526 307;
#P connect 52 1 59 1;
#P connect 14 0 59 1;
#P fasten 17 0 14 1 427 264 565 264;
#P connect 56 0 63 0;
#P connect 36 0 26 0;
#P connect 34 0 26 0;
#P connect 57 0 56 0;
#P connect 56 0 51 0;
#P connect 51 0 64 0;
#P connect 41 0 40 0;
#P connect 40 0 49 0;
#P connect 49 0 43 0;
#P connect 43 0 44 0;
#P connect 44 0 47 0;
#P connect 47 0 48 0;
#P connect 48 0 58 0;
#P connect 58 0 57 0;
#P fasten 40 0 50 0 684 360 696 360;
#P connect 50 0 53 0;
#P connect 56 0 54 0;
#P connect 53 0 54 0;
#P connect 54 0 52 0;
#P connect 18 0 43 1;
#P connect 67 0 57 1;
#P connect 35 0 41 0;
#P connect 46 0 41 0;
#P connect 57 1 55 0;
#P connect 55 0 65 0;
#P connect 68 0 45 0;
#P connect 45 0 42 0;
#P connect 42 0 41 1;
#P pop;

#174204
Feb 16, 2010 at 12:45pm

I am currently working on a similar setup, with a buffer in an abstraction and a waveform in the main patch.

Within the abstraction, the buffer gets an instantiated name: #0sample
The abstraction also sends this name out an outlet by means of a message box with the same argument: [ loadbang ]–[ #0sample ]–[ outlet ]

In the main patcher, the outlet of the abstraction is connected to the following: [ outlet]–[ prepend set ]–[ waveform~ ]

So on startup, the waveform is set to the buffer inside the abstraction.

Note: I am on Max 5 though, and with plenty of RAM (4 GB).

#174205
Feb 17, 2010 at 11:43am

 
you have not explained what your goal is, shoudl two instances of the same
abstraction share the buffers or not?

for abstractions i would always prefer to use an #1 argument, then the
handling of the abstraction follows the scheme of buffer~and simialr audio
objects.

an additional inlet is useful, too.

-110

#174206

You must be logged in to reply to this topic.