Backwards Masking OR Buffer~ for newbie

Jul 28, 2007 at 10:20pm

Backwards Masking OR Buffer~ for newbie

I’m quite new to working with MSP, but had an idea to create a semi-real time backwards masker to play the world in reverse. I’m just throwing it out there to see if anyone has any suggestions or better ways of doing things.

max v2;
#N vpatcher 15 55 1123 799;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 405 260 45 9109513 Player;
#P flonum 140 186 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 69 238 27 9109513 *~ 0;
#P newex 403 315 27 9109513 !-~ 1;
#P newex 403 287 49 9109513 phasor~ 2;
#P newex 350 363 64 9109513 gate~ 2;
#P newex 405 471 48 9109513 wave~ b2;
#P newex 350 471 48 9109513 wave~ b1;
#P newex 537 419 44 9109513 -~ 22050;
#P newex 539 314 27 9109513 +~ 1;
#P newex 538 363 116 9109513 gate~ 2;
#P newex 540 287 39 9109513 >=~ 0.5;
#P newex 162 224 86 9109513 receive~ backward;
#P newex 349 520 75 9109513 send~ backward;
#P newex 69 185 62 9109513 receive~ mic;
#P newex 627 471 62 9109513 receive~ mic;
#P newex 519 471 62 9109513 receive~ mic;
#P newex 28 108 51 9109513 send~ mic;
#P newex 644 287 45 9109513 *~ 44100;
#P newex 644 244 49 9109513 phasor~ 1;
#P newex 627 520 46 9109513 poke~ b1;
#P newex 519 520 46 9109513 poke~ b2;
#P newex 450 158 70 9109513 buffer~ b2 500;
#P newex 356 158 70 9109513 buffer~ b1 500;
#P toggle 28 186 15 0;
#P newex 69 287 103 9109513 dac~;
#P newex 29 66 28 9109513 adc~;
#P comment 645 219 63 9109513 Recorder;
#P window linecount 6;
#P comment 233 355 100 9109513 Ever half second switch buffers While one is being recorded to , the other is plaing back;
#P connect 2 0 11 0;
#P connect 14 0 26 0;
#P fasten 26 0 3 0 74 272 74 272;
#P fasten 16 0 3 0 167 271 74 271;
#P fasten 4 0 3 0 33 276 74 276;
#P fasten 27 0 26 1 145 219 91 219;
#P fasten 26 0 3 1 74 272 167 272;
#P fasten 16 0 3 1 167 271 167 271;
#P fasten 22 0 15 0 410 508 354 508;
#P connect 21 0 15 0;
#P fasten 19 0 23 0 544 354 355 354;
#P connect 23 0 21 0;
#P connect 24 0 25 0;
#P connect 25 0 23 1;
#P connect 23 1 22 0;
#P connect 12 0 7 0;
#P connect 18 0 20 0;
#P connect 20 0 7 1;
#P connect 19 0 18 0;
#P connect 17 0 19 0;
#P fasten 9 0 17 1 649 282 574 282;
#P connect 13 0 8 0;
#P connect 9 0 10 0;
#P connect 10 0 18 1;
#P connect 18 1 8 1;
#P pop;

#33081
Jul 29, 2007 at 4:46pm

‘A semi-real time backwards masker to play the world in reverse’ you say?

#109669
Jul 29, 2007 at 5:04pm

Ok, its a mouthful, but yes. Semi-realtime because you have to have some small interval to slice up the world by in order to reverse it. Here it is set to 500ms.
The world backwards is a strange place. Try saying “nee-nah” into the instrument.

#109670
Jul 29, 2007 at 5:31pm

i was under the impression that backwards masking was always happening in real time…. no need for a patch there!

As for your patch… I’m not completely sure what your intent is. The basic idea to your patch seems to be that if you record a sound and then play it back in reverse with the original sound..you will get some kind of effect.

However, this is not what backwards masking is. The book ‘The Science of Sound’ by Rossing Moore and Wheeler defines backwards masking as a psychoacoustic term referring to “the masking of a tone by a sound that begins a few milliseconds later. A tone ca be masked by noise that begins up to ten milliseconds later, although the amount of masking decreases as the time interval increases. Backward masking apparently occurs at higher centers of processing where the later-occurring stimulus of greater intensity overtakes and interferes with the weaker stimulus.” (page 114)

The “backwards” part of backwards masking doesn’t refer to a reversal of sound..its just that the initial sound seems to mask sounds that come later.

Anyways, please be more specific as to what your goals and problems are and we can be of some help.

I did do a couple of quick tests with a little repeating blip noise (in place of adc~)
and noticed you were having some problems playing the reverse sounds at the right pitch. I would recommend trying to use a combination of record~ and wave~ rather than the poke~ method. Record also gives a nice sync wave out of its output which you could use to sync to wave~. Look into the looping function of record, as well.

#109671
Jul 29, 2007 at 7:40pm

Thanks for the time to test and respond Nick!
Like I said, I’m new new new. New to the terminology, new to the methods, new to the ideas. I think originally I wanted to create a backwards echo of the world.. like tapin~ but reverse. The goal simply was to familiarize myself with buffer~ and experiment. Now thanks to your suggestions I will play somemore!

#109672
Jul 29, 2007 at 8:42pm

Am 29.07.2007 um 21:40 schrieb Brett:
> I think originally I wanted to create a backwards echo of the world..
> like tapin~ but reverse.

Peter Reid has some nice abstractions for tapin~/out~ based reversing,
they don’t do what you intend straight away but worth checking out.

http://www.peterreid.org/code/

cheers, g.

#109673
Jul 29, 2007 at 10:25pm

Quoting Nick Inhofe :

> However, this is not what backwards masking is. The book ‘The
> Science of Sound’ by Rossing Moore and Wheeler defines backwards
> masking as a psychoacoustic term referring to “the masking of a
> tone by a sound that begins a few milliseconds later. A tone ca
> be masked by noise that begins up to ten milliseconds later,
> although the amount of masking decreases as the time interval
> increases. Backward masking apparently occurs at higher centers
> of processing where the later-occurring stimulus of greater
> intensity overtakes and interferes with the weaker stimulus.”
> (page 114)

Oh I am glad someone you said that Nick! This is one of my personal
“hot buttons”, and that usually is a danger sign for list-posting.
“backwards masking” is indeed a real psychacoustical effect, but
the notion that “backmasking” (which I guess is the name given to
reversing audio) has cognitive currency seems a bit of a stretch to
me.

And if it did, we’d probably all be worshipping at the Church of
Satan (or is that Nataz…) right?

brad

http://music.columbia.edu/~brad

PS: Don’t get me wrong, reversed audio surely often does sound
nifty! I’m always a sucker for the backwards-reverb trick myself.

#109674
Jul 29, 2007 at 11:22pm

Quote: misery4brett@gmail.com wrote on Sun, 29 July 2007 13:40
—————————————————-
> Thanks for the time to test and respond Nick!
> Like I said, I’m new new new. New to the terminology, new to the methods, new to the ideas. I think originally I wanted to create a backwards echo of the world.. like tapin~ but reverse. The goal simply was to familiarize myself with buffer~ and experiment. Now thanks to your suggestions I will play somemore!
—————————————————-

you can actually read from tapin~ backwards by sending it the right values in message form, no need for wave~ or play~.

#109675
Jul 30, 2007 at 2:01am

Yes….except I think that I got it wrong as well…as the definition states- backwards masking is the later sound masking the previous sound… I knew that, but I wrote it wrong (not the definition, but my interpretation).

#109676
Jul 30, 2007 at 10:33pm

i don’t know if you’ll find this interesting,- but here is a tapin-out solution in reverse….

try playing with the speed ratio….

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 420 189 26 196617 ms;
#P flonum 357 188 62 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 259 90 48 196617 loadbang;
#P newex 321 221 29 196617 t b f;
#P newex 259 110 108 196617 t -1. 120.;
#P comment 263 135 59 196617 Speed Retio;
#P user gain~ 97 398 50 104 158 0 1.071519 7.94321 10.;
#P flonum 357 148 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezadc~ 97 188 141 221 0;
#P flonum 259 148 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 259 280 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P newex 259 246 91 196617 expr (-$f1 + 1) * (1000. / $f2);
#P window linecount 1;
#P newex 259 348 52 196617 *~ 3200.;
#P newex 259 303 45 196617 phasor~;
#P newex 357 167 60 196617 !/ 240000.;
#P newex 97 372 55 196617 tapout~ 0.;
#P newex 97 348 65 196617 tapin~ 3200.;
#P user ezdac~ 97 554 141 587 0;
#P comment 362 135 26 196617 BPM;
#P fasten 6 0 3 0 264 368 102 368;
#P fasten 17 0 2 0 362 341 102 341;
#P fasten 17 0 6 1 362 341 306 341;
#P fasten 17 0 15 0 362 213 326 213;
#P connect 4 0 17 0;
#P connect 16 0 14 0;
#P connect 14 1 11 0;
#P connect 14 0 9 0;
#P fasten 15 0 7 0 326 241 264 241;
#P connect 15 1 7 1;
#P connect 12 0 1 0;
#P connect 12 0 1 1;
#P connect 10 0 2 0;
#P connect 9 0 7 0;
#P connect 3 0 12 0;
#P connect 11 0 4 0;
#P connect 5 0 6 0;
#P connect 8 0 5 0;
#P connect 7 0 8 0;
#P connect 2 0 3 0;
#P window clipboard copycount 19;

#109677
Jul 31, 2007 at 12:28am

That’s exactly it. Wouldn’t mind an explanation as to how it works if you can.

#109678
Jul 31, 2007 at 12:25pm

Brett schrieb:
> I’m quite new to working with MSP, but had an idea to create a
> semi-real time backwards masker to play the world in reverse. I’m
> just throwing it out there to see if anyone has any suggestions or
> better ways of doing things.

As you do not prevent clicks, you can have this result much easier, just
record into a single buffer~ with loop recording:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 19 152 50 196617 * -1;
#P number 167 63 53 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 167 93 50 196617 size $1;
#P toggle 19 84 15 0;
#P user gain~ 51 238 30 34 158 0 1.071519 7.94321 10.;
#P user ezdac~ 51 319 95 352 0;
#P newex 51 185 50 196617 sig~ -1;
#P newex 51 212 123 196617 groove~ backloop;
#P window linecount 2;
#P newex 109 63 50 196617 loadmess loop 1;
#P window linecount 1;
#P newex 51 121 98 196617 record~ backloop;
#P user ezadc~ 51 62 95 95 0;
#P newex 167 121 124 196617 buffer~ backloop 500;
#P window linecount 2;
#P comment 229 59 119 196617 buffer size (will erase the buffer on
changes…);
#P connect 12 0 6 0;
#P connect 9 0 12 0;
#P connect 9 0 3 0;
#P connect 11 0 10 0;
#P connect 10 0 1 0;
#P connect 8 0 7 0;
#P connect 8 0 7 1;
#P connect 5 0 8 0;
#P connect 4 0 3 0;
#P fasten 4 0 5 0 114 207 56 207;
#P connect 6 0 5 0;
#P connect 2 0 3 0;
#P window clipboard copycount 13;


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

#109679
Jul 31, 2007 at 11:04pm

Quote: misery4brett@gmail.com wrote on Mon, 30 July 2007 20:28
—————————————————-
> That’s exactly it. Wouldn’t mind an explanation as to how it works if you can.
—————————————————-

I’ve included some explanation, hope it helps !
I agree that a buffer~ solution might be easier, but if you need sync… This solution can be synched sample accurate, all the way thru…

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 535 416 100 196617 Broken up a bit…..;
#P comment 641 473 78 196617 ms -> Hz;
#P comment 583 496 41 196617 Ratio;
#P comment 540 473 78 196617 Invert & offset;
#P comment 602 560 100 196617 Phasor Frequency;
#P newex 636 515 29 196617 t b f;
#P flonum 535 558 65 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 535 537 130 196617 * 1.;
#P comment 571 434 56 196617 SpeedRatio;
#P comment 700 496 58 196617 Hz;
#P comment 421 169 91 196617 ms in one bar…;
#P user number~ 258 374 326 389 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 233 433 284 196617 There can be clicks when the phasor is restarting its phase.;
#P message 310 307 14 196617 0;
#P window linecount 4;
#P comment 366 226 430 196617 This calculates the phasor frequency , – when the speedratio == 1 , the phasor is not moving. The (1000 / $f2) is the conversion from ms -> Hz…… When the phasor is rising , the world is playing in reverse , reason for the -$f1 in expr.;
#P user scope~ 228 455 358 585 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P flonum 636 496 62 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 636 434 62 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 636 456 97 196617 expr (1000. / $f1);
#P flonum 535 496 49 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 535 434 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 535 456 81 196617 expr (-$f1 + 1);
#P comment 421 189 26 196617 ms;
#P flonum 357 188 62 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 259 90 48 196617 loadbang;
#P newex 321 221 29 196617 t b f;
#P newex 259 110 108 196617 t -1. 120.;
#P comment 263 135 59 196617 Speed Retio;
#P user gain~ 97 398 50 104 158 0 1.071519 7.94321 10.;
#P flonum 357 148 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezadc~ 97 188 141 221 0;
#P flonum 259 148 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 259 280 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P newex 259 246 91 196617 expr (-$f1 + 1) * (1000. / $f2);
#P window linecount 1;
#P newex 259 348 52 196617 *~ 3200.;
#P newex 259 307 45 196617 phasor~;
#P newex 357 167 60 196617 !/ 240000.;
#P newex 97 372 55 196617 tapout~ 0.;
#P newex 97 348 65 196617 tapin~ 3200.;
#P user ezdac~ 97 554 141 587 0;
#P comment 362 135 26 196617 BPM;
#P window linecount 2;
#P comment 364 300 423 196617 The Phasor is reading thru the delay buffer , from “the now” and back to the beginning of the delay buffer. i.e. the time defined as ms above.;
#P window linecount 1;
#P comment 700 434 100 196617 ms;
#P connect 23 0 35 0;
#P connect 35 0 36 0;
#P connect 37 1 35 1;
#P fasten 37 0 35 0 641 534 540 534;
#P connect 26 0 37 0;
#P fasten 8 0 5 0 264 368 102 368;
#P connect 8 0 31 0;
#P fasten 7 0 27 0 264 329 233 329;
#P connect 7 0 8 0;
#P connect 29 0 7 1;
#P connect 24 0 26 0;
#P connect 25 0 24 0;
#P connect 21 0 23 0;
#P connect 22 0 21 0;
#P connect 4 0 5 0;
#P connect 9 0 10 0;
#P connect 10 0 7 0;
#P connect 13 0 6 0;
#P connect 5 0 14 0;
#P connect 11 0 9 0;
#P connect 12 0 4 0;
#P connect 14 0 3 1;
#P connect 14 0 3 0;
#P connect 17 1 9 1;
#P fasten 17 0 9 0 326 241 264 241;
#P connect 16 0 11 0;
#P connect 16 1 13 0;
#P connect 18 0 16 0;
#P connect 6 0 19 0;
#P fasten 19 0 17 0 362 213 326 213;
#P fasten 19 0 8 1 362 341 306 341;
#P fasten 19 0 4 0 362 341 102 341;
#P window clipboard copycount 43;

#109680
Jul 31, 2007 at 11:17pm

example with windowing, to avoid clicks…

#P user scope~ 332 456 462 586 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 97 414 35 196617 *~ 1.;
#P newex 332 383 106 196617 trapezoid~ 0.02 0.98;
#P comment 506 408 100 196617 Broken up a bit…..;
#P comment 612 465 78 196617 ms -> Hz;
#P comment 554 488 41 196617 Ratio;
#P comment 511 465 78 196617 Invert & offset;
#P comment 573 552 100 196617 Phasor Frequency;
#P newex 607 507 29 196617 t b f;
#P flonum 506 550 65 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 506 529 130 196617 * 1.;
#P comment 542 426 56 196617 SpeedRatio;
#P comment 671 488 58 196617 Hz;
#P comment 421 169 91 196617 ms in one bar…;
#P user number~ 259 383 327 398 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 204 442 284 196617 There can be clicks when the phasor is restarting its phase.;
#P message 310 307 14 196617 0;
#P window linecount 4;
#P comment 366 226 430 196617 This calculates the phasor frequency , – when the speedratio == 1 , the phasor is not moving. The (1000 / $f2) is the conversion from ms -> Hz…… When the phasor is rising , the world is playing in reverse , reason for the -$f1 in expr.;
#P user scope~ 199 456 329 586 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P flonum 607 488 62 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 607 426 62 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 607 448 97 196617 expr (1000. / $f1);
#P flonum 506 488 49 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 506 426 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 506 448 81 196617 expr (-$f1 + 1);
#P comment 421 189 26 196617 ms;
#P flonum 357 188 62 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 259 90 48 196617 loadbang;
#P newex 321 221 29 196617 t b f;
#P newex 259 110 108 196617 t -1. 120.;
#P comment 263 135 59 196617 Speed Retio;
#P user gain~ 97 448 50 104 158 0 1.071519 7.94321 10.;
#P flonum 357 148 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezadc~ 97 188 141 221 0;
#P flonum 259 148 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 259 280 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P newex 259 246 91 196617 expr (-$f1 + 1) * (1000. / $f2);
#P window linecount 1;
#P newex 259 348 52 196617 *~ 3200.;
#P newex 259 307 45 196617 phasor~;
#P newex 357 167 60 196617 !/ 240000.;
#P newex 97 383 55 196617 tapout~ 0.;
#P newex 97 348 65 196617 tapin~ 3200.;
#P user ezdac~ 97 604 141 637 0;
#P comment 362 135 26 196617 BPM;
#P window linecount 2;
#P comment 364 300 423 196617 The Phasor is reading thru the delay buffer , from “the now” and back to the beginning of the delay buffer. i.e. the time defined as ms above.;
#P window linecount 1;
#P comment 671 426 100 196617 ms;
#P fasten 43 0 44 1 337 408 127 408;
#P connect 43 0 45 0;
#P fasten 7 0 27 0 264 329 204 329;
#P connect 7 0 8 0;
#P fasten 7 0 43 0 264 329 337 329;
#P connect 44 0 14 0;
#P connect 5 0 44 0;
#P fasten 8 0 5 0 264 372 102 372;
#P connect 8 0 31 0;
#P connect 14 0 3 0;
#P connect 14 0 3 1;
#P connect 23 0 35 0;
#P connect 35 0 36 0;
#P connect 37 1 35 1;
#P fasten 37 0 35 0 612 526 511 526;
#P connect 26 0 37 0;
#P connect 29 0 7 1;
#P connect 24 0 26 0;
#P connect 25 0 24 0;
#P connect 21 0 23 0;
#P connect 22 0 21 0;
#P connect 4 0 5 0;
#P connect 9 0 10 0;
#P connect 10 0 7 0;
#P connect 13 0 6 0;
#P connect 11 0 9 0;
#P connect 12 0 4 0;
#P connect 17 1 9 1;
#P fasten 17 0 9 0 326 241 264 241;
#P connect 16 0 11 0;
#P connect 16 1 13 0;
#P connect 18 0 16 0;
#P connect 6 0 19 0;
#P fasten 19 0 17 0 362 213 326 213;
#P fasten 19 0 8 1 362 341 306 341;
#P fasten 19 0 4 0 362 341 102 341;
#P window clipboard copycount 46;

#109681
Aug 1, 2007 at 3:48am

Thanks again for all this spleef. I guess I’m still not understanding why running the phasor and multiplying it by the tapin~ buffer amount — giving a ramping of 0-3200 over a period of time — will cause the buffer to be read backwards. I also don’t get why there is no crossover of the buffer being written forwards while it is being read backwards. I tried to account for this in my patch by having 2 buffers. I think there is something fundamental I am missing here!

#109682

You must be logged in to reply to this topic.