Spatial Additive in SC & Reaper I

The following example creates a spatially distributed sound through additive synthesis in a hybrid approach. A defined number (16) of partials is creatged in SC and routed to individual virtual sound sources in an encoder in Reaper:

/images/spatial/first_additive_spectral.png

Synthesis in SC > encoding & decoding in the DAW.


Make sure SC has enough output buses:

(
// increase the number of SC output channels
s.options.numInputBusChannels  = 0;
s.options.numOutputBusChannels = 16;

s.boot;

// show SC meter
s.meter;
)

A Partial SynthDef

A SynthDef for a single partial with amplitude and frequency as arguments. In addition, the output bus can be set. The sample rate is considered to avoid aliasing for high partial frequencies.

(
SynthDef(\spatial_additive,

      {
              |outbus = 0, freq=100, amp=1|

              // anti aliasing safety
              var gain = amp*(freq<(SampleRate.ir*0.5));

              var sine = gain*SinOsc.ar(freq);

              Out.ar(outbus, sine);

      }
).send;
)

The Partial Synths

Create an array with 16 partial Synths, using integer multiple frequencies of 100 Hz. All synths are added to a dedicated group to ease control over the node order.

(
~npart         = 16;
~partials = Array.fill(40,
{ arg i;
  Synth(\spatial_additive, [\outbus, i, \freq, 100*(i+1),\amp, 1/(1+i*~npart*0.1)],~partial_GROUP)
});
s.scope(16,0);
)

Each partial gets its own output in SC, with decreasing amplitude towards higher partials:

/images/spatial/partials_meter.png

SC meter: each output holds a single partial.


The Encoder

Encoding happens in a multi encoder with 16 sources. In the first static example, they are equally distributed in the plane. Make sure that Reaper has enough input channels (set in Preferences>Audio>Device) and that the channel gets all 16-channels from SC.

/images/spatial/multi_encoder_16.png

16-channel multi encoder.

(In the case of spatial additive synthesis it makes sense to have distance encoded to increase the level of spectral variation.)