[maxmsp] a modified pan4S abstraction, and questions
Samuel Freeman
samuel.freeman at gmail.com
Tue Sep 4 04:08:16 MDT 2007
- Previous message: [maxmsp] a modified pan4S abstraction, and questions
- Next message: [maxmsp] Re: a modified pan4S abstraction, and questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
save this as pan4Szx and use in place of pan4Sz: #P window setfont "Fixedwidth Serif" 10.; #P window linecount 1; #P message 292 98 82 1441802 set pan4.aif; #B color 1; #P window setfont "Sans Serif" 9.; #P comment 472 34 133 196617 minimum amplitude (0.- 1.); #N comlet minimum amplitude (0.- 1.); #P inlet 455 34 15 0; #P comment 308 34 136 196617 Width of waveform (0. - 1.); #N comlet width of sound (0. - 1.); #P inlet 292 34 15 0; #N vpatcher 909 157 1169 516; #P outlet 32 229 15 0; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 127 220 27 196617 t b f; #P newex 17 58 27 196617 f; #P window linecount 2; #P comment 144 196 97 196617 minimum amplitude (0. - 1.); #P window linecount 1; #P newex 34 28 69 196617 loadmess 0.5; #N comlet minimum amplitude (0.- 1.); #P inlet 127 196 15 0; #P newex 17 80 29 196617 t b f; #P inlet 17 28 15 0; #P newex 131 104 41 196617 * 512.; #P newex 131 171 98 196617 expr (512-$i1) + 1; #P window linecount 0; #P newex 131 127 98 196617 expr (512-$i1) / 2; #P newex 17 316 113 196617 buffer~ pan4.aif 11.61; #P newex 17 293 75 196617 peek~ pan4.aif; #N counter 0 0 512; #X flags 0 0; #P newobj 17 171 108 196617 counter 0 0 512; #P newex 17 128 107 196617 t 513 b clear; #P newex 17 149 40 196617 Uzi 10; #P newex 17 194 56 196617 t i i; #P newex 17 270 56 196617 pack 0 0.; #N vpatcher 337 144 748 548; #N comlet minimum amplitude (0. - 1.); #P inlet 227 33 15 0; #P window setfont "Sans Serif" 9.; #P newex 227 94 67 196617 expr 512 - $i1; #P newex 227 68 87 196617 scale 0. 1. 0 256; #P newex 299 94 86 196617 expr sqrt($i1/256.); #P newex 22 333 47 196617 * 0.001; #P newex 208 196 27 196617 0.; #P newex 208 116 20 196617 t b; #P newex 22 94 196 196617 if $i1>=$i2 && $i1<=$i3 then $i1 else out2 $i1; #P inlet 47 33 15 0; #P newex 22 165 136 196617 scale 128 384 0 512; #P inlet 72 33 15 0; #P newex 72 211 36 196617 - 256; #P newex 72 276 27 196617 -; #P newex 72 253 27 196617 256; #P newex 72 232 27 196617 t b i; #P newex 22 189 60 196617 split 0 256; #P newex 22 309 125 196617 expr (sqrt($i1/256.)) * 1000.; #P outlet 22 362 15 0; #P inlet 22 33 15 0; #P comment 244 33 136 196617 minimum amplitude (0. - 1.); #P connect 1 0 12 0; #P connect 12 0 10 0; #P connect 10 0 4 0; #P fasten 7 0 3 0 77 301 27 301; #P connect 4 0 3 0; #P connect 3 0 15 0; #P fasten 14 0 2 0 213 356 27 356; #P connect 15 0 2 0; #P connect 11 0 10 1; #P connect 9 0 10 2; #P connect 4 1 8 0; #P connect 8 0 5 0; #P connect 5 0 6 0; #P connect 6 0 7 0; #P connect 5 1 7 1; #P connect 17 0 10 3; #P connect 11 0 12 1; #P connect 18 0 10 4; #P connect 9 0 12 2; #P connect 12 1 13 0; #P connect 13 0 14 0; #P fasten 16 0 14 1 304 153 230 153; #P connect 19 0 17 0; #P connect 17 0 18 0; #P fasten 17 0 16 0 232 89 304 89; #P pop; #P newobj 63 247 93 196617 p pan_curve; #B color 12; #P connect 17 0 16 0; #P connect 11 0 16 0; #P connect 14 0 16 0; #P connect 16 0 12 0; #P connect 12 0 4 0; #P connect 4 0 3 0; #P connect 3 0 5 0; #P connect 5 0 2 0; #P connect 2 0 1 0; #P connect 1 0 6 0; #P connect 4 2 7 0; #P lcolor 8; #P connect 3 1 18 0; #P lcolor 2; #P connect 2 1 0 0; #P connect 0 0 1 1; #P connect 4 1 5 2; #P connect 8 0 0 1; #P connect 9 0 0 2; #P connect 13 0 17 0; #P fasten 12 1 10 0 41 100 136 100; #P connect 10 0 8 0; #P connect 8 0 9 0; #P connect 17 1 0 3; #P pop; #P newobj 292 75 85 196617 patcher panCurve; #B color 12; #N vpatcher 10 59 389 309; #P window setfont "Sans Serif" 9.; #P comment 164 182 157 196617 <- it's the way her panpots work; #P comment 30 203 114 196617 speaker 4 = right rear; #P comment 30 188 114 196617 speaker 3 = left rear; #P comment 30 173 114 196617 speaker 2 = right front; #P comment 30 158 114 196617 speaker 1 = left front; #P comment 30 128 244 196617 but when you explain that to the sound engineer \, she'll give you one of those looks...so make it easy:; #P comment 30 109 114 196617 speaker 4 = left rear; #P comment 30 94 114 196617 speaker 3 = right rear; #P comment 30 79 114 196617 speaker 2 = right front; #P comment 30 33 262 196617 when you build a patch to move sounds in a circle or spiral around you \, this numbering system makes sense:; #P comment 30 64 114 196617 speaker 1 = left front; #P comment 176 89 73 196617 <- it's a circle; #P pop; #P newobj 12 293 54 196617 p friends; #B color 12; #P newex 378 157 44 196617 +~ 0.; #P newex 204 157 48 196617 +~ 0.25; #P newex 292 157 44 196617 +~ 0.75; #P newex 286 219 31 196617 *~; #P newex 307 188 79 196617 cycle~ pan4.aif; #N comlet LeftRear Signal Out; #P outlet 200 244 15 0; #P comment 173 262 92 196617 LeftRear Signal Out; #P newex 221 188 81 196617 cycle~ pan4.aif; #P comment 268 262 102 196617 RightRear Signal Out; #N comlet RightRear Signal Out; #P outlet 286 244 15 0; #P newex 200 219 31 196617 *~; #P newex 118 157 44 196617 +~ 0.5; #P newex 112 219 31 196617 *~; #P newex 133 188 81 196617 cycle~ pan4.aif; #N comlet Right Signal Out; #P outlet 112 244 15 0; #P comment 86 262 76 196617 Right Signal Out; #P newex 47 188 81 196617 cycle~ pan4.aif; #P comment 6 262 76 196617 Left Signal Out; #N comlet Left Signal Out; #P outlet 26 244 15 0; #P newex 26 219 31 196617 *~; #N comlet Signal In; #P inlet 26 34 15 0; #P comment 51 34 48 196617 Signal In; #N comlet (SIgnal) Quad Pan (0. - 1.); #P inlet 118 34 15 0; #P comment 134 34 128 196617 (SIgnal) Quad Pan (0. - 1.); #P fasten 1 0 12 0 123 148 123 148; #P fasten 1 0 22 0 123 147 209 147; #P fasten 1 0 21 0 123 147 297 147; #P fasten 1 0 23 0 123 147 383 147; #P connect 23 0 19 1; #P connect 28 0 25 1; #P connect 19 0 20 1; #P connect 30 0 7 0; #P lcolor 2; #P connect 30 0 10 0; #P lcolor 2; #P connect 30 0 16 0; #P lcolor 2; #P connect 30 0 19 0; #P lcolor 2; #P connect 21 0 16 1; #P connect 25 0 30 0; #P lcolor 2; #P connect 26 0 25 0; #P connect 20 0 14 0; #P connect 3 0 4 0; #P fasten 3 0 11 0 31 212 117 212; #P fasten 3 0 13 0 31 212 205 212; #P fasten 3 0 20 0 31 212 291 212; #P connect 16 0 13 1; #P connect 22 0 10 1; #P connect 13 0 18 0; #P connect 10 0 11 1; #P connect 12 0 7 1; #P connect 11 0 9 0; #P connect 7 0 4 1; #P connect 4 0 5 0; #P window clipboard copycount 31; it sends a set message to cycle~s when waveform is remade On 03/09/07, Zachary Seldess <zseldess at hotmail.com> wrote: > > Hello everyone, > > I've attached a modified version of the pan4S abstraction that allows you to change the minimum amplitude of the panned sound (that is, control how quiet the sound is on the opposite side from which it is located - a kind of ambient level of the sound), and the width of the sound as it pans. To do this I'm updating the waveform stored in the buffer~ and accessed via the cycle~s. > > The strange thing is that even though the waveform visually updates (i.e. after making a change, if I double-click on a cycle~ inside I see a new waveform), the sound output isn't affected until I turn the dac off and back on again. Does someone know why this is happening? I can't figure out any other way to get the new waveform to be recognized, again, even though buffer~ does show that the change has registered. > > Here's the abstraction, named pan4Sz: > > max v2; > #N vpatcher 376 158 906 409; > #P window setfont Geneva 9.; > #P window linecount 2; > #P comment 422 156 93 196617 minimum amplitude (0.- 1.); > #N comlet minimum amplitude (0.- 1.); > #P inlet 455 183 15 0; > #P comment 360 129 95 196617 Width of waveform (0. - 1.); > #N comlet width of sound (0. - 1.); > #P inlet 380 183 15 0; > #P window linecount 1; > #N vpatcher 909 157 1169 516; > #P window setfont "Sans Serif" 9.; > #P window linecount 1; > #P newex 127 220 27 131137545 t b f; > #P newex 17 58 27 131137545 f; > #P window linecount 2; > #P comment 144 196 83 131137545 minimum amplitude (0. - 1.); > #P window linecount 1; > #P newex 34 28 69 131137545 loadmess 0.5; > #N comlet minimum amplitude (0.- 1.); > #P inlet 127 196 15 0; > #P newex 17 80 29 131137545 t b f; > #P inlet 17 28 15 0; > #P newex 131 104 41 131137545 * 512.; > #P newex 131 171 98 131137545 expr (512-$i1) + 1; > #P window linecount 0; > #P newex 131 127 98 131137545 expr (512-$i1) / 2; > #P newex 17 316 113 131137545 buffer~ pan4.aif 11.61; > #P newex 17 293 75 131137545 peek~ pan4.aif; > #N counter 0 0 512; > #X flags 0 0; > #P newobj 17 171 108 131137545 counter 0 0 512; > #P newex 17 128 107 131137545 t 513 b clear; > #P newex 17 149 40 131137545 Uzi 10; > #P newex 17 194 56 131137545 t i i; > #P newex 17 270 56 131137545 pack 0 0.; > #N vpatcher 337 144 748 548; > #N comlet minimum amplitude (0. - 1.); > #P inlet 227 33 15 0; > #P window setfont "Sans Serif" 9.; > #P newex 227 94 67 131137545 expr 512 - $i1; > #P newex 227 68 87 131137545 scale 0. 1. 0 256; > #P newex 299 94 86 131137545 expr sqrt($i1/256.); > #P newex 22 333 47 131137545 * 0.001; > #P newex 208 196 27 131137545 0.; > #P newex 208 116 20 131137545 t b; > #P newex 22 94 196 131137545 if $i1>=$i2 && $i1<=$i3 then $i1 else out2 $i1; > #P inlet 47 33 15 0; > #P newex 22 165 136 131137545 scale 128 384 0 512; > #P inlet 72 33 15 0; > #P newex 72 211 36 131137545 - 256; > #P newex 72 276 27 131137545 -; > #P newex 72 253 27 131137545 256; > #P newex 72 232 27 131137545 t b i; > #P newex 22 189 60 131137545 split 0 256; > #P newex 22 309 125 131137545 expr (sqrt($i1/256.)) * 1000.; > #P outlet 22 362 15 0; > #P inlet 22 33 15 0; > #P comment 244 33 136 131137545 minimum amplitude (0. - 1.); > #P connect 1 0 12 0; > #P connect 12 0 10 0; > #P connect 10 0 4 0; > #P connect 4 0 3 0; > #P fasten 7 0 3 0 77 301 27 301; > #P connect 3 0 15 0; > #P connect 15 0 2 0; > #P fasten 14 0 2 0 213 356 27 356; > #P connect 11 0 10 1; > #P connect 9 0 10 2; > #P connect 4 1 8 0; > #P connect 8 0 5 0; > #P connect 5 0 6 0; > #P connect 6 0 7 0; > #P connect 5 1 7 1; > #P connect 17 0 10 3; > #P connect 11 0 12 1; > #P connect 18 0 10 4; > #P connect 9 0 12 2; > #P connect 12 1 13 0; > #P connect 13 0 14 0; > #P fasten 16 0 14 1 304 153 230 153; > #P connect 19 0 17 0; > #P connect 17 0 18 0; > #P fasten 17 0 16 0 232 89 304 89; > #P pop; > #P newobj 63 247 93 131137545 p pan_curve; > #B color 12; > #P connect 14 0 16 0; > #P connect 11 0 16 0; > #P connect 17 0 16 0; > #P connect 16 0 12 0; > #P connect 12 0 4 0; > #P connect 4 0 3 0; > #P connect 3 0 5 0; > #P connect 5 0 2 0; > #P connect 2 0 1 0; > #P connect 1 0 6 0; > #P connect 4 2 7 0; > #P lcolor 8; > #P connect 2 1 0 0; > #P connect 0 0 1 1; > #P connect 4 1 5 2; > #P connect 8 0 0 1; > #P connect 9 0 0 2; > #P connect 13 0 17 0; > #P fasten 12 1 10 0 41 100 136 100; > #P connect 10 0 8 0; > #P connect 8 0 9 0; > #P connect 17 1 0 3; > #P pop; > #P newobj 380 209 85 196617 patcher panCurve; > #B color 12; > #P window setfont "Sans Serif" 9.; > #N vpatcher 10 59 389 309; > #P window setfont "Sans Serif" 9.; > #P comment 164 182 157 131137545 <- it's the way her panpots work; > #P comment 30 203 114 131137545 speaker 4 = right rear; > #P comment 30 188 114 131137545 speaker 3 = left rear; > #P comment 30 173 114 131137545 speaker 2 = right front; > #P comment 30 158 114 131137545 speaker 1 = left front; > #P comment 30 128 244 131137545 but when you explain that to the sound engineer \, she'll give you one of those looks...so make it easy:; > #P comment 30 109 114 131137545 speaker 4 = left rear; > #P comment 30 94 114 131137545 speaker 3 = right rear; > #P comment 30 79 114 131137545 speaker 2 = right front; > #P comment 30 33 262 131137545 when you build a patch to move sounds in a circle or spiral around you \, this numbering system makes sense:; > #P comment 30 64 114 131137545 speaker 1 = left front; > #P comment 176 89 73 131137545 <- it's a circle; > #P pop; > #P newobj 14 209 54 131137545 p friends; > #B color 12; > #P newex 380 73 44 131137545 +~ 0.; > #P newex 206 73 48 131137545 +~ 0.25; > #P newex 294 73 44 131137545 +~ 0.75; > #P newex 288 135 31 131137545 *~; > #P newex 309 104 81 131137545 cycle~ pan4.aif; > #N comlet LeftRear Signal Out; > #P outlet 202 160 15 0; > #P comment 175 178 92 131137545 LeftRear Signal Out; > #P newex 223 104 81 131137545 cycle~ pan4.aif; > #P comment 270 178 102 131137545 RightRear Signal Out; > #N comlet RightRear Signal Out; > #P outlet 288 160 15 0; > #P newex 202 135 31 131137545 *~; > #P newex 120 73 44 131137545 +~ 0.5; > #P newex 114 135 31 131137545 *~; > #P newex 135 104 81 131137545 cycle~ pan4.aif; > #N comlet Right Signal Out; > #P outlet 114 160 15 0; > #P comment 88 178 76 131137545 Right Signal Out; > #P newex 49 104 81 131137545 cycle~ pan4.aif; > #P comment 8 178 76 131137545 Left Signal Out; > #N comlet Left Signal Out; > #P outlet 28 160 15 0; > #P newex 28 135 31 131137545 *~; > #N comlet Signal In; > #P inlet 28 29 15 0; > #P comment 53 29 42 131137545 Signal In; > #N comlet (SIgnal) Quad Pan (0. - 1.); > #P inlet 120 29 15 0; > #P comment 136 29 129 131137545 (SIgnal) Quad Pan (0. - 1.); > #P connect 3 0 4 0; > #P connect 4 0 5 0; > #P connect 7 0 4 1; > #P fasten 3 0 11 0 33 128 119 128; > #P connect 11 0 9 0; > #P fasten 1 0 12 0 125 64 125 64; > #P connect 12 0 7 1; > #P connect 10 0 11 1; > #P fasten 3 0 13 0 33 128 207 128; > #P connect 13 0 18 0; > #P fasten 1 0 22 0 125 63 211 63; > #P connect 22 0 10 1; > #P connect 16 0 13 1; > #P fasten 3 0 20 0 33 128 293 128; > #P connect 20 0 14 0; > #P fasten 1 0 21 0 125 63 299 63; > #P connect 21 0 16 1; > #P connect 19 0 20 1; > #P fasten 1 0 23 0 125 63 385 63; > #P connect 23 0 19 1; > #P connect 26 0 25 0; > #P connect 28 0 25 1; > #P pop; > > ------------------------- > > And here's the parent patch, named whatever: > > max v2; > #N vpatcher 474 96 760 400; > #P window setfont Geneva 9.; > #P window linecount 4; > #P comment 26 24 245 196617 NOTE ON WIDTH \; 0.5 is the minimum recommended width \; (resulting in panning between two channels at time) \; For wider presence increase the value.; > #P window linecount 1; > #P comment 92 107 43 196617 panning; > #P user meter~ 219 219 232 277 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3; > #P user meter~ 164 219 177 277 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3; > #P user meter~ 107 219 120 277 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3; > #P user meter~ 50 219 63 277 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3; > #P hidden newex 151 99 48 196617 loadbang; > #P hidden message 151 116 42 196617 set 0.5; > #P flonum 207 142 35 9 0. 1. 67 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P flonum 95 122 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P newex 95 142 29 196617 sig~; > #P toggle 20 167 15 0; > #P flonum 151 142 35 9 0. 1. 67 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P newex 39 198 180 196617 dac~ 1 2 3 4; > #P newex 39 167 179 196617 pan4Sz; > #P user gain~ 39 103 34 28 158 0 1.071519 7.94321 10.; > #P newex 39 77 61 196617 cycle~ 300; > #P window linecount 2; > #P comment 147 116 48 196617 width of sound; > #P comment 204 116 48 196617 minimum amp; > #P connect 2 0 3 0; > #P connect 3 0 4 0; > #P connect 4 0 5 0; > #P fasten 7 0 5 0 25 189 44 189; > #P connect 4 0 13 0; > #P connect 9 0 8 0; > #P connect 8 0 4 1; > #P connect 4 1 5 1; > #P connect 4 1 14 0; > #P hidden connect 12 0 11 0; > #P hidden connect 11 0 6 0; > #P connect 6 0 4 2; > #P connect 4 2 5 2; > #P connect 4 2 15 0; > #P connect 10 0 4 3; > #P connect 4 3 5 3; > #P connect 4 3 16 0; > #P pop; > > -- > http://www.zacharyseldess.com > > _______________________________________________ > maxmsp mailing list > maxmsp at cycling74.com > http://www.cycling74.com/mailman/listinfo/maxmsp >
- Previous message: [maxmsp] a modified pan4S abstraction, and questions
- Next message: [maxmsp] Re: a modified pan4S abstraction, and questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
