dislocated_spaces/liveelec/pd/rcvbap

296 lines
8.6 KiB
Plaintext
Executable File

#N canvas 91 177 1287 722 10;
#X declare -lib hexloader -lib iemmatrix;
#X floatatom 123 220 5 0 0 2 azi - -;
#X floatatom 536 -19 5 0 0 2 ele - -;
#X floatatom 211 220 5 0 100 2 spread - -;
#X text 902 262 In two dimensions \, only specify the azimuth. (for
example "define_loudspeakers 2 -45 45 0 180";
#X text 63 21 VBAP and define_loudspeakers;
#X text 904 399 The spread-parameter can be used to prevent a situation
where sound is coming from one speaker only \, which would make speaker
positions "visible". The range is 0 to 100;
#X text 620 99 actual location;
#X floatatom 597 3 5 1 20 2 dist - -;
#X text 902 172 1) Use define_loudspeakers to list the speaker positions.
The example here defines loudspeakers in three dimensions (the first
parameter). For each speaker \, define its azimuth and elevation. Here
we have speakers front left and right with no elevation (-45 0 45 0)
and front and back with 45 degrees of elevation (0 45 180 45). Send
the data to vbap.;
#X floatatom 548 70 5 0 0 3 azi - -;
#X floatatom 592 70 5 0 0 3 ele - -;
#X floatatom 636 70 5 0 0 3 spread - -;
#X floatatom 689 71 5 0 0 3 dist - -;
#N canvas 0 22 699 527 sig 0;
#X obj 58 72 line~;
#X msg 58 49 0 \, 10000 5;
#X obj 58 118 cos~;
#X msg 146 70 1;
#X obj 146 47 loadbang;
#X obj 58 95 clip~ 0 0.25;
#X obj 251 134 line~;
#X obj 251 157 cos~;
#X msg 324 54 -0.25 \, 0.25 100;
#X obj 251 8 loadbang;
#X msg 251 31 -0.25;
#X obj 251 203 *~;
#X obj 58 140 hip~ 5;
#X msg 324 77 -0.25 \, 0.25 400;
#X floatatom 324 145 0 0 0 0 - - -;
#X obj 324 191 osc~ 440;
#X obj 324 168 mtof;
#X msg 324 31 -0.25 \, 0.25 20;
#X obj 251 180 *~ 0.1;
#X msg 324 100 -0.25 \, 0.25 1000;
#X msg 324 144 -0.25 \, 0.25 2000;
#X obj 324 226 *~;
#X obj 342 252 *~;
#X msg 324 8 0;
#X obj 308 257 *~;
#X obj 58 26 metro 2000;
#X floatatom 58 4 0 0 0 0 - - -;
#X text 1 51 impulse;
#X text 362 7 tone;
#X obj 59 184 outlet~;
#X obj 170 6 inlet;
#X obj 442 18 metro 500;
#X obj 91 8 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X connect 0 0 5 0;
#X connect 1 0 0 0;
#X connect 2 0 12 0;
#X connect 3 0 0 0;
#X connect 4 0 3 0;
#X connect 5 0 2 0;
#X connect 6 0 7 0;
#X connect 7 0 18 0;
#X connect 8 0 6 0;
#X connect 9 0 10 0;
#X connect 10 0 6 0;
#X connect 11 0 12 0;
#X connect 12 0 29 0;
#X connect 13 0 6 0;
#X connect 14 0 16 0;
#X connect 15 0 11 1;
#X connect 15 0 21 0;
#X connect 15 0 21 1;
#X connect 15 0 22 0;
#X connect 16 0 15 0;
#X connect 17 0 6 0;
#X connect 18 0 11 0;
#X connect 19 0 6 0;
#X connect 20 0 6 0;
#X connect 21 0 22 1;
#X connect 21 0 11 1;
#X connect 21 0 24 0;
#X connect 21 0 24 1;
#X connect 22 0 11 1;
#X connect 23 0 6 0;
#X connect 24 0 11 1;
#X connect 25 0 1 0;
#X connect 26 0 25 0;
#X connect 30 0 31 0;
#X connect 31 0 8 0;
#X connect 32 0 25 0;
#X restore 548 234 pd sig;
#X obj 548 206 tgl 24 0 empty empty test-sigs 26 7 1 10 -262144 -1
-1 0 1;
#X obj 504 177 mtx 8 1;
#N canvas 346 244 547 360 set-element 0;
#X obj 70 81 unpack 0 0;
#X obj 70 104 + 1;
#X obj 70 137 pack 0 1 0;
#X obj 70 179 list trim;
#X obj 70 158 list prepend element;
#X obj 70 59 inlet;
#X obj 70 261 outlet;
#X obj 70 221 t b a;
#X text 48 33 transforms rvbap-output to be used with [mtx] from iemmatrix
;
#X connect 0 0 1 0;
#X connect 0 1 2 2;
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 5 0 0 0;
#X connect 7 0 6 0;
#X connect 7 1 6 0;
#X restore 504 153 pd set-element;
#N canvas 181 626 802 273 peek 0;
#X floatatom 55 198 10 0 0 0 - - -;
#X floatatom 134 198 10 0 0 0 - - -;
#X floatatom 213 198 10 0 0 0 - - -;
#X floatatom 292 198 10 0 0 0 - - -;
#X obj 55 74 route 0 1 2 3 4 5 6 7;
#X floatatom 366 197 10 0 0 0 - - -;
#X floatatom 445 197 10 0 0 0 - - -;
#X floatatom 524 197 10 0 0 0 - - -;
#X floatatom 603 197 10 0 0 0 - - -;
#X obj 55 49 inlet;
#X connect 4 0 0 0;
#X connect 4 1 1 0;
#X connect 4 2 2 0;
#X connect 4 3 3 0;
#X connect 4 4 5 0;
#X connect 4 5 6 0;
#X connect 4 6 7 0;
#X connect 4 7 8 0;
#X connect 9 0 4 0;
#X restore 518 127 pd peek;
#X floatatom 590 256 5 0 0 1 interp - -;
#N canvas 1 96 450 300 tba 0;
#X obj 143 51 inlet;
#X obj 96 49 inlet;
#X obj 191 51 inlet;
#X obj 238 51 inlet;
#X obj 173 180 outlet;
#X obj 61 178 outlet;
#X obj 221 180 outlet;
#X obj 268 180 outlet;
#X obj 126 180 outlet;
#X obj 96 73 t b a;
#X obj 143 72 t b a;
#X obj 191 72 t b a;
#X obj 238 72 t b a;
#X connect 0 0 10 0;
#X connect 1 0 9 0;
#X connect 2 0 11 0;
#X connect 3 0 12 0;
#X connect 9 0 5 0;
#X connect 9 1 8 0;
#X connect 10 0 5 0;
#X connect 10 1 4 0;
#X connect 11 0 5 0;
#X connect 11 1 6 0;
#X connect 12 0 5 0;
#X connect 12 1 7 0;
#X restore 525 5 pd tba;
#X obj 601 -29 hsl 64 15 1 20 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X text 903 76 rvbap is almost compatible to;
#X obj 504 288 mtx_*~ 8 1 20;
#X text 905 96 Additionally it generates additional commands for controlling
a reverberated signal and has control to set the radial distance of
a sound.;
#X text 904 458 3) rvbap also will generate messages to control the
amount of reverberated signal to generate. This is meant to be used
with [matrix~] or [mtx_*~] from the IEMmatrix collection of externals.
;
#X text 905 316 2) For rvbap \, give azimuth and elevation and a distance
(1-inf \, default 1) for the desired location. Bang the first inlet
and vbap will output gain-factors for each speaker and the actual location
produced. This can be different from the desired one depending where
your speakers are.;
#X text 907 650 See rvbap-demo.pd for a more complex setup.;
#X text 903 528 To use it \, create a [mtx_*~] object that has double
the amount of outlets as you have speakers. Send the first half of
the matrix-signals to the speakers and the second half through a reverbarator
and add them to the respective speaker outs. The example shows this
in action for four speakers. Pay attention to the "set-element" subpatch
which translates the [rvbap] output to set matrix elements correctly.
;
#X text 582 128 <= here's the output of [rvbap];
#X obj 1084 76 pddp/helplink vbap;
#X obj 1107 38 import hexloader iemmatrix;
#X obj 411 171 inlet~;
#X obj 504 39 vbap 0 0;
#X msg 459 -144 bang;
#X obj 495 511 dac~ 1 2 3 4 5 6 7 8;
#X obj 497 -177 loadbang;
#X obj 370 374 gainvu~;
#X obj 186 118 vu 8 80 empty empty -1 -8 0 4 -66577 -1 1 0;
#X obj 198 118 vu 8 80 empty empty -1 -8 0 4 -66577 -1 1 0;
#X obj 162 118 vu 8 80 empty empty -1 -8 0 4 -66577 -1 1 0;
#X obj 174 118 vu 8 80 empty empty -1 -8 0 4 -66577 -1 1 0;
#X obj 234 118 vu 8 80 empty empty -1 -8 0 4 -66577 -1 1 0;
#X obj 246 118 vu 8 80 empty empty -1 -8 0 4 -66577 -1 1 0;
#X obj 210 118 vu 8 80 empty empty -1 -8 0 4 -66577 -1 1 0;
#X obj 222 118 vu 8 80 empty empty -1 -8 0 4 -66577 -1 1 0;
#X obj 419 374 gainvu~;
#X obj 467 374 gainvu~;
#X obj 516 374 gainvu~;
#X obj 567 373 gainvu~;
#X obj 616 373 gainvu~;
#X obj 664 373 gainvu~;
#X obj 713 373 gainvu~;
#X obj 684 195 noise~;
#X obj 123 118 vsl 33 80 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 6220 1;
#X obj 724 333 f;
#X obj 260 366 init 100;
#X msg 191 411 100;
#X obj 18 494 pack f f;
#X floatatom 18 542 5 0 0 0 - - -;
#X obj 18 339 grid grid1 144 0 1 144 0 1 0 0 0 10 10 93 395;
#X floatatom 118 542 5 0 0 0 - - -;
#X obj 18 519 graph-to-aziele;
#X obj 484 -92 define_loudspeakers 2 -45 0 45 90 135 180 -135 -90;
#X connect 0 0 19 0;
#X connect 1 0 19 1;
#X connect 2 0 19 2;
#X connect 7 0 19 3;
#X connect 13 0 22 1;
#X connect 14 0 13 0;
#X connect 15 0 22 0;
#X connect 16 0 15 0;
#X connect 18 0 22 2;
#X connect 19 0 32 0;
#X connect 19 1 32 1;
#X connect 19 2 32 2;
#X connect 19 3 32 3;
#X connect 20 0 7 0;
#X connect 22 0 36 0;
#X connect 22 1 45 0;
#X connect 22 2 46 0;
#X connect 22 3 47 0;
#X connect 22 4 48 0;
#X connect 22 5 49 0;
#X connect 22 6 50 0;
#X connect 22 7 51 0;
#X connect 31 0 22 1;
#X connect 32 0 16 0;
#X connect 32 0 17 0;
#X connect 32 1 9 0;
#X connect 32 2 10 0;
#X connect 32 3 11 0;
#X connect 33 0 62 0;
#X connect 35 0 62 0;
#X connect 36 0 34 0;
#X connect 36 2 39 0;
#X connect 45 0 34 1;
#X connect 45 2 40 0;
#X connect 46 0 34 2;
#X connect 46 2 37 0;
#X connect 47 0 34 3;
#X connect 47 2 38 0;
#X connect 48 0 34 4;
#X connect 48 2 43 0;
#X connect 49 0 34 5;
#X connect 49 2 44 0;
#X connect 50 0 34 6;
#X connect 50 2 41 0;
#X connect 51 0 34 7;
#X connect 51 2 42 0;
#X connect 52 0 22 1;
#X connect 53 0 54 0;
#X connect 54 0 36 1;
#X connect 54 0 45 1;
#X connect 54 0 46 1;
#X connect 54 0 47 1;
#X connect 54 0 48 1;
#X connect 54 0 49 1;
#X connect 54 0 50 1;
#X connect 54 0 51 1;
#X connect 55 0 53 0;
#X connect 56 0 53 0;
#X connect 57 0 61 0;
#X connect 59 0 57 0;
#X connect 59 1 57 1;
#X connect 61 0 58 0;
#X connect 61 0 0 0;
#X connect 61 1 60 0;
#X connect 61 1 2 0;
#X connect 62 0 32 0;
#X coords 0 -1 1 1 240 140 1 100 100;