max v2; #N vpatcher 106 44 1440 843; #P window setfont "Sans Serif" 9.; #P window linecount 3; #P comment 129 131 237 196617 Choose the soundfile and find out its length. The right outlet of the buffer~ object sends a bang when it's finished loading the sample.; #P toggle 423 545 15 0; #P window linecount 1; #P newex 423 565 29 196617 gate; #P newex 423 598 130 196617 if $f1>0.99 then out1 bang; #P flonum 468 553 45 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 442 524 64 196617 snapshot~ 1; #P window linecount 7; #P comment 1073 186 199 196617 5. This number is then used to find the beginning and end times to be played back by the groove~ object. So \, if we want to play beat 3 \, the sample should start at beattime*3 and finish at beattime*4. These values are then passed on to groove~; #P window linecount 3; #P comment 1073 148 199 196617 4. Then a number is chosen from the range 1-beattime to decide which beat will be played - beat 1 \, 2 \, 3 \, etc.; #P window linecount 4; #P comment 1073 98 199 196617 3. The buffer size is then divided by an arbitrary number determining the number of beats. This number is stored as a variable called 'beattime'.; #P window linecount 2; #P comment 1073 71 199 196617 2. Banging info~ tells us the sample rate and buffer size.; #P button 819 158 15 0; #P number 807 207 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P toggle 220 227 15 0; #P button 19 598 15 0; #P hidden button 10 625 15 0; #P window linecount 1; #P message 36 598 100 196617 10 4 2007 15 1 4; #P window linecount 2; #P hidden message 27 646 241 196617 MacBook:/Users/Rich/Documents/Documentation/MaxMSP/Tasks/BBCutMax/BBCutMax01.txt; #P window linecount 1; #N vpatcher 13 59 631 604; #P outlet 211 364 15 0; #P window setfont "Sans Serif" 9.; #P newex 30 133 62 196617 prepend set; #P inlet 105 86 15 0; #P outlet 17 366 15 0; #P inlet 20 86 15 0; #P newex 17 312 62 196617 prepend set; #P comment 318 248 12 196617 :; #P comment 252 248 12 196617 :; #P newex 340 224 60 196617 prepend set; #P message 340 248 33 196617 4; #P comment 339 264 35 196617 second; #P newex 276 224 60 196617 prepend set; #P message 276 248 33 196617 1; #P comment 275 264 35 196617 minute; #P newex 212 225 60 196617 prepend set; #P message 212 248 33 196617 15; #P comment 211 265 35 196617 hour; #P newex 148 225 60 196617 prepend set; #P message 148 248 33 196617 2007; #P comment 147 265 35 196617 year; #P newex 84 226 60 196617 prepend set; #P message 84 248 33 196617 4; #P comment 83 266 35 196617 day; #P newex 20 226 60 196617 prepend set; #P message 20 248 33 196617 10; #P newex 20 196 332 196617 unpack 1 1 2000 0 0 0; #P newex 20 173 44 196617 filedate; #B color 14; #P newex 20 109 54 196617 opendialog; #P comment 19 266 35 196617 month; #P comment 124 248 12 196617 \,; #P newex 190 101 53 196617 closebang; #P window setfont "American Typewriter" 18.; #P comment 27 422 112 199491602 Date Stamp; #P window setfont "Sans Serif" 9.; #P comment 27 460 100 196617 v 0.01; #P comment 27 475 100 196617 rhoadley.net; #P fasten 7 0 28 0 25 193 14 193 14 305 22 305; #P connect 28 0 30 0; #P connect 29 0 6 0; #P connect 6 0 7 0; #P fasten 31 0 7 0 110 162 25 162; #P connect 7 0 8 0; #P connect 8 0 10 0; #P connect 10 0 9 0; #P fasten 6 0 32 0 25 131 35 131; #P connect 8 1 13 0; #P connect 13 0 12 0; #P connect 8 2 16 0; #P connect 16 0 15 0; #P fasten 32 0 33 0 35 167 9 167 9 346 216 346; #P connect 8 3 19 0; #P connect 19 0 18 0; #P connect 8 4 22 0; #P connect 22 0 21 0; #P connect 8 5 25 0; #P connect 25 0 24 0; #P pop; #P hidden newobj 26 620 64 196617 p datestamp; #P comment 36 581 100 196617 v 0.02; #P window setfont "American Typewriter" 18.; #P comment 32 557 222 199491602 BBCutMax01; #P window setfont "Sans Serif" 9.; #P newex 784 364 40 196617 + 0.01; #P flonum 901 341 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P flonum 855 488 50 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 855 461 29 196617 * 0.; #P newex 855 432 58 196617 v beattime; #P flonum 856 388 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 856 364 27 196617 + 1.; #P flonum 856 342 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 784 342 29 196617 * 0.; #P newex 856 311 52 196617 random 7; #P button 784 268 15 0; #P newex 784 311 58 196617 v beattime; #P newex 807 181 58 196617 v beattime; #P flonum 824 39 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 807 137 27 196617 / 8.; #P flonum 335 564 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 304 586 41 196617 *~ 0.2; #P window linecount 2; #P comment 240 228 122 196617 click to (de)activate groove~; #P window linecount 1; #P message 381 266 23 196617 0.5; #P message 381 247 23 196617 1.; #P flonum 381 285 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P toggle 458 333 15 0; #P message 458 352 68 196617 loopinterp \$1; #P message 268 313 65 196617 set mybuff2; #P message 268 373 49 196617 startloop; #P message 268 347 27 196617 stop; #P toggle 409 333 15 0; #P message 409 352 41 196617 loop \$1; #P flonum 441 382 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P flonum 402 382 50 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P toggle 363 270 15 0; #P newex 363 311 27 196617 sig~; #P newex 363 401 89 196617 groove~ bbcut; #B color 5; #P comment 427 317 81 196617 turn loop on/off; #P comment 240 297 112 196617 change working buffer; #P window linecount 5; #P comment 456 402 131 196617 The object itself - note that bbcut is the buffer initially being read \, but that this can be changed with a 'set' message (see left).; #P window linecount 3; #P comment 424 256 47 196617 control playback rate; #P flonum 388 109 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 2; #P comment 387 129 68 196617 sampling rate of the file; #P button 366 80 15 0; #P flonum 466 109 75 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 466 129 58 196617 total buffer time (ms); #P user ezdac~ 289 631 333 664 0; #P window linecount 1; #P newex 388 79 105 196617 info~ bbcut; #P message 265 47 115 196617 replace tlonbeat_m.aiff; #P message 142 47 118 196617 replace sandbeat_m.aiff; #P newex 142 79 71 196617 buffer~ bbcut; #P window linecount 3; #P comment 848 135 100 196617 divide by the number of beats in the sample; #P comment 878 264 100 196617 <<< choose one of the devisions to play back; #P window linecount 2; #P comment 1073 44 199 196617 1. Fill the buffers with samples. Replacing ensures that the buffers are full up.; #P window linecount 4; #P comment 588 558 100 196617 this decides whether to change the chosen loop each time around; #P user panel 124 32 451 141; #X brgb 191 191 191; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P user panel 736 32 250 220; #X brgb 191 191 191; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P user panel 736 258 250 261; #X brgb 191 191 191; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P user panel 206 204 392 274; #X brgb 191 191 191; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P user panel 404 501 295 126; #X brgb 191 191 191; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P user panel 280 552 102 127; #X brgb 191 191 191; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P hidden connect 62 0 59 0; #P hidden fasten 59 1 60 0 85 641 32 641; #P hidden connect 63 0 60 0; #P hidden fasten 59 0 61 0 31 658 30 658 30 596 41 596; #P hidden fasten 60 0 59 1 32 665 170 665 170 621 85 621; #P fasten 12 0 10 0 270 70 147 70; #P connect 11 0 10 0; #P fasten 64 0 32 0 225 368 273 368; #P fasten 40 0 14 0 309 614 294 614; #P fasten 24 0 40 0 368 528 309 528; #P fasten 40 0 14 1 309 614 328 614; #P connect 41 0 40 1; #P fasten 64 0 26 0 225 253 368 253; #P connect 26 0 25 0; #P fasten 36 0 25 0 386 307 368 307; #P fasten 37 0 25 0 386 309 368 309; #P fasten 38 0 25 0 386 307 368 307; #P connect 25 0 24 0; #P fasten 32 0 24 0 273 394 368 394; #P fasten 31 0 24 0 273 369 368 369; #P fasten 29 0 24 0 414 378 368 378; #P fasten 33 0 24 0 273 338 368 338; #P fasten 34 0 24 0 463 374 368 374; #P fasten 43 0 17 0 829 68 371 68; #P fasten 10 1 17 0 208 106 352 106 352 73 371 73; #P fasten 17 0 13 0 371 100 383 100 383 73 393 73; #P connect 13 0 19 0; #P fasten 56 0 27 0 789 387 656 387 656 370 407 370; #P connect 27 0 24 1; #P fasten 64 0 30 0 225 305 414 305; #P connect 30 0 29 0; #P connect 75 0 74 0; #P connect 74 0 73 0; #P fasten 53 0 28 0 860 483 740 483 740 373 446 373; #P connect 28 0 24 2; #P connect 24 1 71 0; #P connect 71 0 74 1; #P connect 35 0 34 0; #P connect 13 6 16 0; #P fasten 71 0 72 0 447 547 473 547; #P fasten 42 0 46 0 812 163 789 163; #P fasten 73 0 46 0 428 618 764 618 764 262 789 262; #P connect 46 0 45 0; #P connect 45 0 48 0; #P connect 48 0 56 0; #P fasten 47 0 48 1 861 337 808 337; #P fasten 16 0 42 0 471 129 812 129; #P connect 42 0 44 0; #P connect 66 0 44 0; #P connect 44 0 65 0; #P fasten 43 0 66 0 829 106 824 106; #P connect 43 0 42 1; #P fasten 46 0 52 0 789 304 772 304 772 425 860 425; #P connect 52 0 53 0; #P connect 53 0 54 0; #P fasten 46 0 47 0 789 304 861 304; #P connect 47 0 49 0; #P connect 49 0 50 0; #P connect 50 0 51 0; #P fasten 55 0 50 1 906 361 878 361; #P fasten 51 0 53 1 861 421 844 421 844 452 879 452; #P fasten 43 0 47 1 829 68 903 68 903 241 903 241; #P pop;