streaming waveform display

Jan 25, 2007 at 6:44pm

streaming waveform display

Hi all,

is there a way to get a waveform display from a file without loading the
file into a buffer~?

I’m building a perform.patch that uses a crossfading file looper for samples
in the 30-300 second range, and it would helpful to have a display so taht
you can ‘trim silence’, since a lot of the files have a long reverb tail
that i don’t want to remove from the original. however, since i want to
have many of these files playing at once it’s best to use HD streaming
rather than buffers.

Regards,
George

#29940
Jan 25, 2007 at 8:06pm

i would guess that if you want to visualise a whole file with sample accuracy, you are essentially holding that file in RAM anyway, so it would be buffered somewhere . it may as well be in a buffer~ object. not sure how programs like logic or ableton do it from disk. maybe they load up only the part you can see to RAM or its at reduced resolution…

#94530
Jan 27, 2007 at 3:38pm

bin ray wrote:
> not sure how programs like logic or ableton do it from disk. maybe
> they load up only the part you can see or its at reduced
> resolution…

All disk based sample editors I know create a seperate overview file
which has a reduced resolution. In the moment you zoom in, they would
get the real data from disk, you can’t display more than the number of
pixels of your screen in sample accuracy and thats not much…

There was an example of how to create an overview and load it into a
buffer quite a while ago, the archives might still contain it…

As I remeber it was just playing the file with a 50-times speed with
sfplay, and record it into a buffer~, which was displayed with waveform~…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#94531
Jan 27, 2007 at 4:27pm

>
> There was an example of how to create an overview and load it into
> a buffer quite a while ago, the archives might still contain it…

I have 2 patches from the list which might be relevant – I’ll post
one in this mail, and follow up with the other. I’m afraid I can’t
attribute the creators of these patches as I didn’t keep a note of them

David

max v2;
#N vpatcher 29 81 578 209;
#P origin 90 29;
#P window setfont “Sans Serif” 10.;
#P hidden newex 536 -7 168 196618 autopattr copybfrs @autoname 1;
#X prestore flonum 1 0 0.;
#X prestore flonum[1] 1 0 10.;
#X prestore flonum[2] 1 0 1.;
#X prestore flonum[3] 1 0 0.;
#X prestore flonum[4] 1 0 10.;
#X prestore flonum[5] 1 0 1.;
#X prestore ubumenu[1] 1 0 one;
#X prestore ubumenu[2] 1 0 two;
#X prestore ubumenu[3] 1 0 four;
#X prestore ubumenu[5] 1 0 one;
#X prestore ubumenu[6] 1 0 three;
#P objectname copybfrs;
#P hidden newex 268 500 30 196618 * 1.;
#P objectname *[5];
#P flonum 210 80 35 10 0. 2. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[5];
#P hidden newex 326 165 51 196618 * 1000.;
#P objectname *[4];
#P hidden newex 253 165 51 196618 * 1000.;
#P objectname *[3];
#P user ubumenu 151 80 50 196618 0 1 1 0;
#X add one;
#X add two;
#X add three;
#X add four;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P objectname ubumenu[6];
#P hidden newex 286 530 66 196618 prepend set;
#P user ubumenu 69 80 50 196618 0 1 1 0;
#X add one;
#X add two;
#X add three;
#X add four;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P objectname ubumenu[5];
#P hidden newex 205 392 66 196618 prepend set;
#P flonum 324 81 46 10 0. 0 65 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[4];
#P flonum 266 80 46 10 0. 0 65 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[3];
#P hidden newex 208 203 30 196618 t i b;
#P hidden button 445 296 15 0;
#P hidden message 430 321 34 196618 set 0;
#P hidden newex 293 379 27 196618 + 0;
#P objectname +[4];
#P hidden newex 465 319 34 196618 t 0 0;
#P hidden newex 373 328 30 196618 t b i;
#P hidden newex 388 360 42 196618 bucket;
#P hidden newex 373 391 40 196618 accum;
#P hidden newex 232 530 46 196618 pack f f;
#P hidden newex 232 557 68 196618 peek~ three;
#P hidden newex 222 465 27 196618 + 0;
#P objectname +[3];
#P hidden newex 268 455 58 196618 peek~ one;
#P hidden newex 256 262 32 196618 t b b;
#P hidden newex 256 233 48 196618 select 0;
#P hidden newex 326 204 70 196618 mstosamps~;
#P hidden newex 253 204 70 196618 mstosamps~;
#P hidden newex 259 293 27 196618 int;
#P hidden newex 259 320 53 196618 tl.uzi;
#P window setfont “Sans Serif” 12.;
#P user ubumenu 381 80 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 buffer;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P objectname ubumenu[4];
#P window setfont “Sans Serif” 10.;
#P hidden newex 337 237 27 196618 !-;
#P comment 316 63 69 196618 duration (s);
#B color 5;
#P comment 263 63 54 196618 start (s);
#B color 5;
#P comment 206 63 56 196618 “gain”;
#B color 5;
#P window setfont “Sans Serif” 14.;
#P comment 117 76 39 196622 =>>;
#B color 5;
#P window setfont “Sans Serif” 10.;
#P hidden newex 587 449 30 196618 * 1.;
#P objectname *[2];
#P flonum 211 23 35 10 0. 2. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[2];
#P hidden newex 645 114 51 196618 * 1000.;
#P objectname *[1];
#P hidden newex 572 114 51 196618 * 1000.;
#P objectname *;
#P user ubumenu 152 23 50 196618 0 1 1 0;
#X add one;
#X add two;
#X add three;
#X add four;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P objectname ubumenu[3];
#P hidden newex 605 479 66 196618 prepend set;
#P user ubumenu 68 23 50 196618 0 1 1 0;
#X add one;
#X add two;
#X add three;
#X add four;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P objectname ubumenu[2];
#P hidden newex 751 342 66 196618 prepend set;
#P user ubumenu 6 23 50 196618 0 1 1 0;
#X add one;
#X add two;
#X add three;
#X add four;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P objectname ubumenu[1];
#P hidden newex 524 341 66 196618 prepend set;
#P flonum 325 24 46 10 0. 0 65 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[1];
#P flonum 267 23 46 10 0. 0 65 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum;
#P hidden newex 527 152 30 196618 t i b;
#P hidden button 764 245 15 0;
#P hidden newex 597 414 31 196618 + 0.;
#P objectname +[2];
#P hidden newex 637 379 59 196618 peek~ two;
#P hidden message 749 270 34 196618 set 0;
#P hidden newex 612 328 27 196618 + 0;
#P objectname +[1];
#P hidden newex 784 268 34 196618 t 0 0;
#P hidden newex 692 277 30 196618 t b i;
#P hidden newex 707 309 42 196618 bucket;
#P hidden newex 692 340 40 196618 accum;
#P hidden newex 551 479 46 196618 pack f f;
#P hidden newex 551 506 68 196618 peek~ three;
#P hidden newex 541 414 27 196618 + 0;
#P objectname +;
#P hidden newex 576 379 58 196618 peek~ one;
#P hidden newex 575 211 32 196618 t b b;
#P hidden newex 575 182 48 196618 select 0;
#P hidden newex 645 153 70 196618 mstosamps~;
#P hidden newex 572 153 70 196618 mstosamps~;
#P hidden newex 578 242 27 196618 int;
#P hidden newex 578 269 53 196618 tl.uzi;
#P window setfont “Sans Serif” 12.;
#P user ubumenu 382 23 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 merge buffers;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P objectname ubumenu;
#P window setfont “Sans Serif” 10.;
#P hidden newex 656 186 27 196618 !-;
#P comment 317 6 69 196618 duration (s);
#B color 5;
#P comment 264 6 54 196618 start (s);
#B color 5;
#P comment 207 6 56 196618 “gain”;
#B color 5;
#P window setfont “Sans Serif” 14.;
#P comment 54 19 19 196622 +;
#B color 5;
#P comment 118 19 39 196622 =>>;
#B color 5;
#P user panel -4 55 581 58;
#X brgb 91 91 91;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel -4 -2 581 58;
#X brgb 91 91 91;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden fasten 68 1 67 0 94 97 194 97 194 346 210 346;
#P hidden fasten 46 0 64 0 386 97 194 97 194 168 213 168;
#P hidden fasten 47 2 54 0 292 346 227 346;
#P hidden fasten 54 0 56 0 227 498 237 498;
#P hidden fasten 69 0 55 0 291 551 237 551;
#P hidden connect 56 0 55 0;
#P hidden fasten 57 0 54 1 378 422 244 422;
#P hidden fasten 65 0 71 0 271 97 194 97 194 157 258 157;
#P hidden connect 71 0 49 0;
#P hidden fasten 64 0 51 0 213 232 261 232;
#P hidden connect 51 0 52 0;
#P hidden fasten 52 1 48 0 283 285 264 285;
#P hidden connect 48 0 47 0;
#P hidden fasten 67 0 53 0 210 416 273 416;
#P hidden fasten 61 0 53 0 298 414 273 414;
#P hidden connect 53 0 74 0;
#P hidden connect 74 0 56 1;
#P hidden fasten 45 0 48 1 342 291 281 291;
#P hidden fasten 70 1 69 0 176 97 194 97 194 494 291 494;
#P hidden fasten 73 0 74 1 215 97 194 97 194 494 293 494;
#P hidden fasten 47 2 61 0 292 359 298 359;
#P hidden fasten 49 1 61 1 318 232 323 232 323 373 315 373;
#P hidden fasten 66 0 72 0 329 97 194 97 194 157 331 157;
#P hidden connect 72 0 50 0;
#P hidden fasten 49 1 45 0 318 232 342 232;
#P hidden fasten 50 1 45 1 391 232 359 232;
#P hidden fasten 48 0 59 0 264 316 378 316;
#P hidden connect 59 0 57 0;
#P hidden fasten 62 0 57 0 435 384 378 384;
#P hidden fasten 75 1 46 0 593 54 386 54;
#P hidden fasten 75 1 8 0 593 17 387 17;
#P hidden fasten 59 1 58 0 398 353 393 353;
#P hidden fasten 60 0 58 0 470 347 393 347;
#P hidden fasten 60 1 58 0 494 347 393 347;
#P hidden connect 58 0 57 1;
#P hidden connect 63 0 62 0;
#P hidden fasten 64 1 63 0 233 232 450 232;
#P hidden connect 63 0 60 0;
#P hidden fasten 32 1 31 0 31 48 516 48 516 297 529 297;
#P hidden fasten 8 0 28 0 387 48 516 48 516 119 532 119;
#P hidden fasten 9 2 16 0 611 295 546 295;
#P hidden fasten 16 0 18 0 546 447 556 447;
#P hidden connect 18 0 17 0;
#P hidden fasten 35 0 17 0 610 500 556 500;
#P hidden fasten 19 0 16 1 697 371 563 371;
#P hidden fasten 29 0 37 0 272 48 516 48 516 77 577 77;
#P hidden connect 37 0 11 0;
#P hidden fasten 28 0 13 0 532 181 580 181;
#P hidden connect 13 0 14 0;
#P hidden fasten 23 0 15 0 617 363 581 363;
#P hidden fasten 31 0 15 0 529 365 581 365;
#P hidden fasten 14 1 10 0 602 234 583 234;
#P hidden connect 10 0 9 0;
#P hidden fasten 26 0 40 0 602 441 592 441;
#P hidden connect 40 0 18 1;
#P hidden fasten 7 0 10 1 661 240 600 240;
#P hidden fasten 15 0 26 0 581 403 602 403;
#P hidden fasten 36 1 35 0 177 48 516 48 516 445 610 445;
#P hidden fasten 39 0 40 1 216 48 516 48 516 420 612 420;
#P hidden fasten 9 2 23 0 611 308 617 308;
#P hidden fasten 25 0 26 1 642 402 623 402;
#P hidden fasten 11 1 23 1 637 181 642 181 642 322 634 322;
#P hidden fasten 33 0 25 0 756 363 642 363;
#P hidden fasten 23 0 25 0 617 363 642 363;
#P hidden fasten 30 0 38 0 330 48 516 48 516 77 650 77;
#P hidden connect 38 0 12 0;
#P hidden fasten 11 1 7 0 637 181 661 181;
#P hidden fasten 12 1 7 1 710 181 678 181;
#P hidden fasten 10 0 21 0 583 265 697 265;
#P hidden fasten 24 0 19 0 754 333 697 333;
#P hidden connect 21 0 19 0;
#P hidden fasten 22 1 20 0 813 296 712 296;
#P hidden fasten 22 0 20 0 789 296 712 296;
#P hidden fasten 21 1 20 0 717 302 712 302;
#P hidden connect 20 0 19 1;
#P hidden connect 27 0 24 0;
#P hidden fasten 34 1 33 0 93 48 516 48 516 310 756 310;
#P hidden fasten 28 1 27 0 552 181 769 181;
#P hidden connect 27 0 22 0;
#P pop;

#94532
Jan 27, 2007 at 4:27pm

and here’s the second one.

max v2;
#N vpatcher 221 65 763 792;
#P user ezdac~ 68 390 112 423 0;
#P button 113 53 15 0;
#P window setfont “Sans Serif” 9.;
#P comment 376 171 137 196617 sound file length in ms;
#P comment 376 199 107 196617 buffer~ size in ms;
#P newex 220 592 52 196617 change 0.;
#P user pictslider 14 480 23 76 0 0 0 0 wfknob.pct 1 wfmodes.pct 1
2146 0 0 196608 1. 1.;
#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 0 3 2 0;
#P connect 7 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 9 0;
#P connect 6 0 9 0;
#P connect 0 4 5 0;
#P connect 5 0 2 1;
#P connect 9 0 8 0;
#P connect 3 1 8 0;
#P connect 8 0 1 0;
#P pop;
#P hidden newobj 26 594 54 196617 p wfkeys;
#P flonum 139 365 39 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 139 386 38 196617 line $1;
#P newex 38 436 48 196617 loadbang;
#P number 310 170 64 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 310 198 64 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 3;
#P comment 344 292 176 196617 play the sound file at 50x the original
speed and record it in a buffer 50x smaller;
#P window linecount 1;
#P newex 220 613 32 196617 * 50.;
#P flonum 220 636 67 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 220 655 47 196617 seek $1;
#P hidden flonum 341 428 39 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0
0 0;
#P hidden newex 341 449 58 196617 prepend set;
#P newex 139 343 31 196617 gate;
#P newex 156 320 31 196617 / 50.;
#P newex 156 297 67 196617 snapshot~ 20;
#P message 326 341 18 196617 0;
#P toggle 43 216 25 0;
#N sfplay~ 1 60000 1 ;
#P newobj 74 253 101 196617 sfplay~ 1 60000 1;
#P newex 269 219 31 196617 t b l;
#P message 231 295 18 196617 1;
#P newex 269 265 52 196617 del 100;
#P message 269 196 38 196617 size $1;
#P newex 269 169 31 196617 / 50.;
#P newex 113 115 67 196617 prepend open;
#P newex 113 92 55 196617 opendialog;
#P message 113 71 36 196617 sound;
#P message 269 293 48 196617 speed 50;
#P newex 227 141 83 196617 sfinfo~;
#P user gain~ 74 282 24 73 158 0 1.071519 7.94321 10.;
#N sfplay~ 1 403200 0 ;
#P newobj 252 318 98 196617 sfplay~ 1 403200;
#P newex 252 366 101 196617 record~ waveform;
#P message 38 457 68 196617 set waveform;
#P user waveform~ 38 480 467 107 3 9;
#W mode move;
#W mouseoutput down;
#W unit ms;
#W grid 100000.;
#W ticks 0;
#W labels 0;
#W vlabels 0;
#W vticks 0;
#W bpm 0. 8.;
#W frgb 198 51 0;
#W brgb 133 147 117;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 42 42 42;
#W rgb7 100 100 100;
#P newex 290 242 134 196617 buffer~ waveform 10000;
#P comment 43 199 50 196617 play it;
#P comment 133 53 113 196617 1 – choose a sound file;
#P comment 147 682 441 196617 Mathieu Chamagne – http://
mathieu.chamagne@free.fr + http://www.maxobjects.com;
#P window setfont “Sans Serif” 14.;
#P comment 32 15 477 196622 display the waveform of a sound file
without loading it in a buffer~;
#P hidden connect 38 1 37 0;
#P connect 34 0 6 0;
#P connect 6 0 5 0;
#P fasten 35 0 5 0 144 477 43 477;
#P hidden connect 37 0 5 0;
#P connect 9 0 43 0;
#P fasten 14 0 20 0 118 235 79 235;
#P fasten 21 0 20 0 48 243 79 243;
#P fasten 28 0 20 0 225 675 6 675 6 249 79 249;
#P connect 20 0 9 0;
#P connect 9 0 43 1;
#P connect 42 0 12 0;
#P connect 12 0 13 0;
#P connect 13 0 14 0;
#P fasten 21 0 25 0 48 275 144 275;
#P connect 25 0 36 0;
#P connect 36 0 35 0;
#P fasten 20 1 23 0 117 284 161 284;
#P connect 23 0 24 0;
#P connect 24 0 25 1;
#P connect 5 2 39 0;
#P connect 39 0 30 0;
#P connect 30 0 29 0;
#P connect 29 0 28 0;
#P fasten 14 0 10 0 118 136 232 136;
#P fasten 17 0 18 0 274 289 236 289;
#P fasten 18 0 8 0 236 315 257 315;
#P fasten 11 0 8 0 274 314 257 314;
#P fasten 14 0 8 0 118 220 257 220;
#P fasten 22 0 7 0 331 362 257 362;
#P connect 8 0 7 0;
#P fasten 18 0 7 0 236 339 257 339;
#P hidden connect 26 0 5 2;
#P connect 10 3 15 0;
#P connect 15 0 16 0;
#P connect 16 0 19 0;
#P connect 19 0 17 0;
#P connect 17 0 11 0;
#P connect 19 1 4 0;
#P fasten 10 3 33 0 274 165 315 165;
#P fasten 15 0 32 0 274 192 315 192;
#P connect 8 1 22 0;
#P hidden fasten 22 0 27 0 331 361 346 361;
#P hidden connect 27 0 26 0;
#P hidden connect 26 0 5 3;
#P pop;

#94533
Jan 29, 2007 at 8:01pm

David Stevens wrote:
> and here’s the second one.

I was reffering to that one, and the author is in it…

Thanks Mathieu….

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#94534

You must be logged in to reply to this topic.