Forums > MaxMSP

Record into a buffer without knowing how long it is going to be

April 4, 2008 | 5:50 am

dear Reader,

I wonder how it is possible to record live into a buffer~ without adjusting the buffers length (like buffer~ rec 2000)… as I do not know how long the recording is going to be, and I want to make sure the buffer~ starts when I start recording and ends when I stop.

All help appreciated,
Krisztian

max v2;
#N vpatcher 11 53 772 682;
#P window setfont "Sans Serif" 9.;
#P user number~ 375 286 414 301 9 3 3 2 0. 0. 0 0. 50 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P comment 446 144 72 196620 SOUND 3;
#P window setfont "Sans Serif" 9.;
#P newex 407 226 29 196617 adc~;
#P toggle 375 226 15 0;
#P newex 375 249 60 196617 record~ s3;
#P message 373 147 41 196617 replace;
#P newex 373 188 91 196617 buffer~ s3 10000;
#P user panel 369 141 152 131;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user number~ 207 287 246 302 9 3 3 2 0. 0. 0 0. 50 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P user number~ 32 286 71 301 9 3 3 2 0. 0. 0 0. 50 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#P comment 278 145 72 196620 SOUND 2;
#P window setfont "Sans Serif" 9.;
#P newex 239 227 29 196617 adc~;
#P toggle 207 227 15 0;
#P newex 207 250 60 196617 record~ s2;
#P message 205 148 41 196617 replace;
#P newex 205 189 85 196617 buffer~ s2 1000;
#P user panel 201 142 152 131;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user ezdac~ 63 62 107 95 0;
#P window setfont "Sans Serif" 12.;
#P comment 103 145 72 196620 SOUND 1;
#P window setfont "Sans Serif" 9.;
#P newex 64 227 29 196617 adc~;
#P toggle 32 227 15 0;
#P newex 32 250 60 196617 record~ s1;
#P message 30 148 41 196617 replace;
#P newex 30 189 58 196617 buffer~ s1;
#P user panel 26 142 152 131;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 5;
#P comment 540 146 100 196617 I would like to have just the recorded material in the buffer , how is that possible?;
#P hidden connect 3 0 2 0;
#P connect 5 0 4 0;
#P hidden fasten 6 0 4 0 69 246 37 246;
#P connect 6 1 4 0;
#P connect 4 0 16 0;
#P hidden connect 11 0 10 0;
#P connect 13 0 12 0;
#P hidden fasten 14 0 12 0 244 246 212 246;
#P connect 14 1 12 0;
#P connect 12 0 17 0;
#P hidden connect 20 0 19 0;
#P connect 22 0 21 0;
#P hidden fasten 23 0 21 0 412 245 380 245;
#P connect 23 1 21 0;
#P connect 21 0 25 0;
#P pop;


April 4, 2008 | 12:55 pm

Moving this thread to the MaxMSP forum.


April 4, 2008 | 1:20 pm

hi

you can do this by using sfrecord~ and buffer~.
sfrecord~ creates an aiff file on the disk
load the recorded sound in the buffer as soon as you press the stop button.
that’s what i do in my sample recorder… works fine

cheers

g


April 4, 2008 | 1:43 pm

sfrecord~

It works, thank you G.

tEd


April 11, 2008 | 10:03 am

Hello

Im fairly new to this, I’m trying a similar thing where I want the buffer size to be governed by the length of time the record button is depressed. I also want this to be automated so i don’t have to be clicking around dialog boxes when I’m performing.
Ideally I’d like the ‘open’ message controlling sfrecord~ to occur automatically each time I want to record a file. I cant seem to be able to make this work without having to specify a new filename each time or overwriting the previous one which Max doesn’t want to do.

Any ideas?

thanks

Phil


April 11, 2008 | 10:37 am

>Ideally I’d like the ‘open’ message controlling sfrecord~ to occur
>automatically each time I want to record a file. I cant seem to be able
>to make this work without having to specify a new filename each time or
>overwriting the previous one which Max doesn’t want to do.

This could be automated. Have a look at Quickrecord in the Extras menu
to get an idea how!
Then trigger a "replace

" message to the
buffer~ when you stop the recording.

/J


April 11, 2008 | 11:54 am

Thanks alot J

That seems to work well but i still have to specify the "replace" file in the buffer`.

I’d imagine i’d need to try and re-write the quickie so it automatically looks for the file ive just recorded. Any ideas how i might do that?

CHEERS

Phil


April 11, 2008 | 12:26 pm

when using buffers and grooves, what is the object used to stop clicking at random playback of the buffer?


April 11, 2008 | 1:23 pm

you could use the ‘clocker’ object in conjunction with buffer~

clocker counts time since it was started; you can send this figure to the "size $1" command for buffer~’s length. so when you start the counter the buffer is being extended until you send a message to counter to stop. how you then control that live is up to you.

max v2;
#N vpatcher 15 55 615 455;
#P window setfont "Sans Serif" 9.;
#P flonum 229 123 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 210 54 26 9109513 stop;
#P button 186 53 15 0;
#P message 113 102 37 9109513 size $1;
#P newex 102 145 66 9109513 buffer~ test 1;
#P newex 218 91 38 9109513 clocker;
#P connect 2 0 1 0;
#P connect 0 0 2 0;
#P connect 3 0 0 0;
#P connect 4 0 0 0;
#P connect 0 0 5 0;
#P pop;

it works; it just crashed my maxmsp, but my pc’s a piece of tat.
hope that helps.


April 11, 2008 | 1:53 pm

Thanks for that

One question though- i cant decode your text scematics.

How is this actually implemeted? Im struggling to get the buffer to acknowledge the value of the clocker and resize each time I cease recording.

CHeers


April 11, 2008 | 2:08 pm

i hope this isn’t coming through garbled too.

insert clocker
link it to a message with the words "size $1"
link that message to the buffer object. make sure the buffer object has a default size i.e. buffer~ test 100

now if you connect the message to start your recording, and stop respectively to clocker, or just use the on off switch, when u start recording, the clocker will start counting, sending this value to the buffer, resizeing as it goes. when u stop recording, the buffer will sotp expaning. there may be prettier ways of doin g this, but i did something similar by the sounds of it, to what your doing, and i am to understand this is the best way of getting round it. if you try to devise your own method (through maths etc) the scheduler may get in your way…..

hope all goes well.
jb


April 11, 2008 | 2:19 pm

>One question though- i cant decode your text scematics.

>From the "WhatsNewInMaxMSP455.pdf

"Has someone ever sent you (or posted) a patch as text you wanted to
try? Previously you had to copy the text, paste it into a file, save the
file, switch to Max, locate the file, and open it. Now the procedure is
simpler:
? Copy the text in your e-mail program
? Switch to (or launch) Max
? Choose New from Clipboard from the File menu
Voila, there’s your patch in an untitled window. A window created via
New from Clipboard is set as modified, so you will be reminded to save
it when you close it or quit Max."

:-)
J


April 11, 2008 | 2:37 pm

THanks for your help mate unfortunately its still not working.

I was under the impression you had to trigger a message like that to get it to work but even with a bang connected to my record button doesnt get it going.

Im gonna upload a screen print of how its set up. maybe you could scrutinise it for me

Thanks again


April 11, 2008 | 3:18 pm

Every time you resize buffer~ you clear it, so this approach will never
work.

Two options:
- Pre-allocate a buffer to a determined maximum length, and track how
much was recorded using the output of record~
- Use sfrecord~


Owen

Phil wrote:
> Im gonna upload a screen print of how its set up. maybe you could
> scrutinise it for me


April 11, 2008 | 5:43 pm

this is how I approached it, might helps..

All the best,

max v2;
#N vpatcher 14 59 1050 800;
#P user ezdac~ 35 37 79 70 0;
#P window setfont "Sans Serif" 9.;
#N vpatcher 412 44 1068 737;
#N comlet signal end;
#P outlet 557 511 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 347 39 48 196617 loadbang;
#P newex 507 78 38 196617 r vol1;
#P flonum 507 108 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 398 411 93 196617 scale 0. 1. 0. 0.17;
#P window linecount 0;
#P newex 240 411 93 196617 scale 0. 1. 0. 0.17;
#P window linecount 1;
#P message 311 116 17 196617 1.;
#P window linecount 0;
#P message 261 118 17 196617 1.;
#P window linecount 1;
#P newex 146 74 59 196617 r bangpan1;
#P window linecount 0;
#P newex 240 25 49 196617 r evorod;
#P window linecount 1;
#P message 290 115 17 196617 0.;
#P window linecount 0;
#P message 240 118 17 196617 0.;
#P button 276 86 15 0;
#P button 240 87 15 0;
#P window linecount 1;
#P newex 240 66 46 196617 select 1;
#P toggle 240 49 15 0;
#P outlet 367 515 15 0;
#P outlet 208 516 15 0;
#P inlet 2 78 15 0;
#P newex 321 439 41 196617 * 127.;
#P user hslider 321 471 18 102 128 1 0 0;
#P newex 398 344 79 196617 scale 1. 0.;
#P flonum 398 378 35 9 0. 1.2 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 367 440 41 196617 *~ 0.2;
#P newex 162 440 41 196617 * 127.;
#P user hslider 162 472 17 95 128 1 0 0;
#P newex 240 247 62 196617 prepend set;
#P message 240 272 79 196617 0. , 1. 5000;
#P flonum 264 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 288 174 39 196617 r dur1;
#P flonum 240 172 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 240 198 58 196617 pak 0. 0. 0;
#P message 240 225 65 196617 $1 \, $2 $3;
#P newex 240 296 50 196617 line 0. 1.;
#P flonum 240 379 35 9 0. 1.2 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 209 439 41 196617 *~ 0.2;
#P window linecount 0;
#P comment 309 650 100 196617 Thank you Richard:);
#P comment 549 109 100 196617 Adjust volume;
#P connect 3 0 13 0;
#P connect 13 0 12 0;
#P connect 2 0 20 0;
#P connect 19 0 2 0;
#P connect 28 0 22 0;
#P connect 22 0 23 0;
#P connect 23 0 24 0;
#P connect 36 0 24 0;
#P connect 24 0 26 0;
#P connect 31 0 7 0;
#P connect 26 0 7 0;
#P lcolor 4;
#P connect 7 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 11 0;
#P connect 29 0 10 0;
#P connect 11 0 10 0;
#P connect 10 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 32 0;
#P connect 32 0 2 1;
#P connect 24 0 30 0;
#P connect 30 0 9 0;
#P connect 27 0 9 0;
#P lcolor 4;
#P connect 9 0 6 1;
#P connect 23 1 25 0;
#P connect 8 0 6 2;
#P connect 25 0 27 0;
#P connect 34 0 32 4;
#P connect 25 0 31 0;
#P connect 15 0 18 0;
#P connect 18 0 17 0;
#P connect 19 0 14 0;
#P connect 14 0 21 0;
#P connect 4 0 16 0;
#P connect 16 0 15 0;
#P connect 15 0 33 0;
#P connect 33 0 14 1;
#P connect 34 0 33 4;
#P connect 35 0 34 0;
#P fasten 4 1 37 0 285 322 562 322;
#P pop;
#P newobj 546 271 51 196617 p panning;
#P newex 546 332 51 196617 dac~;
#P message 655 247 208 196617 note 5000 0 593 0. 0.17 seq01;
#P newex 655 226 62 196617 prepend set;
#P newex 546 183 32 196617 t b l;
#P newex 546 206 145 196617 pack note 0 0 0 0. 0.25 seq01;
#P newex 546 238 104 196617 poly~ play+gizmo~ 8;
#P window linecount 2;
#P comment 720 219 100 196617 message sent to poly~;
#P user panel 540 178 328 177;
#X brgb 237 244 185;
#X frgb 0 0 0;
#X border 1;
#X rounded 13;
#X shadow 0;
#X done;
#P window linecount 1;
#P newex 220 154 40 196617 key;
#B color 5;
#P newex 220 176 52 196617 select 49;
#P newex 221 624 59 196617 s bangpan1;
#P number 268 561 74 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 318 455 33 196617 stop;
#P comment 290 457 24 196617 stop;
#P button 268 456 15 0;
#P newex 268 525 58 196617 clocker 10;
#B color 5;
#P number 371 126 50 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 316 79 13 0;
#P number 316 127 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 539 44 1057 540;
#P button 68 25 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 317 215 39 196617 s dur1;
#N comlet muliply lenght by x;
#P outlet 251 461 15 0;
#N comlet set length to;
#P inlet 251 37 15 0;
#P flonum 251 186 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 113 93 88 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P outlet 85 94 15 0;
#N comlet buffer info;
#P inlet 7 25 15 0;
#P newex 7 55 105 196617 info~ seq01;
#P connect 1 0 0 0;
#P connect 8 0 0 0;
#P connect 0 6 2 0;
#P connect 0 6 3 0;
#P connect 5 0 4 0;
#P connect 4 0 6 0;
#P connect 4 0 7 0;
#P pop 1;
#P newobj 316 103 65 196617 p seq01 info;
#P comment 398 66 34 196617 odd;
#P message 396 83 40 196617 15000;
#P message 355 83 34 196617 5000;
#P number 354 316 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 316 298 68 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden button 240 219 15 0;
#P comment 246 244 82 196617 bang the sound;
#P comment 346 336 43 196617 volume;
#P comment 228 317 125 196617 semitones higher or lower;
#P comment 390 300 30 196617 end;
#P comment 352 280 32 196617 start;
#P flonum 392 334 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 220 238 19 0;
#P message 240 412 116 196617 5000 0 593 0 0.17;
#P newex 240 388 62 196617 prepend set;
#P newex 240 365 90 196617 pack 0 0 0 0 0.17;
#P number 278 279 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 240 260 74 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 316 261 38 196617 lenght;
#P window setfont "Sans Serif" 14.;
#P comment 241 342 53 196622 seq01;
#P window setfont "Sans Serif" 9.;
#P comment 355 66 34 196617 even;
#P comment 278 508 92 196617 TEST THE LENGHT;
#P user panel 255 446 129 146;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P toggle 32 210 15 0;
#P message 106 190 75 196617 read rec01.aif;
#P message 57 210 75 196617 open rec01.aif;
#P window setfont "Sans Serif" 12.;
#P comment 103 145 72 196620 SOUND 1;
#P window setfont "Sans Serif" 9.;
#P newex 64 227 29 196617 adc~;
#P newex 32 250 55 196617 sfrecord~;
#P message 30 148 41 196617 replace;
#P newex 30 189 74 196617 buffer~ seq01;
#P user panel 26 142 166 130;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 213 81 100 196617 bang to get length;
#P comment 590 417 100 196617 stops clocke;
#P hidden connect 4 0 3 0;
#P hidden connect 9 0 3 0;
#P connect 6 0 5 0;
#P connect 6 1 5 0;
#P connect 8 0 5 0;
#P connect 10 0 5 0;
#P connect 45 0 44 0;
#P fasten 30 0 21 0 359 334 205 334 205 234 225 234;
#P connect 44 0 21 0;
#P connect 21 0 43 0;
#P hidden fasten 22 0 28 0 397 354 431 354 431 197 245 197;
#P hidden fasten 29 0 28 0 321 340 214 340 214 197 245 197;
#P hidden fasten 17 0 28 0 283 340 213 340 213 196 245 196;
#P connect 37 0 16 0;
#P lcolor 7;
#P hidden connect 28 0 16 0;
#P hidden connect 16 0 18 0;
#P connect 18 0 19 0;
#P fasten 21 0 20 0 225 408 245 408;
#P connect 19 0 20 0;
#P hidden connect 17 0 18 1;
#P fasten 21 0 39 0 133 400;
#P connect 39 0 38 0;
#P fasten 41 0 38 0 323 484 273 484;
#P connect 38 0 42 0;
#P hidden connect 29 0 18 2;
#P hidden connect 30 0 18 3;
#P connect 36 0 34 0;
#P connect 34 0 35 0;
#P connect 35 0 29 0;
#P lcolor 7;
#P fasten 54 2 41 0 742 380;
#P hidden connect 22 0 18 4;
#P connect 32 0 34 1;
#P connect 31 0 34 1;
#P connect 34 1 37 0;
#P fasten 20 0 50 0 245 434 520 434 520 153 551 153;
#P connect 50 0 49 0;
#P connect 49 0 48 0;
#P connect 48 0 54 0;
#P connect 54 0 53 0;
#P connect 50 1 49 1;
#P connect 54 1 53 1;
#P connect 49 0 51 0;
#P connect 51 0 52 0;
#P pop;


April 11, 2008 | 6:39 pm

Interesting to see one of my patches in this play+gizmo~ I posted a package
recently with this and a help file. You can find it in the forum archive.
I wrote this generic version to post to the list. Funny, I hadn’t put it in
my own search path.

Recording with sfrecord~ does not require advance specification of the file
length but sometimes recording is interrupted.

You can automate the buffer~ read like this…

#P window setfont "Sans Serif" 9.;
#P number 149 209 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 109 174 105 196617 info~ seq01;
#P newex 0 330 50 196617 del 1000;
#P newex 1 298 32 196617 sel 0;
#P toggle 44 210 15 0;
#P message 120 147 75 196617 read rec01.aif;
#P message 65 233 75 196617 open rec01.aif;
#P window setfont "Sans Serif" 12.;
#P comment 117 102 72 196620 SOUND 1;
#P window setfont "Sans Serif" 9.;
#P newex 86 258 29 196617 adc~;
#P newex 41 298 55 196617 sfrecord~;
#P message 44 105 41 196617 replace;
#P newex 44 146 74 196617 buffer~ seq01;
#P connect 10 6 11 0;
#P connect 0 1 10 0;
#P connect 7 0 8 0;
#P connect 7 0 2 0;
#P connect 9 0 6 0;
#P connect 8 0 9 0;
#P connect 5 0 2 0;
#P connect 3 1 2 0;
#P connect 3 0 2 0;
#P hidden connect 6 0 0 0;
#P hidden connect 1 0 0 0;
#P window clipboard copycount 12;

Info~ can tell you the length of the buffer~ after it finishes reading.

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

> From: tedor
> Organization: Cycling ’74
> Reply-To:
> Date: Fri, 11 Apr 2008 19:43:36 +0200
> To:

> Subject: [maxmsp] Re: Record into a buffer without knowing how long it is
> going to be
>
>
> this is how I approached it, might helps..
>
> All the best,
>
> max v2;
> #N vpatcher 14 59 1050 800;
> #P user ezdac~ 35 37 79 70 0;
> #P window setfont "Sans Serif" 9.;
> #N vpatcher 412 44 1068 737;
> #N comlet signal end;
> #P outlet 557 511 15 0;
> #P window setfont "Sans Serif" 9.;
> #P newex 347 39 48 196617 loadbang;
> #P newex 507 78 38 196617 r vol1;
> #P flonum 507 108 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window linecount 1;
> #P newex 398 411 93 196617 scale 0. 1. 0. 0.17;
> #P window linecount 0;
> #P newex 240 411 93 196617 scale 0. 1. 0. 0.17;
> #P window linecount 1;
> #P message 311 116 17 196617 1.;
> #P window linecount 0;
> #P message 261 118 17 196617 1.;
> #P window linecount 1;
> #P newex 146 74 59 196617 r bangpan1;
> #P window linecount 0;
> #P newex 240 25 49 196617 r evorod;
> #P window linecount 1;
> #P message 290 115 17 196617 0.;
> #P window linecount 0;
> #P message 240 118 17 196617 0.;
> #P button 276 86 15 0;
> #P button 240 87 15 0;
> #P window linecount 1;
> #P newex 240 66 46 196617 select 1;
> #P toggle 240 49 15 0;
> #P outlet 367 515 15 0;
> #P outlet 208 516 15 0;
> #P inlet 2 78 15 0;
> #P newex 321 439 41 196617 * 127.;
> #P user hslider 321 471 18 102 128 1 0 0;
> #P newex 398 344 79 196617 scale 1. 0.;
> #P flonum 398 378 35 9 0. 1.2 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 367 440 41 196617 *~ 0.2;
> #P newex 162 440 41 196617 * 127.;
> #P user hslider 162 472 17 95 128 1 0 0;
> #P newex 240 247 62 196617 prepend set;
> #P message 240 272 79 196617 0. , 1. 5000;
> #P flonum 264 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 288 174 39 196617 r dur1;
> #P flonum 240 172 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 240 198 58 196617 pak 0. 0. 0;
> #P message 240 225 65 196617 $1 \, $2 $3;
> #P newex 240 296 50 196617 line 0. 1.;
> #P flonum 240 379 35 9 0. 1.2 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 209 439 41 196617 *~ 0.2;
> #P window linecount 0;
> #P comment 309 650 100 196617 Thank you Richard:);
> #P comment 549 109 100 196617 Adjust volume;
> #P connect 3 0 13 0;
> #P connect 13 0 12 0;
> #P connect 2 0 20 0;
> #P connect 19 0 2 0;
> #P connect 28 0 22 0;
> #P connect 22 0 23 0;
> #P connect 23 0 24 0;
> #P connect 36 0 24 0;
> #P connect 24 0 26 0;
> #P connect 31 0 7 0;
> #P connect 26 0 7 0;
> #P lcolor 4;
> #P connect 7 0 6 0;
> #P connect 6 0 5 0;
> #P connect 5 0 11 0;
> #P connect 29 0 10 0;
> #P connect 11 0 10 0;
> #P connect 10 0 4 0;
> #P connect 4 0 3 0;
> #P connect 3 0 32 0;
> #P connect 32 0 2 1;
> #P connect 24 0 30 0;
> #P connect 30 0 9 0;
> #P connect 27 0 9 0;
> #P lcolor 4;
> #P connect 9 0 6 1;
> #P connect 23 1 25 0;
> #P connect 8 0 6 2;
> #P connect 25 0 27 0;
> #P connect 34 0 32 4;
> #P connect 25 0 31 0;
> #P connect 15 0 18 0;
> #P connect 18 0 17 0;
> #P connect 19 0 14 0;
> #P connect 14 0 21 0;
> #P connect 4 0 16 0;
> #P connect 16 0 15 0;
> #P connect 15 0 33 0;
> #P connect 33 0 14 1;
> #P connect 34 0 33 4;
> #P connect 35 0 34 0;
> #P fasten 4 1 37 0 285 322 562 322;
> #P pop;
> #P newobj 546 271 51 196617 p panning;
> #P newex 546 332 51 196617 dac~;
> #P message 655 247 208 196617 note 5000 0 593 0. 0.17 seq01;
> #P newex 655 226 62 196617 prepend set;
> #P newex 546 183 32 196617 t b l;
> #P newex 546 206 145 196617 pack note 0 0 0 0. 0.25 seq01;
> #P newex 546 238 104 196617 poly~ play+gizmo~ 8;
> #P window linecount 2;
> #P comment 720 219 100 196617 message sent to poly~;
> #P user panel 540 178 328 177;
> #X brgb 237 244 185;
> #X frgb 0 0 0;
> #X border 1;
> #X rounded 13;
> #X shadow 0;
> #X done;
> #P window linecount 1;
> #P newex 220 154 40 196617 key;
> #B color 5;
> #P newex 220 176 52 196617 select 49;
> #P newex 221 624 59 196617 s bangpan1;
> #P number 268 561 74 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 318 455 33 196617 stop;
> #P comment 290 457 24 196617 stop;
> #P button 268 456 15 0;
> #P newex 268 525 58 196617 clocker 10;
> #B color 5;
> #P number 371 126 50 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P button 316 79 13 0;
> #P number 316 127 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #N vpatcher 539 44 1057 540;
> #P button 68 25 15 0;
> #P window setfont "Sans Serif" 9.;
> #P newex 317 215 39 196617 s dur1;
> #N comlet muliply lenght by x;
> #P outlet 251 461 15 0;
> #N comlet set length to;
> #P inlet 251 37 15 0;
> #P flonum 251 186 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 113 93 88 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P outlet 85 94 15 0;
> #N comlet buffer info;
> #P inlet 7 25 15 0;
> #P newex 7 55 105 196617 info~ seq01;
> #P connect 1 0 0 0;
> #P connect 8 0 0 0;
> #P connect 0 6 2 0;
> #P connect 0 6 3 0;
> #P connect 5 0 4 0;
> #P connect 4 0 6 0;
> #P connect 4 0 7 0;
> #P pop 1;
> #P newobj 316 103 65 196617 p seq01 info;
> #P comment 398 66 34 196617 odd;
> #P message 396 83 40 196617 15000;
> #P message 355 83 34 196617 5000;
> #P number 354 316 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 316 298 68 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P hidden button 240 219 15 0;
> #P comment 246 244 82 196617 bang the sound;
> #P comment 346 336 43 196617 volume;
> #P comment 228 317 125 196617 semitones higher or lower;
> #P comment 390 300 30 196617 end;
> #P comment 352 280 32 196617 start;
> #P flonum 392 334 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P button 220 238 19 0;
> #P message 240 412 116 196617 5000 0 593 0 0.17;
> #P newex 240 388 62 196617 prepend set;
> #P newex 240 365 90 196617 pack 0 0 0 0 0.17;
> #P number 278 279 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 240 260 74 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P comment 316 261 38 196617 lenght;
> #P window setfont "Sans Serif" 14.;
> #P comment 241 342 53 196622 seq01;
> #P window setfont "Sans Serif" 9.;
> #P comment 355 66 34 196617 even;
> #P comment 278 508 92 196617 TEST THE LENGHT;
> #P user panel 255 446 129 146;
> #X brgb 191 191 191;
> #X frgb 0 0 0;
> #X border 1;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P toggle 32 210 15 0;
> #P message 106 190 75 196617 read rec01.aif;
> #P message 57 210 75 196617 open rec01.aif;
> #P window setfont "Sans Serif" 12.;
> #P comment 103 145 72 196620 SOUND 1;
> #P window setfont "Sans Serif" 9.;
> #P newex 64 227 29 196617 adc~;
> #P newex 32 250 55 196617 sfrecord~;
> #P message 30 148 41 196617 replace;
> #P newex 30 189 74 196617 buffer~ seq01;
> #P user panel 26 142 166 130;
> #X brgb 191 191 191;
> #X frgb 0 0 0;
> #X border 1;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P comment 213 81 100 196617 bang to get length;
> #P comment 590 417 100 196617 stops clocke;
> #P hidden connect 4 0 3 0;
> #P hidden connect 9 0 3 0;
> #P connect 6 0 5 0;
> #P connect 6 1 5 0;
> #P connect 8 0 5 0;
> #P connect 10 0 5 0;
> #P connect 45 0 44 0;
> #P fasten 30 0 21 0 359 334 205 334 205 234 225 234;
> #P connect 44 0 21 0;
> #P connect 21 0 43 0;
> #P hidden fasten 22 0 28 0 397 354 431 354 431 197 245 197;
> #P hidden fasten 29 0 28 0 321 340 214 340 214 197 245 197;
> #P hidden fasten 17 0 28 0 283 340 213 340 213 196 245 196;
> #P connect 37 0 16 0;
> #P lcolor 7;
> #P hidden connect 28 0 16 0;
> #P hidden connect 16 0 18 0;
> #P connect 18 0 19 0;
> #P fasten 21 0 20 0 225 408 245 408;
> #P connect 19 0 20 0;
> #P hidden connect 17 0 18 1;
> #P fasten 21 0 39 0 133 400;
> #P connect 39 0 38 0;
> #P fasten 41 0 38 0 323 484 273 484;
> #P connect 38 0 42 0;
> #P hidden connect 29 0 18 2;
> #P hidden connect 30 0 18 3;
> #P connect 36 0 34 0;
> #P connect 34 0 35 0;
> #P connect 35 0 29 0;
> #P lcolor 7;
> #P fasten 54 2 41 0 742 380;
> #P hidden connect 22 0 18 4;
> #P connect 32 0 34 1;
> #P connect 31 0 34 1;
> #P connect 34 1 37 0;
> #P fasten 20 0 50 0 245 434 520 434 520 153 551 153;
> #P connect 50 0 49 0;
> #P connect 49 0 48 0;
> #P connect 48 0 54 0;
> #P connect 54 0 53 0;
> #P connect 50 1 49 1;
> #P connect 54 1 53 1;
> #P connect 49 0 51 0;
> #P connect 51 0 52 0;
> #P pop;
>


April 11, 2008 | 6:50 pm

This is better I think. Read seems to use the old buffer length while
replace changes to fit the new file.

#P user gain~ 154 380 27 42 158 0 1.071519 7.94321 10.;
#P button 156 247 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 155 350 65 196617 play~ seq01;
#P message 156 298 53 196617 $1 , $2 $2;
#P newex 155 322 32 196617 line~;
#P newex 156 272 48 196617 pack 0 0;
#P number 156 216 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 116 181 105 196617 info~ seq01;
#P newex 7 337 50 196617 del 1000;
#P newex 8 305 32 196617 sel 0;
#P user ezdac~ 154 466 198 499 0;
#P toggle 51 217 15 0;
#P message 101 132 88 196617 replace rec01.aif;
#P message 72 240 75 196617 open rec01.aif;
#P window setfont "Sans Serif" 12.;
#P comment 124 109 72 196620 SOUND 1;
#P window setfont "Sans Serif" 9.;
#P newex 93 265 29 196617 adc~;
#P newex 48 305 55 196617 sfrecord~;
#P newex 51 153 74 196617 buffer~ seq01;
#P connect 17 0 7 0;
#P connect 17 0 7 1;
#P connect 10 6 11 0;
#P connect 10 6 12 1;
#P connect 15 0 17 0;
#P connect 16 0 12 0;
#P connect 12 0 14 0;
#P connect 13 0 15 0;
#P connect 14 0 13 0;
#P hidden connect 5 0 0 0;
#P connect 2 0 1 0;
#P connect 2 1 1 0;
#P connect 4 0 1 0;
#P connect 8 0 9 0;
#P connect 9 0 5 0;
#P connect 6 0 1 0;
#P connect 6 0 8 0;
#P connect 0 1 10 0;
#P window clipboard copycount 18;

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


April 11, 2008 | 9:55 pm

It is also possible to resize a buffer~ on the fly by using the waveform~ object to select the appropriate part and sending it the crop command. Just make sure your buffer~ size to begin with is well above the length of the material you want to record.

To determine the length you would still use clocker.

Hope that helps…

Stefan


April 11, 2008 | 11:46 pm

>This is better I think. Read seems to use the old buffer length while
replace changes to fit the new file.

This is a nice automation Gary, I am going to use it:)
thank you!
ted


April 11, 2008 | 11:55 pm

dear Gary,

I wonder whether you could give me a small explanation what the difference is between the original and your expression objects in the gizmo~ patches is.

All the best,
ted

max v2;
#N vpatcher 4 44 1280 800;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden message 921 130 14 196617 0;
#P user kslider 971 113 35 1 -24 48 19 7 0 128 128 128 128 128 128 255 255 255 0 0 0 0 0 0;
#P comment 1009 169 133 196617 transposition in semitones;
#P flonum 971 169 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 971 191 112 196617 expr pow(2.\,$f1/12);
#P comment 1114 335 52 196617 see also:;
#P message 1171 351 55 196617 hilbert~;
#P message 1114 351 55 196617 freqshift~;
#P message 1171 334 55 196617 fbinshift~;
#P hidden newex 1114 372 64 196617 prepend help;
#P user umenu 741 203 88 196647 1 64 219 1;
#X add None;
#X add Sound File;
#X add Sine Wave;
#X add Audio Input;
#P newex 855 177 60 196617 cycle~ 440;
#P newex 821 228 61 196617 selector~ 3;
#P newex 872 200 30 196617 adc~;
#P hidden newex 921 108 45 196617 loadbang;
#P message 773 319 27 196617 stop;
#P message 701 319 65 196617 startwindow;
#P comment 707 305 74 196617 • start audio;
#P user panel 689 299 123 43;
#X brgb 255 255 255;
#X frgb 100 202 30;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P newex 821 305 39 196617 *~ 0.2;
#P newex 821 355 29 196617 dac~;
#P message 838 131 55 196617 $1 , loop 1;
#P flonum 971 216 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 1008 217 102 196617 pitch scaling factor;
#P toggle 838 112 15 0;
#P message 804 112 29 196617 open;
#N sfplay~ 1 80640 0 ;
#P newobj 838 153 43 196617 sfplay~;
#P newex 821 260 160 196617 pfft~ gizmo_loadme 4096 4;
#P comment 984 262 83 196617 < - double-click;
#P user panel 812 255 271 27;
#X brgb 255 255 255;
#X frgb 255 232 43;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 723 188 102 196617 • choose audio input;
#P window linecount 3;
#P comment 900 331 166 196617 For more detailed information see the Proceedings of the 2002 ICMC , Goteborg , Sweden , pp. 126-129.;
#P comment 935 287 225 196617 Note: a minimum overlap of 4 must be used to avoid undesirable amplitude modulation artefacts when transposing;
#P window linecount 1;
#P comment 1069 148 100 196617 ^ no transposition;
#P newex 287 342 23 196617 abs;
#P window linecount 4;
#P newex 354 229 85 196617 expr ((440. * exp(.057762265 * $f1))* 0.002273);
#P window linecount 2;
#P comment 235 119 59 196617 end sample in ms;
#P window linecount 1;
#N out~ 1;
#P newobj 63 534 39 196617 out~ 1;
#P newex 23 457 21 196617 t 0;
#P newex 63 497 35 196617 *~ 1.;
#P newex 627 178 22 196617 b 1;
#P newex 504 426 48 196617 loadbang;
#P window setfont "Fixedwidth Serif" 10.;
#P message 560 460 62 1441802 mute 1 , 0;
#P message 627 460 63 1441802 mute 0 , 1;
#P newex 560 491 65 1441802 thispoly~;
#P window setfont "Sans Serif" 9.;
#P newex 63 154 499 196617 unpack 0. 0 0 0. 0. sample;
#N in 1;
#P newobj 63 21 25 196617 in 1;
#P newex 547 246 62 196617 prepend set;
#P newex 266 416 29 196617 * 1.;
#P newex 287 222 48 196617 pack 0 0;
#P newex 63 453 135 196617 pfft~ gizmo_loadme 4096 4;
#P newex 266 377 31 196617 / 1.;
#P message 63 313 56 196617 $2 , $3 $1;
#P newex 63 284 57 196617 pack 0 0 0;
#P newex 287 261 30 196617 !-;
#P newex 63 415 82 196617 play~ $0sample;
#P newex 63 334 32 196617 line~;
#P window linecount 2;
#P comment 74 118 61 196617 play dur in ms;
#P window linecount 3;
#P comment 326 113 67 196617 transposition interval in semitones;
#P window linecount 2;
#P comment 144 119 65 196617 start sample in ms;
#P window linecount 1;
#P comment 430 128 53 196617 amplitude;
#P window linecount 2;
#P comment 542 121 42 196617 buffer name;
#P window linecount 1;
#P comment 116 219 100 196617 convert duration ms;
#P window linecount 2;
#P comment 369 194 50 196617 interval to ratio;
#P window linecount 4;
#P comment 299 286 52 196617 end-start for play sample dur;
#P window linecount 3;
#P comment 302 413 69 196617 final transposition ratio;
#P window linecount 2;
#P comment 497 458 49 196617 mute at birth;
#P user panel 335 196 128 128;
#X brgb 227 88 88;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 955 172 166 49;
#X brgb 255 49 9;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 12 1 30 0 90 355 28 355;
#P connect 22 0 23 0;
#P connect 23 0 15 0;
#P connect 15 0 16 0;
#P connect 16 0 12 0;
#P fasten 21 0 13 0 552 400 68 400;
#P connect 12 0 13 0;
#P connect 13 0 18 0;
#P connect 18 0 29 0;
#P connect 29 0 31 0;
#P fasten 19 0 15 1 292 250 91 250;
#P fasten 30 0 29 1 28 480 93 480;
#P fasten 23 4 29 1 456 480 93 480;
#P fasten 20 0 18 1 271 442 193 442;
#P fasten 23 0 17 0 68 244 271 244;
#P connect 17 0 20 0;
#P fasten 33 0 20 1 359 407 290 407;
#P fasten 23 1 19 0 165 210 292 210;
#P connect 19 0 14 0;
#P connect 14 0 34 0;
#P connect 34 0 17 1;
#P fasten 23 2 19 1 262 204 330 204;
#P fasten 23 3 33 0 359 219 359 219;
#P connect 23 5 21 0;
#P connect 27 0 26 0;
#P fasten 12 1 26 0 90 366 565 366;
#P fasten 26 0 24 0 565 478 565 478;
#P fasten 25 0 24 0 632 484 565 484;
#P fasten 22 0 28 0 68 104 632 104;
#P connect 28 0 25 0;
#P fasten 58 0 56 0 746 223 826 223;
#P connect 56 0 41 0;
#P connect 41 0 49 0;
#P connect 49 0 48 0;
#P fasten 53 0 48 0 778 347 826 347;
#P fasten 52 0 48 0 706 347 826 347;
#P connect 44 0 47 0;
#P connect 43 0 42 0;
#P connect 47 0 42 0;
#P connect 42 0 56 1;
#P connect 49 0 48 1;
#P connect 57 0 56 2;
#P connect 55 0 56 3;
#P hidden connect 54 0 68 0;
#P hidden connect 68 0 67 0;
#P connect 67 0 65 0;
#P connect 65 0 64 0;
#P connect 64 0 46 0;
#P connect 46 0 41 1;
#P hidden connect 60 0 59 0;
#P hidden connect 62 0 59 0;
#P hidden connect 61 0 59 0;
#P pop;


Viewing 20 posts - 1 through 20 (of 20 total)