part of revolution with [line~]

May 30, 2006 at 4:15pm

part of revolution with [line~]

Hello,

First, I would like to say I really agree with one of the stickies, that’s a shame that people forward private mails from the forum, it’s really annoying.

Second, I would like to ask you something (and I will not spam you with it) about the use of [line~]. Nowadays, I try to build a patch based on “pan4S-help”(which you could know if you are interested in spatialisation of the sound). And, in it, [line~] allows to inject values in [pan4S], so that it is both possible to chose one in 4 speakers (left, right, left rear, right rear), and to make revolutions of the sound between them.

Make a revolution interests me a lot, but I need to make it more accurate, to make, for instance, a half or a quarter of a revolution. I managed to make it in clockwise but not counterclockwise… so what are the three or four arguments I can “inject” as values into an [line~] object ?

Apologies for my english if it is not good (I am french and not very used to writing english).
Cheers

Manu

#26217
May 30, 2006 at 4:52pm

Your english is better than my french will ever be.

Send line~ a list in doubles:
Value[0] duration[0] value[1] duration[1] … Value[n] duration[n]

Like this;
[pack 1 100 0 500 1 1000 0 10]

If clockwise looks like this:
0 0 1 1000, (jump to value 0. move to value 1. over 1000 ms)
then counter-clockwise would look like this:
1 0 0 1000, (jump to value 1. move to value 0. over 1000 ms)

hth
-lcc

#77979
May 30, 2006 at 5:20pm

If you want to make revolving sounds, this will be much easier with
ambisonic technique – panning over four speakers can never be ideal.
There are some ambisonic objects around, but for simple revolves you
can knock up a quick patcher. Here are three small abstractions I
keep handy:

2sfcreate~ creates a 2d soundfield, with X, Y and W components in b-
format. You can input either a rotation speed or an absolute position
in degrees (use line on this to create you precise arcs.

max v2;
#N vpatcher 64 74 422 429;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 144 295 55 196617 send~ sfw;
#P newex 87 295 53 196617 send~ sfy;
#P newex 30 295 53 196617 send~ sfx;
#P newex 144 271 52 196617 *~ 0.707;
#P newex 87 271 27 196617 *~;
#P newex 30 271 27 196617 *~;
#P newex 104 234 34 196617 *~ 1.;
#P newex 47 234 34 196617 *~ 1.;
#P newex 158 176 45 196617 +~ 0.75;
#P newex 104 199 39 196617 cycle~;
#P newex 47 199 39 196617 cycle~;
#P newex 118 131 39 196617 / 360.;
#P newex 158 154 45 196617 phasor~;
#P newex 118 110 50 196617 route set;
#P comment 237 90 47 196617 distance;
#P comment 139 88 47 196617 rotation;
#P inlet 216 89 15 0;
#P inlet 118 87 15 0;
#P inlet 30 87 15 0;
#P window linecount 2;
#P comment 29 53 177 196617 position a sound in a 2 dimensional
soundfield and create b-format signal;
#P window linecount 1;
#P comment 52 88 47 196617 signal in;
#P comment 237 105 100 196617 0. – 1. default = 1.;
#P window setfont “Sans Serif” 14.;
#P comment 30 30 87 196622 2sfcreate~;
#P window setfont “Sans Serif” 9.;
#P window linecount 8;
#P comment 236 127 100 196617 For rotation , send either a rotation
speed in Hz (positive = clockwise , negative = anticlockwise) or
“set” position in degrees.;
#P window linecount 2;
#P comment 202 287 100 196617 output b-format to 2sfmixrot~;
#P fasten 6 0 19 0 35 262 35 262;
#P connect 19 0 22 0;
#P connect 14 0 17 0;
#P connect 17 0 19 1;
#P fasten 8 0 17 1 221 223 76 223;
#P fasten 12 0 14 1 81 171;
#P fasten 6 0 20 0 35 262 92 262;
#P connect 20 0 23 0;
#P connect 15 0 18 0;
#P connect 18 0 20 1;
#P connect 7 0 11 0;
#P connect 11 0 13 0;
#P fasten 8 0 18 1 221 223 133 223;
#P fasten 16 0 15 1 138 193 138 202;
#P fasten 6 0 21 0 35 262 149 262;
#P connect 21 0 24 0;
#P connect 11 1 12 0;
#P connect 12 0 16 0;
#P fasten 13 0 12 1 123 151 198 151;
#P pop;

2sfmixrot~ mixes several soundfields together, and allows you to
rotate the whole of the resulting soundfield.

max v2;
#N vpatcher 543 92 1004 475;
#P outlet 321 339 15 0;
#P outlet 85 339 15 0;
#P outlet 28 339 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 85 313 27 196617 +~;
#P newex 28 313 27 196617 -~;
#P newex 85 274 27 196617 *~;
#P newex 28 274 27 196617 *~;
#P newex 321 92 69 196617 receive~ sfw;
#P newex 142 90 65 196617 receive~ sfy;
#P newex 28 90 65 196617 receive~ sfx;
#P newex 199 274 27 196617 *~;
#P newex 142 274 27 196617 *~;
#P newex 270 205 45 196617 +~ 0.75;
#P newex 216 228 39 196617 cycle~;
#P newex 159 228 39 196617 cycle~;
#P newex 230 160 39 196617 / 360.;
#P newex 270 183 45 196617 phasor~;
#P newex 230 139 50 196617 route set;
#P comment 251 117 47 196617 rotation;
#P inlet 230 116 15 0;
#P window linecount 2;
#P comment 36 60 120 196617 mix b-format signals and rotate whole
soundfield;
#P window setfont “Sans Serif” 14.;
#P window linecount 1;
#P comment 37 37 87 196622 2sfmixrot~;
#P window setfont “Sans Serif” 9.;
#P window linecount 8;
#P comment 340 119 100 196617 For rotation , send either a rotation
speed in Hz (positive = clockwise , negative = anticlockwise) or
“set” position in degrees.;
#P window linecount 3;
#P comment 214 72 100 196617 mix b-format signals from 2sfcreate~
objects;
#P connect 14 0 17 0;
#P connect 17 0 19 0;
#P connect 19 0 21 0;
#P fasten 9 0 17 1 50 245;
#P fasten 12 0 19 1 147 297 50 297;
#P fasten 14 0 18 0 33 261 90 261;
#P connect 18 0 20 0;
#P connect 20 0 22 0;
#P fasten 10 0 18 1 221 253 107 253;
#P fasten 13 0 20 1 204 306 107 306;
#P connect 15 0 12 0;
#P connect 9 0 12 1;
#P fasten 7 0 9 1 193 200;
#P fasten 15 0 13 0 147 264 204 264;
#P connect 10 0 13 1;
#P connect 4 0 6 0;
#P connect 6 0 8 0;
#P fasten 11 0 10 1 250 222 250 231;
#P connect 6 1 7 0;
#P connect 7 0 11 0;
#P fasten 8 0 7 1 235 180 310 180;
#P connect 16 0 23 0;
#P pop;

2sfdecode4~ decodes the b-format for a square four speaker setup – it
is easy to adapt for other speaker arrays.

max v2;
#N vpatcher 206 427 559 756;
#P outlet 252 270 15 0;
#P outlet 179 270 15 0;
#P outlet 106 270 15 0;
#P outlet 33 270 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 260 106 44 196617 W signal;
#P comment 159 106 44 196617 Y signal;
#P window linecount 2;
#P comment 43 67 120 196617 decode b-format signal for 4 speakers;
#P window setfont “Sans Serif” 14.;
#P window linecount 1;
#P comment 43 44 101 196622 2sfdecode4~;
#P window setfont “Sans Serif” 9.;
#P newex 252 245 27 196617 +~;
#P newex 179 245 27 196617 +~;
#P newex 106 245 27 196617 +~;
#P newex 33 245 27 196617 +~;
#P newex 252 213 52 196617 *~ 0.707;
#P newex 179 213 52 196617 *~ 0.707;
#P newex 106 213 52 196617 *~ 0.707;
#P newex 33 213 52 196617 *~ 0.707;
#P newex 252 191 27 196617 +~;
#P newex 179 191 27 196617 +~;
#P newex 106 191 27 196617 +~;
#P newex 33 191 27 196617 +~;
#P newex 139 140 39 196617 *~ -1.;
#P newex 61 140 39 196617 *~ -1.;
#P inlet 308 105 15 0;
#P inlet 139 105 15 0;
#P inlet 33 105 15 0;
#P comment 53 106 44 196617 X signal;
#P comment 33 290 233 196617 Left front — Right front — Left rear
– Right rear;
#P connect 2 0 7 0;
#P connect 7 0 11 0;
#P connect 11 0 15 0;
#P connect 15 0 23 0;
#P fasten 3 0 7 1 144 133 55 133;
#P fasten 4 0 15 1 313 237 55 237;
#P fasten 2 0 5 0 38 128 66 128;
#P fasten 2 0 8 0 38 169 111 169;
#P connect 8 0 12 0;
#P connect 12 0 16 0;
#P connect 16 0 24 0;
#P fasten 6 0 8 1 144 178 128 178;
#P fasten 4 0 16 1 313 237 128 237;
#P fasten 3 0 6 0 144 133 144 133;
#P fasten 5 0 9 0 66 163 184 163;
#P connect 9 0 13 0;
#P connect 13 0 17 0;
#P connect 17 0 25 0;
#P fasten 3 0 9 1 144 133 201 133;
#P fasten 4 0 17 1 313 237 201 237;
#P fasten 5 0 10 0 66 163 257 163;
#P connect 10 0 14 0;
#P connect 14 0 18 0;
#P connect 18 0 26 0;
#P fasten 6 0 10 1 144 178 274 178;
#P fasten 4 0 18 1 313 237 274 237;
#P pop;

The formulae are all in an article by Dave Malham and Tony Myatt in
CMJ Vol 19, No 4

Hope that helps

Lawrence

#77980
May 30, 2006 at 5:22pm

thanks, but I am aware that French is pretty hard to practice, particularly when it’s written. Whatever, I haven’t expected an answer that quick !
But, a problem remains because I have no brains. I am not sure to understand the “logic” of the difference clockwise and counterclockwise.
For these two lists you took as an example :
0 0 1 1000
1 0 0 1000
is the second one counterclockwise because it is the opposite as the first one (100 would be the opposite of 001) ? And if it is, why a 0 is needed at the beginning of “001″ and at the end of “100″ ?

Cheers,
sorry if I bother you
Manu

#77981
May 30, 2006 at 5:47pm

Thank you, it could be useful, but could you just answer to my question please ? (I am curious)

thx
Manu

#77982
May 30, 2006 at 6:13pm

Ah yes.

So if a line~ out puts a ramp starting at a value of zero and moving to a
value of one, and that drives a clockwise panning curve, then it could be
safe to assume that a line~ which outputs a ramp starting at a value of one
and moving to a value of zero will drive a counterclockwise panning curve.

About that 0 0 and 1 0 part of the list. This is used to make line~ jump to
that value with out interpolation. This guarantees that the ramp which
line~ generates will start at a specific location, rather than interpolating
from wherever its current location might be.

There may be some tutorials on the line~ object in the MSP documentation.
They may be worth reviewing for this project.

-lcc

#77983
May 31, 2006 at 3:07pm

thank you very much :)

#77984

You must be logged in to reply to this topic.