Hi List....
i come back to an old question, that i havent completely resolved for
myself.
I need something like the phase-vocoder from the fft-examples but for
live-input.
Basically: variable live-time-compression-expansion-delay-something.
Has someone done that before ? Or can someone give me a hint ?
Cheers
Luigi
Luigi Rensinghoff wrote:
Has someone done that before ? Or can someone give me a hint ?
live time-compression wouldn't make any sense, since you can't travel forward in time.... or can you? (dun-dun-DUN)
you'd need some kind of spooling/unspooling delay if you wanted live time-compression to be possible. it could get gradually 'behind' real-time as you time-expanded, and would then speed forward 'toward' real-time as you time-compressed.
Am 15.05.2007 um 16:03 schrieb Damian Stewart:
Luigi Rensinghoff wrote:
Has someone done that before ? Or can someone give me a hint ?
live time-compression wouldn't make any sense, since you can't travel forward in time.... or can you? (dun-dun-DUN)
you'd need some kind of spooling/unspooling delay if you wanted live time-compression to be possible. it could get gradually 'behind'
real-time as you time-expanded, and would then speed forward 'toward' real- time as you time-compressed.
Thats exactly what i mean..
a variable realtime-time-expansion ;-)
-- Damian Stewart
f r e y live music with machines http://www.frey.co.nz http://www.myspace.com/freyed
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
maybe easier to go the granular route than mess about with fft. i just did a quick search for 'realtime timestretch' and a lot of people are saying that the granular based patches/plugins are good.
makes sense too....cos if you use a phase vocoder approach, you will have to speed thru the audio to get back from a delayed signal to a realtime one...but with granular, you can just merge grainclouds.
Luigi Rensinghoff wrote:
Thats exactly what i mean..
a variable realtime-time-expansion ;-)
i had a pretty thorough dig through I07.phase.vocoder a few months back. what you'd basically need to do is something along the lines of using [tabwrite~] to write the audio signal in to $0-sample, banging it at the end of the table to make it start recording from the beginning again. you'd also need something monitoring the current position (use [r location] to receive the current position), making it jump back to the start when it hit the end.
attached is my [d-pvocst~] which is a hacked up version of the help version that a) plays in stereo (with additional logic for dealing with mono files) and b) automatically loops between adjustable start and end sample numbers in the input arrays. it should be fairly easy to rig it up to tabwrite~ a live audio stream in to $0-sample-l and $0-sample-r in the way i described above.
enjoy!
Thanks a lot to all.
especially for putting my idea somewhere between Albert Einstein and
Freddy Mercury ;-)
well....i'll post my results
Luigi
Am 15.05.2007 um 17:12 schrieb Damian Stewart:
Luigi Rensinghoff wrote:
Thats exactly what i mean.. a variable realtime-time-expansion ;-)
i had a pretty thorough dig through I07.phase.vocoder a few months
back. what you'd basically need to do is something along the lines
of using [tabwrite~] to write the audio signal in to $0-sample,
banging it at the end of the table to make it start recording from
the beginning again. you'd also need something monitoring the
current position (use [r location] to receive the current
position), making it jump back to the start when it hit the end.attached is my [d-pvocst~] which is a hacked up version of the help
version that a) plays in stereo (with additional logic for dealing
with mono files) and b) automatically loops between adjustable
start and end sample numbers in the input arrays. it should be
fairly easy to rig it up to tabwrite~ a live audio stream in to $0- sample-l and $0-sample-r in the way i described above.enjoy!
-- Damian Stewart
f r e y live music with machines http://www.frey.co.nz http://www.myspace.com/freyed #N canvas 50 31 1101 773 12; #X floatatom 486 370 5 0 0 0 - #0-transpo-set -; #X floatatom 164 424 3 0 0 0 - #0-speed-set -; #X floatatom 52 426 7 0 0 0 - #0-location-set -; #X text 161 405 hundredths; #X text 490 335 in cents; #X text 415 362 normal; #N canvas 0 110 569 458 hann-window 0; #N canvas 0 22 450 300 (subpatch) 0; #X array $0-hann 2048 float 0; #X coords 0 1 2047 0 300 100 1; #X restore 82 311 graph; #X obj 378 165 osc~; #X obj 378 190 *~ -0.5; #X obj 378 214 +~ 0.5; #X obj 331 247 tabwrite~ $0-hann; #X obj 38 173 /; #X obj 127 142 samplerate~; #X obj 177 204 swap; #X obj 177 228 /; #X obj 49 201 * 1000; #X obj 38 115 t f b f; #X msg 173 92 resize $1; #X obj 173 116 s $0-hann; #X msg 382 130 0; #X obj 330 131 t f b; #X text 15 8 calculate Hann window table (variable window size) and constants window-hz (fundamental frequency of analysis) , window-sec and window-msec (analysis window size in seconds and msec).; #X obj 37 88 r $0-window-size; #X obj 330 105 r $0-window-hz; #X obj 177 252 s $0-window-hz; #X obj 48 228 s $0-window-msec; #X obj 38 251 s $0-window-sec; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 5 0 9 0; #X connect 5 0 20 0; #X connect 6 0 5 1; #X connect 6 0 7 1; #X connect 7 0 8 0; #X connect 7 1 8 1; #X connect 8 0 18 0; #X connect 9 0 19 0; #X connect 10 0 5 0; #X connect 10 0 7 0; #X connect 10 1 6 0; #X connect 10 2 11 0; #X connect 11 0 12 0; #X connect 13 0 1 1; #X connect 14 0 1 0; #X connect 14 1 4 0; #X connect 14 1 13 0; #X connect 16 0 10 0; #X connect 17 0 14 0; #X restore 436 570 pd hann-window; #N canvas 430 22 805 756 insample 0; #N canvas 0 22 450 300 (subpatch) 0; #X array $0-sample-r 4e+06 float 0; #X coords 0 1 4e+06 -1 400 150 1; #X restore 277 187 graph; #X obj 27 401 unpack s f; #X obj 27 574 soundfiler; #X text 358 355 read a sample; #X obj 281 355 loadbang; #X obj 112 367 44100; #X obj 27 366 t a b; #X obj 37 598 s $0-samplength; #X obj 124 401 s $0-insamprate; #X obj 27 651 /; #X obj 27 675 * 1000; #X obj 27 698 s $0-samp-msec; #X obj 65 651 r $0-insamprate; #X obj 8 71 hip~ 5; #X obj 8 10 inlet; #X obj 128 33 samplerate~; #X obj 128 57 s $0-insamprate; #X msg 281 384 ../soud/voice.wav; #X obj 281 414 s $0-read-sample; #X obj 28 160 r $0-read-sample; #X obj 27 516 pack s s s; #X obj 27 481 t s b b; #X obj 99 483 symbol $0-sample-l; #N canvas 0 22 450 300 (subpatch) 0; #X array $0-sample-l 4e+06 float 0; #X coords 0 1 4e+06 -1 400 150 1; #X restore 276 19 graph; #X obj 119 502 symbol $0-sample-r; #X obj 9 97 tabwrite~ $0-sample-l; #X obj 8 46 adc~ 1; #X obj 66 49 adc~ 2; #X obj 69 74 hip~ 5; #X obj 70 124 tabwrite~ $0-sample-r; #X obj 27 622 moses 1; #X msg 76 325 44100; #X obj 197 306 sel mono; #X obj 331 572 soundfiler; #X obj 341 596 s $0-samplength; #X obj 331 649 /; #X obj 331 673 * 1000; #X obj 331 696 s $0-samp-msec; #X obj 369 649 r $0-insamprate; #X obj 331 523 pack s s s; #X obj 331 488 t s b b; #X obj 403 490 symbol $0-sample-l; #X obj 423 509 symbol $0-sample-r; #X obj 331 620 moses 1; #X msg 331 548 read -resize $1 $2 , read -resize $1 $3; #X text 395 454 read mono; #X text 157 444 read stereo; #X obj 27 225 unpack s f s; #X obj 27 443 demultiplex 0 1; #X msg 161 327 0; #X msg 201 331 1; #X obj 22 269 t b a; #X msg 27 547 read -resize $1 $2 $3; #X text 11 286 reset for next time; #X text 53 202 file [samplerate] [mono]; #X connect 1 0 48 0; #X connect 1 1 8 0; #X connect 2 0 7 0; #X connect 2 0 30 0; #X connect 4 0 17 0; #X connect 5 0 8 0; #X connect 6 0 1 0; #X connect 6 1 5 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 12 0 9 1; #X connect 13 0 25 0; #X connect 14 0 15 0; #X connect 14 0 26 0; #X connect 14 0 27 0; #X connect 15 0 16 0; #X connect 17 0 18 0; #X connect 19 0 47 0; #X connect 20 0 52 0; #X connect 21 0 20 0; #X connect 21 1 22 0; #X connect 21 2 24 0; #X connect 22 0 20 1; #X connect 24 0 20 2; #X connect 26 0 13 0; #X connect 27 0 28 0; #X connect 28 0 29 0; #X connect 30 1 9 0; #X connect 31 0 5 1; #X connect 32 0 50 0; #X connect 33 0 34 0; #X connect 33 0 43 0; #X connect 35 0 36 0; #X connect 36 0 37 0; #X connect 38 0 35 1; #X connect 39 0 44 0; #X connect 40 0 39 0; #X connect 40 1 41 0; #X connect 40 2 42 0; #X connect 41 0 39 1; #X connect 42 0 39 2; #X connect 43 1 35 0; #X connect 44 0 33 0; #X connect 47 0 51 0; #X connect 47 1 5 1; #X connect 47 2 32 0; #X connect 48 0 21 0; #X connect 48 1 40 0; #X connect 49 0 48 1; #X connect 50 0 48 1; #X connect 51 0 31 0; #X connect 51 0 49 0; #X connect 51 1 6 0; #X connect 52 0 2 0; #X restore 437 522 pd insample; #X floatatom 548 522 10 0 0 0 - #0-samp-msec -; #X msg 231 509 ../sound/bell.aiff; #X msg 231 534 ../sound/voice.wav; #X msg 231 559 ../sound/voice2.wav; #X obj 437 501 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X text 459 495 <- record; #X obj 490 428 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X obj 259 427 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 371 339 200; #X msg 371 361 100; #X msg 371 383 20; #X text 412 338 contract; #X text 416 383 expand; #X text 491 318 detune; #X text 52 371 location; #X text 49 387 (stops; #X text 54 402 motion); #X text 162 389 motion in; #X text 234 487 read input sound; #X text 103 7 PHASE VOCODER FOR TIME STETCHING AND CONTRACTION; #X text 636 518 length , msec; #X floatatom 604 460 5 0 0 0 - #0-window-size -; #X msg 604 348 512; #X msg 604 370 1024; #X msg 604 392 2048; #X msg 604 414 4096; #X text 604 315 window size ,; #X text 604 330 samples; #X text 645 347 <- set; #X text 97 347 ------- location controls -------; #X text 658 452 (check); #X text 21 35 This patch takes a sound , analyzes windows in it both for channel magnitude and for phase precession in each channel
(compared to another operlapping window). The real-time output recreates the same magnitudes and phase precession , althought the phases
themselves are in general different. You can control either the location or its motion (setting location stops motion , while setting a non-zero
motion causes the location to change automatically). "Rewind" goes back to the beginning. You can use different window sizes (use the message boxes - the number box is for readout). The "lock" feature forces
phase coherency between neighboring channels , which makes a more present sound but can add artifacts to the sound. Look in "pd fft-analysis" to see the workings.; #X text 500 614 updated for Pd version 0.39; #X obj 548 357 bng 15 250 50 0 $0-no-detune empty empty 0 -6 0 8
-262144 -1 -1; #X obj 231 585 s $0-read-sample; #X obj 604 436 s $0-window-size; #X obj 490 448 s $0-lock; #X obj 487 393 s $0-transpo; #X obj 358 448 s $0-auto; #X obj 259 449 s $0-rewind; #X obj 164 448 s $0-speed; #X obj 52 448 s $0-location; #N canvas 107 0 1177 817 fft-analysis 0; #X obj 64 552 *~; #X obj 31 552 *~; #X obj 31 574 -~; #X obj 180 550 *~; #X obj 149 550 *~; #X obj 149 572 +~; #X obj 122 268 *~; #X obj 91 268 *~; #X obj 63 268 *~; #X obj 32 268 *~; #X obj 32 293 +~; #X obj 140 454 *~; #X obj 33 697 *~; #X obj 251 505 rfft~; #X obj 121 236 rfft~; #X obj 32 639 rifft~; #X obj 34 721 outlet~; #X obj 110 454 *~; #X obj 110 476 +~; #X obj 137 293 -~; #X obj 31 506 *~; #X obj 64 507 *~; #X obj 712 658 block~; #X obj 32 424 +~ 1e-15; #X obj 32 673 *~; #X obj 65 673 tabreceive~ $0-hann; #X obj 139 716 expr 2/(3*$f1); #X obj 906 573 loadbang; #X msg 712 633 set $1 4; #X obj 110 500 q8_rsqrt~; #X text 644 15 recall previous output amplitude. Its phase will be added to the phase difference we measure from two windows in the the recorded sound.; #X obj 134 144 *~; #X obj 102 144 *~; #X obj 102 166 +~; #X obj 172 169 q8_rsqrt~; #X obj 172 146 +~ 1e-20; #X obj 86 194 *~; #X obj 32 193 *~; #X obj 42 320 lrshift~ 1; #X obj 37 344 lrshift~ -1; #X obj 154 320 lrshift~ 1; #X obj 146 344 lrshift~ -1; #X obj 48 375 *~; #X obj 172 387 *~; #X obj 32 400 +~; #X obj 138 406 +~; #X text 619 76 divide by the magnitude to make a unit-magnitude
complex amplitude (phase only). The 1e-20 is to prevent overflows. q8_rsqrt~ is reciprocal square root.; #X text 619 175 Take FT of the window in back. Multiply its conjugate by the normalized previous output. The result has the magnitude of the input sound and phase (previous output phase) minus (back window phase).; #X text 621 380 Normalize again , this time taking care to salt each channel with 1e-15 so that we get a unit complex number even if
everything was zero heretofore.; #X text 659 433 Now take the FT of the forward window and multiply it by the unit complex number from above. The magnitude will be that of the forward window and the phase will be the previous output phase plus the phase difference between the two analysis windows -- except that if "lock" is on , they will be modified to agree progressively better with the inter-channel phase relationships of the input.; #X text 621 252 If "lock" is on , encourage neighboring channels to stay in phase by adding the two neighboring complex amplitudes. The result will tend toward the channel with the strongest amplitude. If the phase relationships between channels in the output and those in the input are in parallel , then neighboring channels of the quotient will all have the same phase and this will not change any phases.
(lrshift shifts the signal to the left or right depending on its argument.) ; #X text 673 574 'set' message to block; #X text 676 591 allows variable size; #X text 631 136 Read two windows , one 1/4 length behind the other , of the input sound , with Hann window function (see inside).; #X obj 712 609 r $0-window-size; #X obj 906 607 t b b b; #X msg 962 632 2048; #X obj 962 656 s $0-window-size; #X msg 923 654 0; #X obj 923 680 s $0-transpo; #X msg 879 668 bang; #X obj 851 704 s $0-rewind; #X obj 140 697 r $0-window-size; #X obj 194 365 r $0-lock; #N canvas 16 0 1176 937 read-windows 0; #X obj 20 754 *~; #X obj 156 300 f; #X obj 102 139 /; #X obj 197 756 *~; #X obj 156 255 bang~; #X obj 19 612 line~; #X obj 102 164 * 1000; #X obj 198 302 +; #X obj 288 272 *; #X obj 165 533 +; #X obj 125 509 t f f; #X msg 19 584 $1 , $2 $3; #X obj 19 557 pack 0 0 0; #X obj 160 434 / 1000; #X obj 138 457 *; #X text 170 457 reading location (samples); #X obj 62 658 / 4; #X obj 288 245 * 0.01; #X floatatom 342 559 7 0 0 0 - - -; #X obj 342 535 *; #X obj 501 448 * 0.01; #X obj 503 469 + 69; #X obj 504 490 mtof; #X obj 504 512 / 440; #X obj 377 535 t b f; #X obj 21 780 outlet~; #X obj 197 781 outlet~; #X obj 220 725 tabreceive~ $0-hann; #X msg 791 609 set $1; #X text 325 578 stretched window size (samples); #X msg 913 609 set $1; #X msg 974 275 set $1; #X obj 956 137 t b f; #X obj 974 254 f; #X obj 902 168 int; #X obj 902 200 sel 0; #X msg 961 171 1; #X msg 961 194 0; #X obj 160 410 r $0-insamprate; #X floatatom 111 187 5 0 0 0 - - -; #X obj 102 115 t f b; #X obj 142 139 samplerate~; #X obj 102 208 / 4; #X obj 175 483 / 2; #X obj 138 483 -; #X text 231 478 back up 1/2 window; #X text 43 6 Read two windows out of the recorded sample , one 1/4 ahead of the other. The mid point of the front window is specified by "location". If "speed" is nonzero , "location" automatically
precesses. ; #X text 93 648 "back" window 1/4 cycle behind "front" one; #X text 137 205 computation period (msec) for overlap of 4; #X text 164 186 msec in a window; #X text 326 275 loop to precess the location according; #X text 325 291 to the "speed" parameter.; #X text 759 28 if location changes , update number box; #X text 758 47 in main window via "location-set" , but; #X text 761 66 taking care to limit frequency of updates.; #X text 792 538 reflect control changes; #X text 792 555 in main window.; #X text 756 405 setting location by hand; #X text 754 423 sets speed to zero.; #X text 762 714 misc controls; #X text 581 486 "rewind" control takes us; #X text 584 504 to a location depending on; #X text 584 523 stretched window size.; #X obj 288 223 r $0-speed; #X obj 178 276 r $0-location; #X obj 342 509 r $0-window-size; #X obj 501 426 r $0-transpo; #X obj 611 545 r $0-rewind; #X obj 102 91 r $0-window-size; #X obj 610 652 s $0-location; #X obj 732 746 r $0-no-detune; #X msg 732 771 0; #X obj 864 734 r $0-auto; #X obj 864 761 t f b; #X obj 899 789 s $0-rewind; #X obj 864 815 s $0-speed; #X obj 913 583 r $0-transpo; #X obj 791 585 r $0-speed; #X obj 791 634 s $0-speed-set; #X obj 913 634 s $0-transpo-set; #X obj 815 494 s $0-speed; #X obj 805 447 r $0-location; #X obj 974 299 s $0-location-set; #X obj 956 91 r $0-location; #X obj 965 113 r $0-see-loc; #X obj 233 306 s $0-see-loc; #X obj 18 658 -~; #X obj 733 800 s $0-transpo; #X obj 19 698 tabread4~ $0-sample-l; #X obj 196 698 tabread4~ $0-sample-l; #X obj 303 818 *~; #X obj 480 820 *~; #X obj 304 844 outlet~; #X obj 480 845 outlet~; #X obj 503 789 tabreceive~ $0-hann; #X obj 302 762 tabread4~ $0-sample-r; #X obj 479 762 tabread4~ $0-sample-r; #X obj 235 353 >; #X obj 254 328 r $0-endpoint; #X msg 805 470 0; #X text 886 476 d-no it doesn't; #X obj 235 377 sel 1; #X obj 628 122 r $0-samp-msec; #X obj 628 225 s $0-endpoint; #X text 607 99 new sample: reset endpoints; #X obj 747 306 s $0-startpoint; #X obj 367 360 <; #X obj 386 333 r $0-startpoint; #X obj 367 383 sel 1; #X obj 367 404 f; #X obj 367 429 s $0-location; #X obj 430 390 r $0-endpoint; #X obj 747 277 * -0.5; #X obj 747 223 /; #X obj 747 248 * 1000; #X obj 747 199 t f b; #X obj 787 223 samplerate~; #X obj 747 175 f; #X msg 747 150 bang; #X obj 611 594 f; #X obj 630 569 r $0-startpoint; #X obj 902 226 del 300; #X connect 0 0 25 0; #X connect 1 0 7 0; #X connect 1 0 14 0; #X connect 2 0 6 0; #X connect 3 0 26 0; #X connect 4 0 1 0; #X connect 5 0 86 0; #X connect 5 0 89 0; #X connect 5 0 96 0; #X connect 6 0 39 0; #X connect 6 0 42 0; #X connect 7 0 1 1; #X connect 7 0 85 0; #X connect 7 0 97 0; #X connect 7 0 106 0; #X connect 8 0 7 1; #X connect 9 0 12 1; #X connect 10 0 12 0; #X connect 10 1 9 0; #X connect 11 0 5 0; #X connect 12 0 11 0; #X connect 13 0 14 1; #X connect 14 0 44 0; #X connect 16 0 86 1; #X connect 17 0 8 0; #X connect 18 0 16 0; #X connect 18 0 9 1; #X connect 18 0 43 0; #X connect 18 0 117 1; #X connect 19 0 18 0; #X connect 20 0 21 0; #X connect 21 0 22 0; #X connect 22 0 23 0; #X connect 23 0 24 0; #X connect 24 0 19 0; #X connect 24 1 19 1; #X connect 27 0 3 1; #X connect 27 0 0 1; #X connect 28 0 78 0; #X connect 30 0 79 0; #X connect 31 0 82 0; #X connect 32 0 34 0; #X connect 32 1 33 1; #X connect 33 0 31 0; #X connect 34 0 35 0; #X connect 35 0 36 0; #X connect 35 0 121 0; #X connect 36 0 34 1; #X connect 37 0 34 1; #X connect 38 0 13 0; #X connect 40 0 2 0; #X connect 40 1 41 0; #X connect 41 0 2 1; #X connect 42 0 12 2; #X connect 42 0 8 1; #X connect 43 0 44 1; #X connect 44 0 10 0; #X connect 63 0 17 0; #X connect 64 0 1 1; #X connect 65 0 19 0; #X connect 66 0 20 0; #X connect 67 0 119 0; #X connect 68 0 40 0; #X connect 70 0 71 0; #X connect 71 0 87 0; #X connect 72 0 73 0; #X connect 73 0 75 0; #X connect 73 1 74 0; #X connect 76 0 30 0; #X connect 77 0 28 0; #X connect 81 0 99 0; #X connect 83 0 32 0; #X connect 84 0 32 0; #X connect 86 0 88 0; #X connect 86 0 95 0; #X connect 88 0 0 0; #X connect 89 0 3 0; #X connect 90 0 92 0; #X connect 91 0 93 0; #X connect 94 0 91 1; #X connect 94 0 90 1; #X connect 95 0 90 0; #X connect 96 0 91 0; #X connect 97 0 101 0; #X connect 98 0 97 1; #X connect 101 0 119 0; #X connect 102 0 103 0; #X connect 102 0 118 0; #X connect 106 0 108 0; #X connect 107 0 106 1; #X connect 108 0 109 0; #X connect 109 0 110 0; #X connect 111 0 109 1; #X connect 112 0 105 0; #X connect 113 0 114 0; #X connect 114 0 112 0; #X connect 115 0 113 0; #X connect 115 1 116 0; #X connect 116 0 113 1; #X connect 117 0 115 0; #X connect 118 0 117 0; #X connect 119 0 69 0; #X connect 120 0 119 1; #X connect 121 0 37 0; #X connect 121 0 33 0; #X restore 238 -2 pd read-windows; #X obj 150 618 tabsend~ $0-prev-imag-l; #X obj 86 104 tabreceive~ $0-prev-imag-l; #X obj 32 83 tabreceive~ $0-prev-real-l; #X obj 149 642 tabsend~ $0-prev-real-l; #X obj 382 556 *~; #X obj 349 556 *~; #X obj 349 578 -~; #X obj 498 554 *~; #X obj 467 554 *~; #X obj 467 576 +~; #X obj 440 272 *~; #X obj 409 272 *~; #X obj 381 272 *~; #X obj 350 272 *~; #X obj 350 297 +~; #X obj 458 458 *~; #X obj 351 701 *~; #X obj 569 509 rfft~; #X obj 429 236 rfft~; #X obj 350 643 rifft~; #X obj 352 725 outlet~; #X obj 428 458 *~; #X obj 428 480 +~; #X obj 455 297 -~; #X obj 349 510 *~; #X obj 382 511 *~; #X obj 350 428 +~ 1e-15; #X obj 350 677 *~; #X obj 383 677 tabreceive~ $0-hann; #X obj 457 720 expr 2/(3*$f1); #X obj 428 504 q8_rsqrt~; #X obj 452 148 *~; #X obj 420 148 *~; #X obj 420 170 +~; #X obj 490 173 q8_rsqrt~; #X obj 490 150 +~ 1e-20; #X obj 404 198 *~; #X obj 350 197 *~; #X obj 360 324 lrshift~ 1; #X obj 355 348 lrshift~ -1; #X obj 472 324 lrshift~ 1; #X obj 464 348 lrshift~ -1; #X obj 366 379 *~; #X obj 490 391 *~; #X obj 350 404 +~; #X obj 456 410 +~; #X obj 458 701 r $0-window-size; #X obj 512 369 r $0-lock; #X obj 468 622 tabsend~ $0-prev-imag-r; #X obj 467 646 tabsend~ $0-prev-real-r; #X obj 350 87 tabreceive~ $0-prev-real-r; #X obj 404 108 tabreceive~ $0-prev-imag-r; #X connect 0 0 2 1; #X connect 1 0 2 0; #X connect 2 0 15 0; #X connect 2 0 68 0; #X connect 3 0 5 1; #X connect 4 0 5 0; #X connect 5 0 15 1; #X connect 5 0 65 0; #X connect 6 0 19 1; #X connect 7 0 19 0; #X connect 8 0 10 1; #X connect 9 0 10 0; #X connect 10 0 39 0; #X connect 10 0 38 0; #X connect 10 0 44 0; #X connect 11 0 18 1; #X connect 12 0 16 0; #X connect 13 0 1 1; #X connect 13 0 3 1; #X connect 13 1 0 1; #X connect 13 1 4 1; #X connect 14 0 9 1; #X connect 14 0 7 1; #X connect 14 1 6 1; #X connect 14 1 8 1; #X connect 15 0 24 0; #X connect 17 0 18 0; #X connect 18 0 29 0; #X connect 19 0 40 0; #X connect 19 0 41 0; #X connect 19 0 45 0; #X connect 20 0 1 0; #X connect 20 0 4 0; #X connect 21 0 0 0; #X connect 21 0 3 0; #X connect 23 0 17 1; #X connect 23 0 17 0; #X connect 23 0 20 0; #X connect 24 0 12 0; #X connect 25 0 24 1; #X connect 26 0 12 1; #X connect 27 0 55 0; #X connect 28 0 22 0; #X connect 29 0 20 1; #X connect 29 0 21 1; #X connect 31 0 33 1; #X connect 32 0 33 0; #X connect 33 0 35 0; #X connect 34 0 36 1; #X connect 34 0 37 1; #X connect 35 0 34 0; #X connect 36 0 8 0; #X connect 36 0 7 0; #X connect 37 0 9 0; #X connect 37 0 6 0; #X connect 38 0 42 0; #X connect 39 0 42 0; #X connect 40 0 43 0; #X connect 41 0 43 0; #X connect 42 0 44 1; #X connect 43 0 45 1; #X connect 44 0 23 0; #X connect 45 0 11 0; #X connect 45 0 11 1; #X connect 45 0 21 0; #X connect 54 0 28 0; #X connect 55 0 60 0; #X connect 55 1 58 0; #X connect 55 2 56 0; #X connect 56 0 57 0; #X connect 58 0 59 0; #X connect 60 0 61 0; #X connect 62 0 26 0; #X connect 63 0 42 1; #X connect 63 0 43 1; #X connect 64 0 14 0; #X connect 64 1 13 0; #X connect 64 2 83 0; #X connect 64 3 82 0; #X connect 66 0 31 1; #X connect 66 0 31 0; #X connect 66 0 36 0; #X connect 67 0 32 1; #X connect 67 0 32 0; #X connect 67 0 37 0; #X connect 69 0 71 1; #X connect 70 0 71 0; #X connect 71 0 84 0; #X connect 71 0 114 0; #X connect 72 0 74 1; #X connect 73 0 74 0; #X connect 74 0 84 1; #X connect 74 0 113 0; #X connect 75 0 88 1; #X connect 76 0 88 0; #X connect 77 0 79 1; #X connect 78 0 79 0; #X connect 79 0 104 0; #X connect 79 0 103 0; #X connect 79 0 109 0; #X connect 80 0 87 1; #X connect 81 0 85 0; #X connect 82 0 70 1; #X connect 82 0 72 1; #X connect 82 1 69 1; #X connect 82 1 73 1; #X connect 83 0 78 1; #X connect 83 0 76 1; #X connect 83 1 75 1; #X connect 83 1 77 1; #X connect 84 0 92 0; #X connect 86 0 87 0; #X connect 87 0 95 0; #X connect 88 0 105 0; #X connect 88 0 106 0; #X connect 88 0 110 0; #X connect 89 0 70 0; #X connect 89 0 73 0; #X connect 90 0 69 0; #X connect 90 0 72 0; #X connect 91 0 86 1; #X connect 91 0 86 0; #X connect 91 0 89 0; #X connect 92 0 81 0; #X connect 93 0 92 1; #X connect 94 0 81 1; #X connect 95 0 89 1; #X connect 95 0 90 1; #X connect 96 0 98 1; #X connect 97 0 98 0; #X connect 98 0 100 0; #X connect 99 0 101 1; #X connect 99 0 102 1; #X connect 100 0 99 0; #X connect 101 0 77 0; #X connect 101 0 76 0; #X connect 102 0 78 0; #X connect 102 0 75 0; #X connect 103 0 107 0; #X connect 104 0 107 0; #X connect 105 0 108 0; #X connect 106 0 108 0; #X connect 107 0 109 1; #X connect 108 0 110 1; #X connect 109 0 91 0; #X connect 110 0 80 0; #X connect 110 0 80 1; #X connect 110 0 90 0; #X connect 111 0 94 0; #X connect 112 0 107 1; #X connect 112 0 108 1; #X connect 115 0 97 1; #X connect 115 0 97 0; #X connect 115 0 102 0; #X connect 116 0 96 1; #X connect 116 0 96 0; #X connect 116 0 101 0; #X restore 16 520 pd fft-analysis; #N canvas 260 23 954 780 phase-tables 0; #N canvas 0 22 450 300 (subpatch) 0; #X array $0-prev-imag-l 4096 float 0; #X coords 0 1000 4096 -1000 400 300 1; #X restore 22 328 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array $0-prev-real-l 4096 float 0; #X coords 0 500 4096 -500 400 300 1; #X restore 23 19 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array $0-prev-imag-r 4096 float 0; #X coords 0 1000 4096 -1000 400 300 1; #X restore 470 351 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array $0-prev-real-r 4096 float 0; #X coords 0 500 4096 -500 400 300 1; #X restore 471 42 graph; #X restore 436 546 pd phase-tables; #X obj 17 554 outlet~; #X obj 537 30 inlet; #X obj 121 558 outlet~; #X msg 376 422 -100; #X obj 666 254 s $0-rewind; #X msg 666 226 bang; #N canvas 0 22 441 273 startend 0; #X obj 33 28 inlet; #X obj 177 25 inlet; #X obj 212 119 s $0-endpoint; #X obj 33 115 moses; #X obj 68 50 r $0-endpoint; #X obj 33 177 s $0-startpoint; #X obj 177 93 moses; #X obj 196 62 r $0-startpoint; #X text 104 142 ensure startpoint is < endpoint; #X connect 0 0 3 0; #X connect 1 0 6 0; #X connect 3 0 5 0; #X connect 4 0 3 1; #X connect 6 1 2 0; #X connect 7 0 6 1; #X restore 723 300 pd startend; #X obj 1004 26 inlet; #X obj 998 239 s $0-auto; #X text 1007 6 speed; #X obj 750 264 print start; #X obj 825 221 s $0-transpo; #X obj 611 186 route read rewind start end transpose lock; #X msg 632 157 read d:/music/samples/godspeed/guitarnotes.wav 44100 mono; #X msg 603 137 read d:/music/samples/soundisland/ocean.wav; #X text 612 21 rewind; #X text 758 45 loops between start and end; #X text 609 86 lock 1|0; #X text 610 70 transpose <semitones>; #X text 613 53 end <samplenum>; #X text 615 35 start <samplenum>; #X text 613 106 <number> - start playing at that speed; #X text 538 6 control:; #X text 611 6 read <filename> [samplerate] [mono]; #X connect 0 0 45 0; #X connect 1 0 48 0; #X connect 2 0 49 0; #X connect 9 0 42 0; #X connect 10 0 42 0; #X connect 11 0 42 0; #X connect 12 0 7 0; #X connect 14 0 44 0; #X connect 15 0 47 0; #X connect 16 0 46 0; #X connect 17 0 46 0; #X connect 18 0 46 0; #X connect 30 0 43 0; #X connect 31 0 43 0; #X connect 32 0 43 0; #X connect 33 0 43 0; #X connect 50 0 52 0; #X connect 50 1 54 0; #X connect 53 0 64 0; #X connect 55 0 46 0; #X connect 57 0 56 0; #X connect 59 0 60 0; #X connect 64 0 42 0; #X connect 64 1 57 0; #X connect 64 2 58 0; #X connect 64 2 62 0; #X connect 64 3 58 1; #X connect 64 4 63 0; #X connect 64 5 14 0; #X connect 64 6 60 0; #X connect 65 0 64 0; #X connect 66 0 64 0;
could you post that again as an attachment? my email gives me > signs before every line, so ti can't make it into a pd patch.
hard off wrote:
could you post that again as an attachment? my email gives me > signs before every line, so ti can't make it into a pd patch.
interesting.
try this.
Hi list...
i am working on this right now. And since i never really had a deep
look into all the tabread-thingies, some questions came up.
Just to give you a quick sketch of my approach:
I used the I07-patch and i am working with two of them (each 1
second) so i can swap from one to another.
I have two 8 second tables that record the live signal from a vd~.
So here my questions, just in case someone found a solution for that
(i am sure you did ;-) )
updated. I tried something with vline....are there some "zero- crossing" modules for that ?
beginning) while playing the later contents of it. Is it possible to
replace just a portion of a table without overwriting until the end ?
the whole patch becomes somewhat unstable because of the
graphics-display, any idea for a workaround ?
be to slow or unstable in any way quite unreliable. i made a
workaround with moses and ">" ...not very elegant.
after cleaning up i will post the patch
bye luigi
Maybe using tabsend~ with a different blocksize in a subpatch would help with the continuous writing to an array? I dunno. I am interested in a good solution to this though!
~Kyle
On 5/19/07, Luigi Rensinghoff luigi.rensinghoff@freenet.de wrote:
Hi list...
i am working on this right now. And since i never really had a deep look into all the tabread-thingies, some questions came up.
Just to give you a quick sketch of my approach:
I used the I07-patch and i am working with two of them (each 1 second) so i can swap from one to another.
I have two 8 second tables that record the live signal from a vd~.
So here my questions, just in case someone found a solution for that (i am sure you did ;-) )
- How to avoid clicks when the whole contents of a table is replaced/
updated. I tried something with vline....are there some "zero- crossing" modules for that ?
- It seems to be possible to replace the contents of a table (the
beginning) while playing the later contents of it. Is it possible to replace just a portion of a table without overwriting until the end ?
the whole patch becomes somewhat unstable because of the
graphics-display, any idea for a workaround ?
- if i have a quite fast running number (index). "select" seems to
be to slow or unstable in any way quite unreliable. i made a workaround with moses and ">" ...not very elegant.
after cleaning up i will post the patch
bye luigi
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Luigi Rensinghoff wrote:
- How to avoid clicks when the whole contents of a table is replaced/
updated. I tried something with vline....are there some "zero- crossing" modules for that ?
Fade playback volume to zero, do the switch, fade playback volume up. Vary curve to suit the sound, but that's the general approach I think.
A variation uses two tables played back simultaneously, staggered like:
aAa aAa aAa aAa ... . bBb bBb bBb bBb ...
with volume envelopes such that the total volume is constant. I think this is used in a delay-based pitchshifting example in the docs.
- It seems to be possible to replace the contents of a table (the
beginning) while playing the later contents of it. Is it possible to
replace just a portion of a table without overwriting until the end ?
Yes, see [tabwrite~] help (the "stop" message in particular).
the whole patch becomes somewhat unstable because of the
graphics-display, any idea for a workaround ?
Use [table] instead of a graphical array.
- if i have a quite fast running number (index). "select" seems to
be to slow or unstable in any way quite unreliable. i made a
workaround with moses and ">" ...not very elegant.
This is a limitation of floating point arithmetic, once you go past a certain size absolute precision becomes less, so integers are missing (ie, there is a floating point number where a + 1 => a, this might also extend to "for any given b, you can find an a such that a + b => a", but I'm not sure).
The solution / workaround is to use chained counters all counting with [+ 1]-[mod n]-[select 0], much like a clock uses seconds, minutes, hours, etc.
Either that or recompile Pd to use double-precision floats, which isn't trivial, and would only postpone the issue (although by a great deal).
On Tue, 2007-05-15 at 15:03 +0100, Damian Stewart wrote:
Luigi Rensinghoff wrote:
Has someone done that before ? Or can someone give me a hint ?
live time-compression wouldn't make any sense, since you can't travel forward in time.... or can you? (dun-dun-DUN)
at least it's hard ;) http://en.wikipedia.org/wiki/Time_dilation
t
-- tim@klingt.org ICQ: 96771783 http://tim.klingt.org
Happiness is a byproduct of function, purpose, and conflict; those who seek happiness for itself seek victory without war. William S. Burroughs