- /* panner width control is [-1.0 .. 1.0]; we ignore sign, and map to [0 .. 360] degrees
- so that a width of 1 corresponds to a signal equally present from all directions,
- and a width of zero corresponds to a point source from the "center" (above) point
- on the perimeter of the speaker array.
- */
-
- double w = fabs (_pannable->pan_width_control->get_value()) * 360.0;
-
- double min_dir = center - (w/2.0);
- if (min_dir < 0) {
- min_dir = 360.0 + min_dir; // its already negative
- }
- min_dir = max (min (min_dir, 360.0), 0.0);
-
- double max_dir = center + (w/2.0);
- if (max_dir > 360.0) {
- max_dir = max_dir - 360.0;
- }
- max_dir = max (min (max_dir, 360.0), 0.0);
-
- if (max_dir < min_dir) {
- swap (max_dir, min_dir);
- }
-
- double degree_step_per_signal = (max_dir - min_dir) / (_signals.size() - 1);
- double signal_direction = min_dir;
-
- if (w >= 0.0) {
-
- /* positive width - normal order of signal spread */
-
- for (vector<Signal*>::iterator s = _signals.begin(); s != _signals.end(); ++s) {
-
- Signal* signal = *s;
-
- signal->direction = AngularVector (signal_direction, 0.0);
- compute_gains (signal->desired_gains, signal->desired_outputs, signal->direction.azi, signal->direction.ele);
- signal_direction += degree_step_per_signal;
- }
- } else {