buffer~ problems

May 20, 2006 at 12:28pm

buffer~ problems

Hi folks,

I’m struggling to do 2 seemingly simple things with a buffer:

1. resize the buffer after recording into it, without deleting the recording like the ‘size’ message,

2. write the file to a specific location automatically after the resize.

These operations should be completely automatic, as its for an installation that I wont be at all the time.

Thanks for any advise!

Sam

#26080
May 20, 2006 at 12:53pm

> 1. resize the buffer after recording into it, without deleting the recording like the ‘size’ message,

Why do you want to resize the buffer~ after recording ?????

Anyway, save the buffer~ as sounfile, resize buffer~, reload, rewrite…

Or use buf.Op to copy the content of your buffer~ into a temp one.

#77500
May 20, 2006 at 12:58pm

I tried to do the same thing a while back; it doesn’t work. Resizing the buffer seems to re-alot the necessary memory, erradicating the memory it had (and your recording). What you need is enough memory beforehand. If you know that you will be recording, say, maximum 12 seconds of sound, just set the buffer to be more than that and resize by controlling the playback parameters instead of changing the buffer. For my own purposes, I went to over to using stutter for alot of “precording” work.

#77501
May 20, 2006 at 1:44pm

On 20 May 2006, at 13:28, Sam Barker wrote:

> 2. write the file to a specific location automatically after the
> resize.

If you use Thomas Grill’s xrecord ( http://grrrr.org.ext ), there’s
an outlet that gives a bang when record is finished. You can use this
to bang the write message to buffer.
If you have to use record~, you’ll have to use the sync output and
detect record end from that. For instance (there are probably better
ways…)

david

#77502
May 20, 2006 at 3:53pm

Thanks for that…

I should to explain a little better. To summarise as briefly as possible, I have a microphone and a push button (acting as a toggle for a gate~) in a corridor, inviting members of the public to make a sound ito it. This sound is then manipulated and redistributed around 6 speakers in the ceiling along its length.

It occured to me that this this would make a great library of sounds, so what i want is an automated process to store what is input through the mic.

I wanted to resize the buffer because the participants will record sounds of varying lengths, up to ten seconds.

I think I’ve solved the issue of resizing.. or rather sidestepped it be recording the samples sequentially onto a larger buffer of say 10 minutes, rather than each sample being saved individually.

What I’m still stuck with is writing each buffer~ to a specific folder when it is full, and with a different filename to the last so as not to overwrite…

Thanks again for the help!

Sam

#77503
May 20, 2006 at 4:13pm

#77504
May 20, 2006 at 4:16pm

When writing the file the default folder include the date/time in the file
name. this will guarantee a unique file name file saved, as long as you
don’t set your clock back…

It will also allow for easy organization of your files (they will be
alpha-numerically sequential as they were saved),so you don’t necessarily
need to have a lot of separate folders.

#77505
May 20, 2006 at 5:19pm

#77506
May 20, 2006 at 6:39pm

Have a look at the Quickrecord patch in the Extras folder, specifically, the
sub patcher ‘quickie’,
Cheers
Roger

#77507
May 20, 2006 at 8:53pm

thanks!

problem solved.

sprintf and waveform~ did the job nicely.

Cheers,

Sam

#77508
May 20, 2006 at 9:16pm

Sam,

you might be able to find something useful in this patch (though
you’d have to apply an appropriate bang on end of record to do the
actual save). This is a patch I put together for assembling several
sounds into a large buffer, then copying only as much of the buffer
as is recorded over to another buffer to trim the file, and then
saving the new sound file. There may be a few 3rd party objects you
need to find…

David

max v2;
#N vpatcher 274 264 1096 578;
#P origin 99 59;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden newex 1090 165 40 196617 r bgcol;
#P objectname receive[10];
#P hidden newex 1090 186 42 196617 bgcolor;
#P window setfont “Sans Serif” 10.;
#P hidden message -77 36 15 196618 1;
#P window setfont “Sans Serif” 9.;
#P user ubumenu 15 74 100 196617 0 1 1 1;
#X setrgb 31 31 31 189 192 189 234 234 234 166 0 163 141 141 141 112
112 112;
#X add normalise off;
#X add normalise on load;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P window setfont “Sans Serif” 10.;
#P hidden newex 156 417 49 196618 gate 1 1;
#N vpatcher 10 59 417 476;
#P window setfont “Sans Serif” 10.;
#P message 55 219 35 196618 reset;
#P newex 174 244 74 196618 r bfrsegmess;
#P message 60 164 15 196618 0;
#P newex 93 125 30 196618 t b i;
#P newex 93 154 40 196618 accum;
#P newex 50 50 59 196618 delay 100;
#P message 66 87 34 196618 set 0;
#P message 50 245 35 196618 clear;
#P newex 93 219 46 196618 pack i i;
#P newex 93 245 70 196618 Ltocoll 0 30;
#P newex 93 192 42 196618 bucket;
#N coll bfrsegs 1;
#P newobj 93 274 77 196618 coll bfrsegs 1;
#P inlet 50 30 15 0;
#P inlet 93 105 15 0;
#P connect 1 0 8 0;
#P connect 8 0 6 0;
#P fasten 8 0 13 0 55 208 60 208;
#P fasten 8 0 11 0 55 136 65 136;
#P connect 8 0 7 0;
#P connect 0 0 10 0;
#P fasten 7 0 9 0 71 151 98 151;
#P connect 10 0 9 0;
#P connect 9 0 3 0;
#P fasten 11 0 3 0 65 186 98 186;
#P connect 3 0 5 0;
#P connect 5 0 4 0;
#P fasten 13 0 4 0 60 240 98 240;
#P fasten 6 0 2 0 55 267 98 267;
#P connect 4 0 2 0;
#P fasten 12 0 2 0 179 268 98 268;
#P connect 10 1 9 1;
#P fasten 9 0 5 1 98 182 134 182;
#P fasten 11 0 4 1 65 216 158 216;
#P pop;
#P hidden newobj 423 411 85 196618 p store_to_coll;
#P hidden newex 891 620 27 196618 +;
#P hidden newex 891 649 57 196618 s bfr_end;
#P hidden newex 387 -22 34 196618 t 0. f;
#P hidden newex 317 436 70 196618 mstosamps~;
#P hidden newex 239 409 105 196618 info~ transfer;
#P hidden message 922 461 34 196618 set 0;
#P hidden newex 779 560 27 196618 + 0;
#P hidden newex 957 459 34 196618 t 0 0;
#P hidden newex 861 503 30 196618 t b i;
#P hidden newex 876 535 42 196618 bucket;
#P hidden newex 861 566 40 196618 accum;
#P hidden newex 742 649 46 196618 pack f f;
#P hidden newex 742 674 90 196618 peek~ transfer2;
#P hidden newex 742 619 27 196618 + 0;
#P hidden newex 779 606 83 196618 peek~ transfer;
#P hidden newex 146 356 85 196618 r transbfrmess;
#P hidden newex 667 501 70 196618 sampstoms~;
#P hidden newex 742 443 32 196618 t b b;
#P hidden newex 702 474 27 196618 int;
#P hidden newex 833 319 48 196618 select 0;
#P hidden button 1273 185 15 0;
#P hidden newex 1297 158 15 196618 _;
#P hidden message 1273 227 115 196618 brgb 161 216 141;
#P hidden newex 1297 133 49 196618 r colors;
#P hidden newex 845 292 73 196618 s bfrsegmess;
#P hidden newex 923 292 84 196618 s transbfrmess;
#P window setfont “Sans Serif” 9.;
#P window linecount 3;
#P hidden newex 909 231 50 196617 sprintf write %s.aif;
#P hidden newex 845 231 50 196617 sprintf write %s.txt;
#P window linecount 1;
#P hidden newex 845 198 107 196617 savedialog;
#P window setfont “Sans Serif” 10.;
#P hidden newex 742 414 48 196618 select 0;
#P hidden newex 812 385 70 196618 mstosamps~;
#P hidden newex 739 385 70 196618 mstosamps~;
#P hidden newex 745 474 27 196618 int;
#P hidden newex 745 501 53 196618 tl.uzi;
#N vpatcher 10 59 510 450;
#P window setfont “Sans Serif” 10.;
#P newex 219 134 27 196618 – 1;
#P newex 255 217 48 196618 select 1;
#P newex 255 250 59 196618 delay 250;
#P newex 255 279 139 196618 tap.buffer.norm~ transfer;
#P newex 52 129 70 196618 sampstoms~;
#P button 115 50 15 0;
#P newex 127 102 40 196618 t i i 0;
#P newex 145 55 58 196618 r bfr_end;
#P newex 128 79 27 196618 int;
#P message 50 164 46 196618 size $1;
#P newex 127 233 46 196618 pack f f;
#P newex 127 258 83 196618 peek~ transfer;
#N counter 0 440628;
#X flags 0 0;
#P newobj 127 158 102 196618 counter 0 440628;
#P newex 159 201 90 196618 peek~ transfer2;
#P newex 127 130 53 196618 tl.uzi;
#P inlet 115 30 15 0;
#P outlet 50 186 15 0;
#P fasten 12 1 7 0 117 156 55 156;
#P connect 7 0 0 0;
#P fasten 10 1 12 0 147 125 57 125;
#P connect 1 0 11 0;
#P connect 8 0 10 0;
#P connect 10 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 5 0;
#P fasten 11 0 8 0 120 73 133 73;
#P connect 9 0 8 1;
#P fasten 4 0 3 0 132 189 164 189;
#P fasten 3 0 6 1 164 229 168 229;
#P fasten 10 2 4 2 162 125 196 125 196 152 178 152;
#P fasten 8 0 16 0 133 99 224 99;
#P connect 16 0 4 4;
#P connect 15 0 14 0;
#P connect 14 0 13 0;
#P pop;
#P hidden newobj 38 423 80 196618 p size_n_copy;
#P window setfont “Sans Serif” 12.;
#P user ubumenu 15 124 100 196620 0 0 1 1;
#X setrgb 31 31 31 229 227 117 234 234 234 198 33 0 141 141 141 112
112 112;
#X add copy selection;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P window setfont “Sans Serif” 10.;
#P hidden newex 823 418 27 196618 !-;
#P hidden newex 705 354 58 196618 unpack f f;
#P hidden newex 355 301 67 196618 mousefilter;
#P hidden newex 355 322 46 196618 pack f f;
#P user pictslider 134 43 19 76 0 0 0 0 wfknob.pct 1 wfmodes.pct 1
2146 0 0 196608 1. 1.;
#P window setfont “Sans Serif” 9.;
#N vpatcher 40 55 278 404;
#P window setfont “Sans Serif” 9.;
#P newex 96 202 27 196617 int;
#N coll ;
#T flags 1 0;
#T 0 mode select;
#T 1 mode loop;
#T 2 mode move;
#T 3 mode draw;
#P newobj 131 255 53 196617 coll;
#P button 75 117 15 0;
#N comlet waveform~ mode messages;
#P inlet 74 164 15 0;
#P newex 113 88 27 196617 < < 1;
#P newex 96 140 40 196617 change;
#P newex 96 164 45 196617 select 0;
#P newex 96 117 27 196617 |;
#P outlet 131 284 15 0;
#P newex 45 62 78 196617 modifiers 100;
#P connect 5 0 7 0;
#P connect 7 0 2 0;
#P connect 0 3 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 6 0 9 0;
#P connect 3 0 9 0;
#P connect 0 4 5 0;
#P connect 5 0 2 1;
#P connect 3 1 8 0;
#P connect 9 0 8 0;
#P connect 8 0 1 0;
#P pop;
#P hidden newobj 153 -15 50 196617 p wfkeys;
#P window setfont “Sans Serif” 10.;
#P hidden message 622 10 75 196618 refer bfrsegs;
#P user jit.cellblock 636 43 797 289 3 10 1 1 45 17 0 1 1 0 1 0 1 1 1
0 0 0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4
0 0 0;
#P window setfont “Sans Serif” 12.;
#P user ubumenu 15 190 100 196620 0 0 1 1;
#X setrgb 31 31 31 255 124 107 234 234 234 29 0 198 141 141 141 112
112 112;
#X add save;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P window setfont “Sans Serif” 9.;
#P hidden message 1036 39 32 196617 front;
#P hidden newex 1036 64 63 196617 r windowoff;
#P hidden message 1036 91 244 196617 window notitle , window flags
nogrow , window exec;
#P hidden message 1036 143 224 196617 window title , window flags
grow , window exec;
#P hidden newex 1036 118 60 196617 r windowon;
#N thispatcher;
#Q end;
#P hidden newobj 1016 189 60 196617 thispatcher;
#P hidden inlet 1024 -1 15 0;
#P window setfont “Sans Serif” 10.;
#P hidden message -76 201 22 196618 20;
#P hidden message -56 348 46 196618 size $1;
#P hidden newex -56 318 51 196618 * 1000.;
#P window setfont “Sans Serif” 12.;
#P number 15 231 35 12 0 60 67 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 14.;
#P comment 321 12 132 196622 Sample compiler;
#P hidden button -105 296 15 0;
#P window setfont “Sans Serif” 12.;
#P user ubumenu 15 45 100 196620 0 0 1 1;
#X setrgb 31 31 31 227 155 104 234 234 234 198 33 0 141 141 141 112
112 112;
#X add clear;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 15 160 100 196620 0 0 1 1;
#X setrgb 31 31 31 105 227 104 234 234 234 198 33 0 141 141 141 112
112 112;
#X add size and copy;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P window setfont “Sans Serif” 10.;
#P hidden newex 59 317 33 196618 t b 1;
#P window setfont “Sans Serif” 12.;
#P user ubumenu 15 96 100 196620 0 0 1 1;
#X setrgb 31 31 31 229 227 117 234 234 234 198 33 0 141 141 141 112
112 112;
#X add load sound;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P window setfont “Sans Serif” 10.;
#P hidden newex -94 -22 51 196618 loadbang;
#P hidden button 423 350 15 0;
#P hidden message -94 319 35 196618 clear;
#P hidden message 878 125 75 196618 set transfer2;
#P hidden message 806 22 68 196618 set transfer;
#P window setfont “Sans Serif” 9.;
#P user waveform~ 156 169 473 120 3 9;
#W mode select;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 132 214 152;
#W rgb2 0 95 255;
#W rgb3 214 35 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P user waveform~ 156 43 473 120 3 9;
#W mode move;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P window setfont “Sans Serif” 10.;
#P hidden newex -99 382 140 196618 buffer~ transfer2 20000.;
#P hidden message 59 349 46 196618 replace;
#P hidden newex 123 384 126 196618 buffer~ transfer 1000.;
#P window linecount 2;
#P comment 53 226 79 196618 intital buffer size (seconds);
#P user panel 1 1 817 309;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 1;
#P hidden newex 156 440 139 196618 tap.buffer.norm~ transfer;
#P hidden fasten 16 0 17 0 20 68 -100 68;
#P hidden fasten 10 0 5 0 -89 372 -94 372;
#P hidden fasten 21 0 5 0 -51 372 -94 372;
#P hidden connect 12 0 10 0;
#P hidden connect 17 0 10 0;
#P hidden fasten 12 0 78 0 -89 16 -72 16;
#P hidden fasten 12 0 22 0 -89 178 -71 178;
#P hidden fasten 19 0 20 0 20 256 -51 256;
#P hidden connect 20 0 21 0;
#P hidden fasten 78 0 77 0 -72 68 20 68;
#P hidden fasten 22 0 19 0 -71 227 20 227;
#P hidden fasten 15 0 40 0 20 185 6 185 6 360 43 360;
#P hidden fasten 13 0 14 0 20 120 6 120 6 311 64 311;
#P hidden connect 14 0 4 0;
#P hidden fasten 10 0 3 0 -89 372 128 372;
#P hidden fasten 59 0 3 0 151 379 128 379;
#P hidden fasten 4 0 3 0 64 372 128 372;
#P hidden fasten 40 0 3 0 43 449 121 449 121 372 128 372;
#P hidden connect 34 1 33 0;
#P hidden connect 33 0 6 0;
#P hidden fasten 8 0 6 0 811 39 161 39;
#P hidden fasten 9 0 7 0 883 166 161 166;
#P hidden fasten 77 0 76 0 20 93 6 93 6 410 161 410;
#P hidden connect 76 0 0 0;
#P hidden fasten 3 1 76 1 244 406 200 406;
#P hidden connect 3 1 70 0;
#P hidden connect 70 6 71 0;
#P hidden fasten 6 2 36 0 345 296 360 296;
#P hidden connect 36 0 35 0;
#P hidden connect 72 0 6 2;
#P hidden fasten 71 1 72 0 382 470 6 470 6 -24 392 -24;
#P hidden fasten 6 3 35 1 437 296 423 296 423 321 396 321;
#P hidden fasten 10 0 11 0 -89 344 428 344;
#P hidden connect 11 0 75 0;
#P hidden fasten 58 1 75 1 732 534 610 534 610 391 503 391;
#P hidden fasten 72 1 6 3 416 3 506 3;
#P hidden fasten 12 0 32 0 -89 5 627 5;
#P hidden connect 32 0 31 0;
#P hidden fasten 56 0 58 0 707 497 672 497;
#P hidden fasten 57 0 56 0 747 464 707 464;
#P hidden fasten 35 0 37 0 360 344 710 344;
#P hidden fasten 38 0 56 1 828 440 724 440;
#P hidden fasten 37 0 43 0 710 382 744 382;
#P hidden fasten 39 0 45 0 20 150 6 150 6 344 688 344 688 408 747 408;
#P hidden connect 45 0 57 0;
#P hidden fasten 41 2 61 0 778 527 747 527;
#P hidden fasten 61 0 63 0 747 652 747 652;
#P hidden connect 63 0 62 0;
#P hidden fasten 57 1 42 0 769 466 750 466;
#P hidden connect 42 0 41 0;
#P hidden fasten 64 0 61 1 866 596 764 596;
#P hidden fasten 38 0 42 1 828 472 767 472;
#P hidden fasten 60 0 63 1 784 645 783 645;
#P hidden fasten 41 2 68 0 778 540 784 540;
#P hidden connect 68 0 60 0;
#P hidden fasten 43 1 68 1 804 413 809 413 809 554 801 554;
#P hidden fasten 11 0 8 0 428 377 977 377 977 18 811 18;
#P hidden fasten 3 1 8 0 244 406 219 406 219 344 977 344 977 18 811 18;
#P hidden fasten 37 1 44 0 758 382 817 382;
#P hidden fasten 43 1 38 0 804 413 828 413;
#P hidden fasten 30 0 55 0 20 218 6 218 6 311 838 311;
#P hidden fasten 44 1 38 1 877 413 845 413;
#P hidden fasten 55 0 46 0 838 341 1010 341 1010 192 850 192;
#P hidden connect 46 0 47 0;
#P hidden fasten 47 0 50 0 850 282 850 282;
#P hidden fasten 42 0 66 0 750 497 866 497;
#P hidden connect 66 0 64 0;
#P hidden fasten 69 0 64 0 927 560 866 560;
#P hidden fasten 66 1 65 0 886 528 881 528;
#P hidden fasten 67 0 65 0 962 528 881 528;
#P hidden fasten 67 1 65 0 986 528 881 528;
#P hidden connect 65 0 64 1;
#P hidden fasten 11 0 9 0 428 377 977 377 977 122 883 122;
#P hidden fasten 64 0 74 0 866 602 896 602;
#P hidden connect 74 0 73 0;
#P hidden fasten 66 1 74 1 886 528 913 528;
#P hidden fasten 46 0 48 0 850 223 914 223;
#P hidden fasten 11 0 69 0 428 377 927 377;
#P hidden fasten 48 0 49 0 914 282 928 282;
#P hidden fasten 11 0 67 0 428 377 962 377;
#P hidden fasten 26 0 24 0 1041 171 1021 171;
#P hidden fasten 27 0 24 0 1041 115 1021 115;
#P hidden fasten 23 0 24 0 1029 125 1021 125;
#P hidden fasten 29 0 24 0 1041 63 1021 63;
#P hidden connect 28 0 27 0;
#P hidden connect 25 0 26 0;
#P hidden connect 80 0 79 0;
#P hidden connect 53 0 54 0;
#P hidden connect 53 0 52 0;
#P hidden connect 54 0 52 0;
#P hidden connect 51 0 53 0;
#P pop;

#77509

You must be logged in to reply to this topic.