Stereo signals

The primary entities this package deals with are mono signals. However, some basic support for stereo signals is included as well using the stereo operator that clubs two mono signals to make a stereo signal. Such a "stereo" signal behaves like the mixed version when used as an ordinary Signal. However there are other methods that support various operations, including rendering to stereo.

Pick the left/right/mixed channels of a stereo signal using left, right and [mono])@ref). Pan a mono or stereo signal left/right using pan.

Synth.stereoFunction
stereo(left :: SignalWithFanout, right :: SignalWithFanout)
stereo(left :: Signal, right :: Signal)

Makes a "stereo signal" with the given left and right channel signals. The stereo signal is itself considered a signal which produces the mixed output of the left and right channels. However, you can pick out the left and right channels separately using left and right which produce fanout versions of the two components.

Aliasability

Stereo signals are fanout without calling fanout on them. The first method assumes that you're passing in fanout signals (recommended). The second will make them fanout, before storing a reference, so you should subsequently access the individual channels only via the left and right methods.

There is a new value method that works on stereo signals –

value(s::Stereo{L,R}, chan::Int, t, dt)

where chan can be -1 for left, 0 for mixed middle and 1 for right channels. Note that calling value for different channels at the same time won't compute multiple times because Stereo is fanout directly.

The mixer and modulator operators (+/-/*) treat stereo signals as stereo and work accordingly. The other operators all (unless noted) are not cognizant of stereo signals and so you must be explicit with them if you're applying them on stereo signals.

See also: left, right and mono

source
Synth.leftFunction
left(s :: Stereo)
left(s :: Signal)

Picks the left channel of a stereo signal. Evaluates to the signal itself if passed a non-stereo signal (which is considered mono).

See also: right, mono and stereo

source
Synth.rightFunction
right(s :: Stereo)
right(s :: Signal)

Picks the right channel of a stereo signal. Evaluates to the signal itself if passed a non-stereo signal (which is considered mono).

See also: left, mono and stereo

source
Synth.monoFunction
mono(s :: Stereo)
mono(s :: Stereo, panval :: Union{Real,Signal})
mono(s :: Signal)

Converts a stereo signal into a mono signal by mixing the left and right channels. Evaluates to the signal itself if passed a non-stereo signal (which is considered mono).

In the version that takes a pan value, passing 1.0f0 will result in only the right channel being selected. Passing -1.0f0 will result in only the left channel being selected and intermediate values will linearly mix the two channels. You can think of the panval argument as where your ear is being directed. If you direct it to the right, you hear the right channel, and if you direct it to the left, you hear the left channel sound.

See also: left, right and stereo

source
Synth.panFunction
pan(s :: Signal, lr :: Real)
pan(s :: Signal, lr :: Signal)
pan(s :: Stereo{L,R}, lr :: Real) where {L,R}

Pans a mono signal left or right to produce a stereo signal. lr is a signal that takes values in the range [-1.0,1.0] where negative values indicate left and positive values indicate right. So giving 0.0 will centre pan the signal with left and right components receiving equal contributions of the signal.

When applied to a stereo signal, a "left pan" (lr in range [-1,0]) will result in the right signal being moved left and a "right pan" (lr in range [0,1]) will result in the left signal being moved right.

source