Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplayAz behaviour doesn't match documentation #1059

Closed
telephon opened this issue Mar 14, 2014 · 3 comments
Closed

SplayAz behaviour doesn't match documentation #1059

telephon opened this issue Mar 14, 2014 · 3 comments
Labels
comp: help schelp documentation

Comments

@telephon
Copy link
Member

It would be good if someone who has used SplayAz a lot could review this. It came up when fixing #1045, but (to all what I can see) hasn't been caused by it.

The helpfile says:

s.options.numOutputBusChannels = 8;
s.reboot;
(
x = { arg spread=1, level=0.2, width=2, center=0.0;
 SplayAz.ar(
  4,
  SinOsc.ar( { |i| LFNoise2.kr( rrand(10, 20), 200, i + 3 * 100) } ! 10),
  spread,
  level,
  width,
  center
 );
}.scope;
)

x.set(\spread, 1,   \center, 0);  // full n chans
x.set(\spread, 0.5, \center, -0.25); // less wide
x.set(\spread, 0, \center, 0);  // mono center (depends on orientation, see PanAz)
x.set(\spread, 0, \center, -0.25); //
x.set(\spread, 0.0, \center, 0.5); // mono, but rotate 1 toward the higher channels
x.set(\spread, 0.5, \center, 0.5); // spread over the higher channels
x.set(\spread, 0,   \center, -0.25); // all on first channel
x.set(\spread, 1,   \center, 0);  // full n chans

This seems not to be what really happens. Is the documentation wrong?

@LucaDanieli
Copy link
Contributor

If I remember well, SplayAz takes the input array and set the position of each signal through this expression:

var pos = [ center - spread, center + spread ].resamp1(n);

so, if n = Array.size = 4 ---> pos = [center-spread, center-spread/3, center+ spread/3, center+spread].
if n = Array.size = 3 ---> pos = [center-spread, center, center+spread](because pos[1] is the mean between) and spread does not affect pos[1].

Given the instant position of any signal, it make the sum of each output.

So, with an Array of size 2, with spread=0, the signals move together:

(
x = { arg spread=1, level=1, width=2, center=0.0;
 b = Array.new(3);
 b.add(SinOsc.ar(300, 0, 1));
 b.add(Saw.ar(300, 1));
 SplayAz.ar(
  8,
  b,
  spread = 0,
  level,
  width,
  center = SinOsc.kr(0.1), levelComp: false
 );
}.scope;
)

and, with a varying spread, the signals move in opposite directions, one spreading over the left side and the other over the right one.

(
x = { arg spread=0, level=1, width=2, center=0.0;
 b = Array.new(3);
 b.add(SinOsc.ar(300, 0, 1));
 b.add(Saw.ar(300, 1));
 SplayAz.ar(
  8,
  b,
  spread = SinOsc.kr(0.1),
  level,
  width,
  center = 0, levelComp: false
 );
}.scope;
)

Here, of course, we have a Sinusoidal control, therefore there is this accordion effect.
Any way, when pos = 1 or pos = -1, the signal Array[i] is sent to (output.size/2 + i).

@telephon
Copy link
Member Author

Ok, now if, as you say:

so, if n = Array.size = 4 ---> pos = [center-spread, center-spread/3, center+ spread/3, center+spread].
if n = Array.size = 3 ---> pos = [center-spread, center, center+spread](because pos[1] is the mean between) and spread does not affect pos[1].

Each pos is then interpreted as a position in PanAz (which are summed up for each channel).

^PanAz.ar(numChans, inArray.asArray, pos, level, width, orientation).flop.collect(Mix(_))

OK, so spread relates to the position range of the PanAz [-1...1]

@telephon
Copy link
Member Author

telephon commented Apr 6, 2014

Improved documentation.

@telephon telephon closed this as completed Apr 6, 2014
@crucialfelix crucialfelix added the comp: help schelp documentation label Jan 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: help schelp documentation
Projects
None yet
Development

No branches or pull requests

3 participants