All pass delay line with cubic interpolation.
All pass delay line with cubic interpolation.
The input signal.
The maximum delay time in seconds. used to initialize the delay buffer size.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
All pass delay line with linear interpolation.
All pass delay line with linear interpolation.
The input signal.
The maximum delay time in seconds. used to initialize the delay buffer size.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
All pass delay line with no interpolation.
All pass delay line with no interpolation.
The input signal.
The maximum delay time in seconds. used to initialize the delay buffer size.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
An amplitude follower UGen.
An amplitude follower UGen. Tracks and reports the peak amplitude of its input signal.
input signal to be analyzed
60 dB convergence time in for following attacks, in seconds
60 dB convergence time in for following decays, in seconds
An all pass filter UGen.
An all pass filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
input signal to be processed.
cutoff frequency.
the reciprocal of Q, hence bandwidth / cutoffFreq.
An band pass filter UGen.
An band pass filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
input signal to be processed.
center frequency.
the bandwidth in octaves between -3 dB frequencies
An band stop (reject) filter UGen.
An band stop (reject) filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
input signal to be processed.
center frequency.
the bandwidth in octaves between -3 dB frequencies
A 2nd order (12db per oct roll-off) resonant high pass filter UGen.
A 2nd order (12db per oct roll-off) resonant high pass filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
input signal to be processed.
cutoff frequency.
the reciprocal of Q, hence bandwidth / cutoffFreq.
A high shelf equalizer UGen.
A high shelf equalizer UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
input signal to be processed.
cutoff frequency.
the reciprocal of the slope S (Shell boost/cut slope).
When S = 1
, the shelf slope is as steep as it can be
and remain monotonically increasing or decreasing gain
with frequency. The shelf slope, in dB/octave, remains
proportional to S for all other values for a fixed
freq/sample-rate and gain
.
boost/cut at the cutoff frequency (in decibels).
A 2nd order (12db per oct roll-off) resonant low pass filter UGen.
A 2nd order (12db per oct roll-off) resonant low pass filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
input signal to be processed.
cutoff frequency.
the reciprocal of Q, hence bandwidth / cutoffFreq.
A low shelf equalizer UGen.
A low shelf equalizer UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
input signal to be processed.
cutoff frequency.
the reciprocal of the slope S (Shell boost/cut slope).
When S = 1
, the shelf slope is as steep as it can be
and remain monotonically increasing or decreasing gain
with frequency. The shelf slope, in dB/octave, remains
proportional to S for all other values for a fixed
freq/sample-rate and gain
.
boost/cut at the cutoff frequency (in decibels).
A second order band pass filter UGen.
A second order band pass filter UGen.
input signal to be filtered
center frequency in Hertz
reciprocal of Q. The Q (or quality) is conventionally defined as center-frequency / bandwidth, meaning that rq = bandwidth / center-frequency. A higher Q or lower rq produces a steeper filter.
a special fixed band-pass filter UGen.
An parametric equalizer UGen.
An parametric equalizer UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
input signal to be processed.
center frequency.
the reciprocal of Q, hence bandwidth / cutoffFreq.
boost/cut at the center frequency (in decibels).
A second order band reject (notch) filter UGen.
A second order band reject (notch) filter UGen.
input signal to be filtered
center frequency in Hertz
reciprocal of Q. The Q (or quality) is conventionally
defined as center-frequency / bandwidth, meaning that rq
= bandwidth / center-frequency. A higher Q or
lower rq produces a steeper filter. Too high values for
rq
may blow the filter up!
a special fixed band-reject filter UGen.
An equal power two channel balancing UGen.
An equal power two channel balancing UGen. It takes a left and right input
signal and attenuates them according to the pos
value, producing again a
stereophonic output.
The left input signal
The right input signal
The balance position from -1
(left only, right muted)
to +1
(right only, left muted). The curve follows an
equal power law, such that
left.squared + right.squared == 1
, e.g. at the middle
position 0
, both channels are multiplied with factor
sqrt(0.5) = 0.707 = -3 dB
.
An autocorrelation based beat tracker UGen.
An autocorrelation based beat tracker UGen.
The underlying model assumes 4/4, but it should work on any isochronous beat structure, though there are biases to 100-120 bpm; a fast 7/8 may not be tracked in that sense. There are four control-rate outputs, being ticks at quarter, eighth and sixteenth level from the determined beat, and the current detected tempo. Note that the sixteenth note output won't necessarily make much sense if the music being tracked has swing; it is provided just as a convenience.
This beat tracker determines the beat, biased to the mid-tempo range by weighting functions. It does not determine the measure level, only a tactus. It is also slow reacting, using a 6 second temporal window for its autocorrelation maneuvres. Don't expect human musician level predictive tracking.
On the other hand, it is tireless, relatively general (though obviously best at transient 4/4 heavy material without much expressive tempo variation), and can form the basis of computer processing that is decidedly faster than human.
Warning: This UGen only works properly at 44.1 or 48.0 kHz.
the output (buffer) of an FFT UGen which transforms the audio input to track. The expected size of FFT is 1024 for 44100 and 48000 sampling rate, and 2048 for double those. No other sampling rates are supported.
If this argument is greater than 0.5, the tracker will lock at its current periodicity and continue from the current phase. Whilst it updates the model's phase and period, this is not reflected in the output until lock goes back below 0.5. Can be control-rate modulated.
A template matching beat tracker UGen.
A template matching beat tracker UGen. This beat tracker is based on exhaustively testing particular template patterns against feature streams; the testing takes place every 0.5 seconds. The two basic templates are a straight (groove=0) and a swung triplet (groove=1) pattern of 16th notes; this pattern is tried out at scaling factors corresponding to the tempi from 60 to 180 bpm. This is the cross-correlation method of beat tracking. A majority vote is taken on the best tempo detected, but this must be confirmed by a consistency check after a phase estimate. Such a consistency check helps to avoid wild fluctuating estimates, but is at the expense of an additional half second delay. The latency of the beat tracker with default settings is thus at least 2.5 seconds; because of block-based amortisation of calculation, it is actually around 2.8 seconds latency for a 2.0 second temporal window.
This beat tracker is designed to be flexible for user needs; you can try out different window sizes, tempo weights and combinations of features. However, there are no guarantees on stability and effectiveness, and you will need to explore such parameters for a particular situation.
The UGen has six outputs corresponding to beat-tick, eighth-tick, groove-tick, tempo, phase, and groove. Warning: it reads from input control bus instead of taking a regular control input signal as its first argument!
index of a control bus to read from. the number of
channels of that bus are expected to match the
numChannels
argument. To track a particular audio
signal, analyse it first into numChannels
features,
that is onset-detection-triggers, as generated by
Onsets
, and write the trigger-output to this control
bus.
(scalar) How many features (ie how many control bus channels) are provided
(scalar) Size of the temporal window desired (2.0 to 3.0 seconds models the human temporal window). You might use longer values for stability of estimate at the expense of reactiveness.
(scalar) Relates to how many different phases to test. At the default of 0.02 seconds, 50 different phases spaced by those 0.02 seconds would be tried out for 60bpm; 16 would be trialed for 180 bpm. Larger phaseSpacing means more tests and more CPU cost.
If this argument is greater than 0.5, the tracker will lock at its current periodicity and continue from the current phase. Whilst it updates the model's phase and period, this is not reflected in the output until lock goes back below 0.5. Can be control-rate modulated.
(scalar) Use (-2.5) for flat weighting of tempi, (-1.5) for compensation weighting based on the number of events tested (because different periods allow different numbers of events within the temporal window). If an integer from 0 upwards is given, this is specifying the ID of a buffer containing 120 frames which represent individual tempo weights; tempi go from 60 to 179 bpm in steps of one bpm, so you make sure the buffer has 120 frames.
All pass delay line with cubic interpolation which uses a buffer for its internal memory.
All pass delay line with cubic interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Buffer id.
The input signal.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
All pass delay line with linear interpolation which uses a buffer for its internal memory.
All pass delay line with linear interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Buffer id.
The input signal.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
All pass delay line with no interpolation which uses a buffer for its internal memory.
All pass delay line with no interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Buffer id.
The input signal.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
Returns the current number of channels of the buffer at the provided index.
Returns the current number of channels of the buffer at the provided index.
Buffer id.
Comb delay line with cubic interpolation which uses a buffer for its internal memory.
Comb delay line with cubic interpolation which uses a buffer for its internal memory.
Buffer id.
The input signal.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower. Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Comb delay line with linear interpolation which uses a buffer for its internal memory.
Comb delay line with linear interpolation which uses a buffer for its internal memory.
Buffer id.
The input signal.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower. Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Comb delay line with no interpolation which uses a buffer for its internal memory.
Comb delay line with no interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Buffer id.
The input signal.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
Simple delay line with cubic interpolation which uses a buffer for its internal memory.
Simple delay line with cubic interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Buffer id.
The input signal.
Delay time in seconds.
Simple delay line with linear interpolation which uses a buffer for its internal memory.
Simple delay line with linear interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Buffer id.
The input signal.
Delay time in seconds.
Simple delay line with no interpolation which uses a buffer for its internal memory.
Simple delay line with no interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Buffer id.
The input signal.
Delay time in seconds.
Returns the current duration of the buffer at the provided index.
Returns the current duration of the buffer at the provided index.
Buffer id.
Returns the number of allocated frames of the buffer at the provided index.
Returns the number of allocated frames of the buffer at the provided index.
Buffer id.
Returns a ratio by which the playback of the buffer at the provided index is to be scaled relative to the current sample rate of the server.
Returns a ratio by which the playback of the buffer at the provided index is to be scaled relative to the current sample rate of the server.
buffer sample rate / server sample rate
Buffer id.
A UGen which reads the content of a buffer, using an index pointer.
A UGen which reads the content of a buffer, using an index pointer.
Warning: if the supplied bufID
refers to a buffer whose number of channels
differs from numChannels
, the UGen will fail silently.
An alternative to BufRd
is PlayBuf
. While PlayBuf
plays through the
buffer by itself, BufRd
only moves its read point by the index input and
therefore has no pitch input. PlayBuf
uses cubic interpolation, while BufRd
has variable interpolation. PlayBuf
can determine the end of the buffer and
issue a done-action.
number of channels that the buffer will be. Since this is an integer constant, a change in the number of channels must be reflected by creating different SynthDefs.
the identifier of the buffer to use
audio rate frame-index into the buffer. Can be fractional.
1 to enable looping, 0 to disable looping. this can be modulated.
1 for no interpolation, 2 for linear, and 4 for cubic interpolation
Returns the buffer's current sample rate.
Returns the buffer's current sample rate.
Buffer id.
Returns the current number of allocated samples in the Buffer at the provided index.
Returns the current number of allocated samples in the Buffer at the provided index. A sample is not the same as a frame (compare with BufFrames ); a frame includes the samples in each channel of the buffer. Only for a mono buffer are samples the same as frames.
samples = frames * numChannels
Buffer id.
A UGen that writes a signal to a buffer, using an index pointer.
A UGen that writes a signal to a buffer, using an index pointer.
Warning: if the supplied bufID
refers to a buffer whose number of channels
differs from those of the input signal, the UGen will fail silently.
An alternative to BufWr
is RecordBuf
. While RecordBuf
advances the index
into the buffer by itself, BufWr
only moves its write point by the index
input, making it possible to adjust the writing speed or to access the buffer in
a non-linear way. RecordBuf
can determine the end of the buffer and issue a
done-action.
input signal to record
the identifier of the buffer to use
audio rate frame-index into the buffer.
1 to enable looping, 0 to disable looping. this can be modulated.
A UGen to test for infinity, not-a-number (NaN), and denormal numbers.
A UGen to test for infinity, not-a-number (NaN), and denormal numbers. Its output is as follows: 0 = a normal float, 1 = NaN, 2 = infinity, and 3 = a denormal. According to the post settings it will print the information to the console along with a given identifier.
the signal to be tested
an identifier showing up with the values in the console
One of three post modes: 0 = no posting; 1 = post a line for every bad value; 2 = post a line only when the floating-point classification changes (e.g., normal -> NaN and vice versa)
The argument order is different from its sclang counterpart.
Comb delay line with cubic interpolation.
Comb delay line with cubic interpolation.
The input signal.
The maximum delay time in seconds. used to initialize the delay buffer size.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
Comb delay line with linear interpolation.
Comb delay line with linear interpolation.
The input signal.
The maximum delay time in seconds. used to initialize the delay buffer size.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
Comb delay line with no interpolation.
Comb delay line with no interpolation.
The input signal.
The maximum delay time in seconds. used to initialize the delay buffer size.
Delay time in seconds.
Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.
A compressor, expander, limiter, gate and ducking UGen.
A compressor, expander, limiter, gate and ducking UGen. This dynamic processor uses a hard-knee characteristic. All of the thresholds and ratios are given as direct values, not in decibels!
The signal to be compressed / expanded / gated.
The signal whose amplitude controls the processor. Often the same as in, but one may wish to apply equalization or delay to it to change the compressor character (side-chaining), or even feed a completely different signal, for instance in a ducking application.
Control signal amplitude threshold, which determines the break point between slopeBelow and slopeAbove. Usually 0..1. The control signal amplitude is calculated using RMS.
Slope of the amplitude curve below the threshold. If this slope > 1.0, the amplitude will drop off more quickly the softer the control signal gets; when the control signal is close to 0 amplitude, the output should be exactly zero -- hence, noise gating. Values < 1.0 are possible, but it means that a very low-level control signal will cause the input signal to be amplified, which would raise the noise floor.
Slope of the amplitude curve above the threshold. Values < 1.0 achieve compression (louder signals are attenuated); > 1.0, you get expansion (louder signals are made even louder). For 3:1 compression, you would use a value of 1/3 here.
The amount of time it takes for the amplitude adjustment to kick in fully. This is usually pretty small, not much more than 10 milliseconds (the default value). I often set it as low as 2 milliseconds (0.002).
The amount of time for the amplitude adjustment to be released. Usually a bit longer than attack; if both times are too short, you can get some (possibly unwanted) artifacts.
A UGen that reports the server's current control period in seconds.
A UGen that reports the server's current control period in seconds. This is
equivalent to the reciprocal of ControlRate
A UGen that reports the server's current control rate.
A UGen that reports the server's current control rate. This is equivalent to
the reciprocal of ControlDur
A frequency-domain convolution UGen using a fixed kernel which can be updated by a trigger signal.
A frequency-domain convolution UGen using a fixed kernel which can be updated
by a trigger signal. The delay caused by the convolution when the kernel is a
dirac impulse is equal to frameSize - (controlBlockSize + 1)
(measured august
2010), so for a frameSize of 2048 and a controlBlockSize of 64, this is 1983
sample frames.
the realtime input to be convolved
buffer identifier for the fixed kernel, which may be modulated in combination with the trigger
updates the kernel on a change from non-positive to positive (<= 0 to >0)
size of the kernel. this must be a power of two. the FFT calculated internally by the UGen has a size of twice this value. The maximum allowed frameSize is 65536(?).
A UGen for triggered convolution in the time domain.
A linear-interpolating sound generator based on the difference equation:
A linear-interpolating sound generator based on the difference equation:
x[n+1] = a - b * sqrt(abs(x[n]))
Iteration frequency in Hertz
Equation variable
Equation variable
Initial value of x
A non-interpolating sound generator based on the difference equation:
A non-interpolating sound generator based on the difference equation:
x[n+1] = a - b * sqrt(abs(x[n]))
Iteration frequency in Hertz
Equation variable
Equation variable
Initial value of x
A demand-rate UGen that reads out a buffer.
A demand-rate UGen that reads out a buffer. All inputs can be either demand ugen or any other ugen.
the identifier of the buffer to read out
the frame index into the buffer
whether to wrap an exceeding phase around the buffer length (1) or not (0)
Dbufwr
An integrator UGen with exponential decay of past values.
An integrator UGen with exponential decay of past values. This is essentially
the same as Integrator
except that instead of supplying the coefficient
directly, it is calculated from a 60 dB decay time. This is the time required
for the integrator to lose 99.9 % of its value or -60dB.
Note: This should not be confused with Lag
which does not overshoot due to
integration, but asymptotically follows the input signal.
input signal to be processed
A integrator UGen with controllable attack and release times.
A integrator UGen with controllable attack and release times. While Decay
has
a very sharp attack and can produce clicks, Decay2
rounds off the attack by
subtracting one Decay from another. It can be seen as equivalent to
Decay.ar(in, release) - Decay.ar(in, attack)
Note: This should not be confused with LagUD
which does not overshoot due to
integration, but asymptotically follows the input signal.
input signal to be processed
Tap a delay line from a DelTapWr
UGen.
Tap a delay line from a DelTapWr
UGen.
Buffer where DelTapWr has written signal. Max delay time is based on buffer size.
the current phase of the DelTapWr UGen. This is the output of DelTapWr.
Delay time in seconds.
The kind of interpolation to be used. 1 is none, 2 is linear, 4 is cubic..
Write to a buffer for a DelTapRd
UGen
Write to a buffer for a DelTapRd
UGen
The buffer to write signal into. Max delay time is
based on buffer size. DelTapWr
outputs its current
sample value for use in the phase
argument of
DelTapRd
.
The input signal.
A UGen that delays the input by 1 audio frame or control period.
A UGen that delays the input by 2 audio frames or control periods.
Simple delay line with cubic interpolation.
Simple delay line with linear interpolation.
Simple delay line with no interpolation.
A UGen which polls results from demand-rate ugens when receiving a trigger.
A UGen which polls results from demand-rate ugens when receiving a trigger.
When there is a trigger at the trig
input, a value is demanded from each ugen
in the in
input and output. The unit generators in the list should be
demand-rate. When there is a trigger at the reset input, the demand rate ugens
in the list are reset.
Note: By design, a reset trigger only resets the demand ugens; it does not
reset the value at Demand's output. Demand continues to hold its value until the
next value is demanded, at which point its output value will be the first
expected item in the in
argument.
Note: One demand-rate ugen represents a single stream of values, so that embedding the same ugen twice calls this stream twice per demand, possibly yielding different values. To embed the same sequence twice, either make sure the ugen is demanded only once, or create two instances of the ugen.
Warning: Demand currently seems to have problems with infinite sequences.
As a workaround use a very large length instead. E.g. instead of
Dbrown(0, 1, inf)
use Dbrown(0, 1, 0xFFFFFFFF)
!
trigger. Can be any signal. A trigger happens when the signal changes from non-positive to positive.
a demand-rate signal (possibly multi-channel) which is read at each trigger
trigger. Resets the list of ugens (in
) when triggered.
An envelope generator UGen using demand-rate inputs for the envelope segments.
An envelope generator UGen using demand-rate inputs for the envelope segments. For each parameter of the envelope (levels, durations and shapes), values are polled every time a new segment starts.
demand-rate ugen (or other ugen) returning level values
demand-rate ugen (or other ugen) returning duration values
demand-rate ugen (or other ugen) returning shape number for the envelope segment.
demand-rate ugen (or other ugen) returning curvature values. these are used for curveShape segments (shape number 5) and should be zero for other shapes.
a control rate gate: if gate is x >= 1, the ugen runs. if gate is 0 > x > 1, the ugen is released at the next level (according to doneAction). if gate is x <= 0, the ugen is sampled and held.
a trigger signal. a trigger occurs when passing from non-positive to positive. when the trigger amplitude is < 1, the input ugens (those that are demand-rated) are reset when the current segment ends. if the trigger amplitude is > 1, the reset is performed immediately.
demand-rate ugen returning level scaling values
demand-rate ugen returning level offset values
demand-rate ugen returning time scaling values
a done action performed when one of the demand-rated series ends
DoneAction
Env
A UGen which determines the index in a buffer at which the value matches a given input signal.
A UGen which determines the index in a buffer at which the value matches a given input signal. If the input value is not found, it outputs -1.
For example, if the buffer contains values 5, 3, 2, 8, and the input signal is
3, the output will be 1. If the input is 3.001, the output will be -1. Unlike
IndexInBetween
, this UGen always searches through the entire buffer until the
value is found or the end has been reached (returning -1).
A UGen which detects whether its input signal falls below a given amplitude for a given amount of time (becoming "silent").
A UGen which detects whether its input signal falls below a given amplitude for
a given amount of time (becoming "silent"). A silence is detected if the
absolute sample values of the input remain less than or equal to the amp
threshold for a consecutive amount of time given by the dur
argument.
A value of 1
is output when this condition is met, and a value of 0
is
output when the condition is not met (i.e. at least one sample occurs in the
input whose absolute value is greater than amp
). Besides, when the output
changes from zero to one, the doneAction
is executed (unless it is doNothing
).
A special case is the initial condition of the UGen: It will begin with an
output value of 0
(no silence detected), even if the input signal is below the
amplitude threshold. It is only after the first input sample rising above the
threshold that the actual monitoring begins and a trigger of 1
or the firing
of the done-action may occur.
input signal to be measured.
minimum amplitude threshold which must be exceeded for the input signal to be considered non-silent.
The duration in seconds for which the input signal must be continuously smaller than or equal to the threshold to be considered silent.
an action to be performed when the output changes from zero to one (silence detected).
A UGen to stream in a signal from an audio file.
A UGen to stream in a signal from an audio file. Continuously plays a longer audio file from disk. This requires a buffer to be preloaded with one buffer size of sound. If loop is set to 1, the file will loop.
Note: The buffer size must be a multiple of (2 * the server's block
size). See Buffer#cue
for details.
the amount of channels the file and the buffer will have. This is an Int and hence must be pre-determined. Different SynthDefs must be created for different numbers of channels.
the id of the buffer with the correct number of channels and frames
whether the file should loop when its end is reached
A UGen which writes a signal to a sound file on disk.
A UGen which writes a signal to a sound file on disk. To achieve this efficiently, a buffer is needs to be provides which is used to buffer the incoming signal.
Note: It might be that the buffer size must be a multiple of (2 * the server's block size). We haven't currently verified this, but to be safe, you should make sure this property is met.
The signal output by the UGen represents the number of frames written.
the buffer used internally by the UGen. this number of
frames in the buffer must be a power of two (this is
currently not checked!). The buffer must have been
initialized with a write
command whose leaveOpen
argument is true. Note that the number of channels of
the buffer and of the input signal must be the same,
otherwise DiskOut
will fail silently (and not write
anything to the file).
the signal to be recorded
A UGen which monitors another UGen to see when it is finished.
A UGen which monitors another UGen to see when it is finished. Some UGens, such
as PlayBuf
, RecordBuf
, Line
, XLine
, EnvGen
, Linen
, BufRd
,
BufWr
, DbufRd
, and the Buffer delay UGens set a 'done' flag when they are
finished playing. This UGen echoes that flag as an explicit output signal when
it is set to track a particular UGen. When the tracked UGen changes to done, the
output signal changes from zero to one.
the UGen to track
A demand rate UGen printing the current output value of its input to the console when polled.
A demand rate UGen printing the current output value of its input to the console when polled.
the signal you want to poll
a string or symbol to be printed with the polled value
if 1 the polling is active, if 0 it is inactive.
if greater then 0, a "/tr"
OSC message is sent back
to the client (similar to SendTrig
)
A demand-rate UGen which produces an arithmetic (linear) series.
A demand-rate UGen which produces an arithmetic (linear) series.
The arguments can be constant or any other ugens.
the start value of the series
the incremental step by which the series changes. the step is added to the previous value on each demand.
the number of elements to produces (maybe be infinite)
Dseq
Dgeom
A UGen generating random impulses with values ranging from 0
to +1
.
A UGen generating random impulses with values ranging from -1
to +1
.
A UGen which polls results from demand-rate ugens in intervals specified by a duration input.
A UGen which polls results from demand-rate ugens in intervals specified by a
duration input. A value from the level
ugen is demanded and output according
to a stream of duration values. When there is a trigger at the reset input, the
level
and the dur
input are reset.
the provider of time values. Can be a demand-rate ugen or any signal. The next poll is acquired after the previous duration.
a demand-rate ugen providing the output values.
a trigger which resets the dur input (if demand-rated) and the the level input ugen. The reset input may also be a demand-rate ugen, in this case providing a stream of reset times.
a doneAction that is evaluated when the duration stream ends.
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = sin(im * y[n] + fb * x[n]) y[n+1] = (a * y[n] + c) % 2pi
This uses a linear congruential function to drive the phase indexing of a sine wave. For im = 1, fb = 0 , and a = 1 a normal sine wave results.
Iteration frequency in Hertz
Index multiplier amount
Feedback amount
Phase multiplier amount
Phase increment amount
Initial value of x
Initial value of y
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = sin(im * y[n] + fb * x[n]) y[n+1] = (a * y[n] + c) % 2pi
This uses a linear congruential function to drive the phase indexing of a sine wave. For im = 1, fb = 0, and a = 1 a normal sine wave results.
Iteration frequency in Hertz
Index multiplier amount
Feedback amount
Phase multiplier amount
Phase increment amount
Initial value of x
Initial value of y
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = sin(im * y[n] + fb * x[n]) y[n+1] = (a * y[n] + c) % 2pi
This uses a linear congruential function to drive the phase indexing of a sine wave. For im = 1, fb = 0, and a = 1 a normal sine wave results.
Iteration frequency in Hertz
Index multiplier amount
Feedback amount
Phase multiplier amount
Phase increment amount
Initial value of x
Initial value of y
A UGen performing short-time forward fourier transformations.
A UGen performing short-time forward fourier transformations. In order to
properly link the spectral ugens ( PV_...
), you should begin by using the
output of each UGen (which is just the fft buffer identifier), and use that as
buffer input of the next UGen. That way, the UGen graph is correctly sorted.
E.g. IFFT(PV_...(FFT(buf, in)))
.
The UGen will initially output zero until the first FFT can be performed. This
is the case after hop * fftSize
. Thus for a default fft buffer size of 1024
and a hop
of 0.5, and for a default control block size of 64, for the first
1024*0.5/64 = 8 control blocks the UGen will output zero. This also implies that
the first FFT in this case if performed on the first 512 samples of the in
signal (prepended by 512 zeros). In other words, the first 'full' FFT of the
input happens after fftSize/controlBlockSize cycles, no matter what hop size was
chosen.
If you use FFT for performing signal analysis and not phase vocoder effects, make sure you change the window type accordingly.
The buffer to use for writing the FFT to. The size must
be a power of two. Since FFT
operates at control rate
(also being a power of two), the buffer should probably
be at least as long as the control block size.
The time domain signal to be transformed into the spectral domain.
A factor determining the step size between successive FFTs. That is, FFTs are performed every fftSize * hop sample frames. The default of 0.5 means thus a 50% overlap, while a hope of 1.0 means no overlapping. Choosing 0.0 will most likely crash the server!
The window function applied before each FFT is taken.
The default of 0 is a sine window which is good for
phase vocoder applications (using the PV_...
UGens).
For analysis applications, you may want to use -1 which
is a rectangle window (effectively no windowing) or 1
which is a Hann window. A Hann window gives perfect
overlap-add reconstruction for a hope size of 0.5 (or
0.25 etc.)
This parameter can be temporarily set to <= 0 to pause the FFT operation.
With the default value of zero, the window size equals the fft size. If you wish to perform zero padding, an explicit window size can be specified.
FFTTrigger
A phase vocoder UGen that takes a buffer and prepares it to be used in FFT chains, without doing an actual FFT on a signal.
A phase vocoder UGen that takes a buffer and prepares it to be used in FFT chains, without doing an actual FFT on a signal. This is useful if you want to provide a buffer whose content had already been transformed into the Fourier domain.
the identifier of the buffer to use
the hop size for timing triggers
whether the complex buffer content is given in cartesian coordinates (0) or in polar coordinates (1)
A first order filter section UGen.
A UGen which reads a single sample value from a buffer at a given index.
A UGen which reads a single sample value from a buffer at a given index.
It uses the in
argument as index into the buffer, truncating that argument to
an integer. Out-of-range index values are "folded" inside the valid range.
Folding means reflecting the excess at the valid range's boundaries.
For example, if the buffer has four samples, index 4 is wrapped to index 2 (the excess beyond the maximum index of 3 is 4 - 3 = 1, and the excess is folded so that and 3 - 1 = 2), index 5 is folded to index 1, index -1 is folded to index 1, index -2 is folded to index 2, etc.
While designed for monophonic buffers, it works with multi-channel buffers by
treating them as de-interleaved. See the Index
UGen for details.
The buffer to read from.
The sample index into the buffer. This is truncated to an integer automatically.
A FOF-like resonant filter UGen.
A FOF-like resonant filter UGen. Its impulse response is like that of a sine
wave with a Decay2
envelope over it. It is possible to control the attack and
decay times.
Formlet
is equivalent to:
Ringz(in, freq, decay) - Ringz(in, freq, attack)
The great advantage to this filter over FOF (Fonction d'onde formantique) is that there is no limit to the number of overlapping grains since the grain is just the impulse response of the filter.
input signal to be filtered
resonant frequency in Hertz
the 60 dB attack time in seconds
the 60 dB decay time in seconds
A UGen that, when triggered, frees a given node.
A UGen that, when triggered, frees enclosing synth.
A UGen that, when its input UGen is finished, frees enclosing synth.
A UGen that, when its input UGen is finished, frees enclosing synth. This is
essentially a shortcut for FreeSelf.kr(Done.kr(src))
, so instead of providing
a trigger signal it reads directly the done flag of an appropriate ugen (such as
Line
or PlayBuf
).
This UGen outputs its input signal for convenience.
the input UGen which when finished will trigger the action.
A frequency shifting UGen.
A frequency shifting UGen. It implements single sideband (SSB) amplitude modulation, also known as frequency shifting, but not to be confused with pitch shifting. Frequency shifting moves all the components of a signal by a fixed amount but does not preserve the original harmonic relationships.
the shift amount in Hertz. Positive values shift upwards, negative values shift downwards.
a phase parameter in radians (0 to 2 Pi).
PV_MagShift
A gate or hold UGen.
A gate or hold UGen. It allows the input signal value to pass when the gate
argument is positive, otherwise it holds last value.
the input signal to gate
the signal specifying whether to pass the input signal (when greater than zero) or whether to close the gate and hold the last value (when less than or equal to zero)
Iteration frequency in Hertz
Initial value of y
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = 1 - y[n] + abs(x[n]) y[n+1] = x[n]
The behavior of the system is only dependent on its initial conditions. Reference: Devaney, R. L. "The Gingerbreadman." Algorithm 3, 15-16, Jan. 1992.
Iteration frequency in Hertz
Initial value of y
The argument order is different from its sclang counterpart.
The argument order is different from its sclang counterpart.
A second order high pass filter UGen.
A two point difference filter UGen.
three point difference filter UGen.
A cubic-interpolating sound generator based on the difference equation:
A cubic-interpolating sound generator based on the difference equation:
x[n+2] = 1 - a * pow(x[n+1], 2) + b * x[n]
This equation was discovered by French astronomer Michel Hénon while studying the orbits of stars in globular clusters.
Iteration frequency in Hertz
Equation variable
Equation variable
Initial value of x
Second value of x
A linear-interpolating sound generator based on the difference equation:
A linear-interpolating sound generator based on the difference equation:
x[n+2] = 1 - a * pow(x[n+1], 2) + b * x[n]
This equation was discovered by French astronomer Michel Hénon while studying the orbits of stars in globular clusters.
Iteration frequency in Hertz
Equation variable
Equation variable
Initial value of x
Second value of x
A non-interpolating sound generator based on the difference equation:
A non-interpolating sound generator based on the difference equation:
x[n+2] = 1 - a * pow(x[n+1], 2) + b * x[n]
This equation was discovered by French astronomer Michel Hénon while studying the orbits of stars in globular clusters.
Iteration frequency in Hertz
Equation variable
Equation variable
Initial value of x
Second value of x
A Hilbert transform UGen.
A Hilbert transform UGen. This transformation produces two signals from a given input with identical frequency content, but with their respective phases shifted to be 90 degrees apart (0.5 pi radians).
The two signals output by Hilbert
correspond to the real and imaginary part
of the complex transformed signal. Due to the method used (an IIR filter),
distortion occurs in the upper octave of the frequency spectrum.
The transform can be used to implemented single-side-band (SSB) modulation, but
a dedicated UGen FreqShift
is already provided for this case.
input signal to be processed
A UGen which reads a signal from an audio bus with a current or one cycle old timestamp.
A UGen which reads a signal from an audio bus with a current or one cycle old timestamp.
Audio buses adhere to the concept of a cycle timestamp, which increases for
each audio block calculated. When the various output ugens ( Out
, OffsetOut
, XOut
) write data to a bus, they mix it with any data from the current
cycle, but overwrite any data from the previous cycle. ( ReplaceOut
overwrites
all data regardless.) Thus depending on node order and what synths are writing
to the bus, the data on a given bus may be from the current cycle or be one
cycle old at the time of reading.
In.ar
checks the timestamp of any data it reads in and zeros any data from
the previous cycle (for use within that node; the data remains on the bus). This
is fine for audio data, as it avoids feedback, but for control data it is useful
to be able to read data from any place in the node order. For this reason
In.kr
also reads data that is older than the current cycle.
In some cases one might also want to read audio from a node later in the
current node order. This can be achieved with InFeedback
. It reads from the
previous cycle, and hence introduces a delay of one block size, which by
default is 64 sample frames (equal to about 1.45 ms at 44.1 kHz sample rate).
Note that no delay occurs when the bus contains a signal which has been written already in the current cycle. The delay is only introduced when no present signal exists.
the index of the audio bus to read in from.
the number of channels (i.e. adjacent buses) to read in. Since this is a constant, a change in number of channels of the underlying bus must be reflected by creating different SynthDefs.
A UGen which generates a trigger anytime a control bus is set.
A UGen which generates a trigger anytime a control bus is set.
Any time the bus is "touched" i.e. has its value set (using "/c_set"
etc.), a
single impulse trigger will be generated. Its amplitude is the value that the
bus was set to. Note that if a signal is continuously written to that bus, for
instance using Out.kr
, only one initial trigger is generated once that ugen
starts writing, but no successive triggers are generated.
the index of the control bus to read in from.
the number of channels (i.e. adjacent buses) to read in. Since this is a constant, a change in number of channels of the underlying bus must be reflected by creating different SynthDefs.
A UGen which reads a single sample value from a buffer at a given index.
A UGen which reads a single sample value from a buffer at a given index.
It uses the in
argument as index into the buffer, truncating that argument to
an integer. Out-of-range index values are clipped to the valid range.
While designed for monophonic buffers, it works with multi-channel buffers by treating them as de-interleaved. For example, if the buffer has two frames and two channels, index 0 corresponds to frame 0, channel 0, index 1 correspond to frame 0, channel 1, index 2 corresponds to frame 1, channel 0, and index 3 corresponds to frame 1, channel 1.
The buffer to read from.
The sample index into the buffer. This is truncated to an integer automatically.
A UGen which determines the (lowest) index in a buffer at which the two neighboring values contain a given input signal.
A UGen which determines the (lowest) index in a buffer at which the two neighboring values contain a given input signal. The output index is a decimal whose fractional part is suitable for linearly interpolating between the buffer slot values.
For example, if the Buffer contains values 3, 21, 25, 26 and the input signal has the value 22, then the output will be 1.25, because the value 22 is in-between the values stored at indices 1 and 2 and the linear location of 22 is one-quarter of the way along the interval between them: 21 * (1 - 0.25) + 25 * (1 - 0.75) = 22.
If the input value is smaller than the first sample, the output will be zero. If the input value is larger than any sample in the buffer, the output will be the buffer size minus one.
While designed for monophonic buffers, it works with multi-channel buffers by treating them as de-interleaved. For example, if the buffer has two frames and two channels, and the algorithm finds the frame 1 in channel 0, the reported index is 2 (frame * numChannels + channel).
IndexInBetween
is the complement of the IndexL
UGen.
The buffer to search in.
The input signal whose value is looked up in the buffer.
A UGen which reads from a buffer at a given index, linearly interpolating between neighboring points.
A UGen which reads from a buffer at a given index, linearly interpolating between neighboring points.
It uses the in
argument as index into the buffer. Out-of-range index values
are clipped to the valid range. If the index has a fractional part, it is used
to interpolate between the buffer index at the floor and the buffer index at the
ceiling of the index argument.
While designed for monophonic buffers, it works with multi-channel buffers by
treating them as de-interleaved. See the Index
UGen for details.
The buffer to read from.
The sample index into the buffer. This can have a fractional part.
A filter UGen to integrate an input signal with a leak.
A (12TET major/minor) key tracker UGen.
A (12TET major/minor) key tracker UGen. It is based on a pitch class profile of energy across FFT bins and matching this to templates for major and minor scales in all transpositions. It assumes a 440 Hz concert A reference. Output is 0-11 C major to B major, 12-23 C minor to B minor.
the output (buffer) of an FFT UGen which transforms the audio input to track. For the FFT chain, with a standard hop of half FFT size, the FFT size should be 4096 at 44.1 or 48 kHz and 8192 at 88.2 or 96 kHz sampling rate.
Number of seconds for the influence of a window on the final key decision to decay by 40dB (to 0.01 its original value). Can be control-rate modulated.
Each frame, the chroma values are set to the previous value multiplied by this chroma decay. 0.0 will start each frame afresh with no memory. Can be control-rate modulated.
A UGen that randomly generates the values -1 or +1 at a rate given by the nearest integer division of the sample rate by the frequency argument.
A dynamic step noise UGen.
A dynamic step noise UGen. Like LFNoise0
, it generates abruptly changing
random values between -1
and +1
at a rate given by the freq
argument, with
two differences: There is no time quantization, and it there is fast recovery
from low freq values.
In contrast, LFNoise0
, LFNoise1
, and LFNoise2
quantize to the nearest
integer division of the sample rate, and they poll the freq argument only when
scheduled, and thus seem to hang when the frequencies get very low.
If very high or very low frequencies are not needed, or fixed frequencies are
used, LFNoise0
is more efficient.
rate at which to generate random values.
A dynamic ramp noise UGen.
A dynamic ramp noise UGen. Like LFNoise1
, it generates linearly interpolated
random values between -1
and +1
at a rate given by the freq
argument, with
two differences: There is no time quantization, and it there is fast recovery
from low freq values.
In contrast, LFNoise0
, LFNoise1
, and LFNoise2
quantize to the nearest
integer division of the sample rate, and they poll the freq argument only when
scheduled, and thus seem to hang when the frequencies get very low.
If very high or very low frequencies are not needed, or fixed frequencies are
used, LFNoise1
is more efficient.
rate at which to generate random values.
A dynamic ramp noise UGen.
A dynamic ramp noise UGen. It is similar to LFNoise2
, with three
differences: It uses cubic instead of quadratic interpolation for the random
values between -1
and +1
at a rate given by the freq
argument. There is no
time quantization, and it there is fast recovery from low freq values.
In contrast, LFNoise0
, LFNoise1
, and LFNoise2
quantize to the nearest
integer division of the sample rate, and they poll the freq argument only when
scheduled, and thus seem to hang when the frequencies get very low.
rate at which to generate random values.
A step noise UGen.
A step noise UGen. It generates abruptly changing random values between -1
and +1
at a rate given by the freq
argument.
The frequency is quantized to the nearest integer division of the sample rate,
and changes in frequency are only picked up at the next trigger. In contrast,
variant LFDNoise0
has precise frequency and reacts to frequency changes
instantly.
rate at which to generate random values.
A ramp noise UGen.
A ramp noise UGen. It generates line segments whose start and end points are
chosen randomly between -1
and +1
. New breakpoints are generated at a
specified frequency.
The frequency is quantized to the nearest integer division of the sample rate,
and changes in frequency are only picked up at the next trigger. In contrast,
variant LFDNoise1
has precise frequency and reacts to frequency changes
instantly.
rate at which to generate new breakpoints.
A non-band-limited pulse oscillator UGen.
A non-band-limited pulse oscillator UGen. Outputs a high value of one and a low value of zero.
oscillator frequency in Hertz
initial phase offset in cycles ( 0..1
). If you think
of a buffer of one cycle of the waveform, this is the
starting offset into this buffer. Hence, an iphase
of
0.25
means that you will hear the first impulse after
0.75
periods! If you prefer to specify the perceived
delay instead, you could use an iphase
of -0.25 + 1
which is more intuitive. Note that the phase is not
automatically wrapped into the range of 0..1
, so
putting an iphase
of -0.25
currently results in a
strange initial signal which only stabilizes to the
correct behaviour after one period!
pulse width duty cycle from zero to one. If you want to
specify the width rather in seconds, you can use the
formula width = freq * dur
, e.g. for a single sample
impulse use width = freq * SampleDur.ir
.
A sawtooth oscillator UGen.
A sawtooth oscillator UGen. The oscillator is creating an aliased sawtooth,
that is it does not use band-limiting. For a band-limited version use Saw
instead. The signal range is -1 to +1.
oscillator frequency in Hertz
initial phase offset. For efficiency reasons this is a value ranging from -1 to 1 (thus equal to the initial output value). Note that a phase of zero (default) means the wave starts at 0 and rises to +1 before jumping down to -1. Use a phase of 1 to have the wave start at -1.
A triangle oscillator designed for low frequency control signals (being non-band-limited).
A triangle oscillator designed for low frequency control signals (being non-band-limited). The output varies from -1 to 1.
With an initial phase of zero, the oscillator begins at 0, rises to 1, then falls to -1 and goes back to zero after one complete phase. With an initial phase of 1 (corresponding to 90 degrees), the oscillator begins at 1 and then falls to -1. With an initial phase of 3 (or 270 degrees), the oscillator begins at -1 and then rises to 1.
frequency in Hertz
Initial phase of the oscillator. A full phase (2 Pi or
360 degrees) is represented by an iphase
value of 4.
The initial phase cannot be modulated.
A second order low pass filter UGen.
two point average filter UGen.
two point average filter UGen. Implements the formula :
out(i) = 0.5 * (in(i) + in(i-1))
input signal to be filtered
three point average filter UGen.
An exponential lag UGen.
An exponential lag UGen. This is essentially the same as OnePole
except that
instead of supplying the coefficient directly, it is calculated from a 60 dB lag
time. This is the time required for the filter to converge to within 0.01 % of a
value. This is useful for smoothing out control signals.
input signal.
60 dB lag time in seconds.
A cascaded exponential lag UGen.
A cascaded exponential lag UGen with separate inputs for up and down slope.
A cascaded exponential lag UGen with separate inputs for up and down slope.
Lag2UD.kr(in, up, down)
is equivalent to
LagUD.kr(LagUD.kr(in, up, down), up, down)
, thus resulting in a smoother
transition. This saves on CPU as you only have to calculate the decay factors
once instead of twice.
input signal.
60 dB lag time in seconds effective during a rising slope in the input signal
60 dB lag time in seconds effective during a falling slope in the input signal
A cascaded exponential lag UGen.
A cascaded exponential lag UGen. Lag3.kr(in, time)
is equivalent to
Lag.kr(Lag.kr(Lag.kr(Lag.kr(in, time), time), time)
, thus resulting in a
smoother transition. This saves on CPU as you only have to calculate the decay
factor once instead of three times.
input signal.
60 dB lag time in seconds.
A cascaded exponential lag UGen with separate inputs for up and down slope.
A cascaded exponential lag UGen with separate inputs for up and down slope.
Lag3UD.kr(in, up, down)
is equivalent to
LagUD.kr(LagUD.kr(LagUD.kr(in, up, down), up, down), up, down)
, thus
resulting in a smoother transition. This saves on CPU as you only have to
calculate the decay factors once instead of three times.
input signal.
60 dB lag time in seconds effective during a rising slope in the input signal
60 dB lag time in seconds effective during a falling slope in the input signal
An exponential lag UGen with separate inputs for up and down slope.
An exponential lag UGen with separate inputs for up and down slope. This is
essentially the same as Lag
except that you can supply a different 60 dB time
for when the signal goes up, from when the signal goes down.
input signal.
60 dB lag time in seconds effective during a rising slope in the input signal
60 dB lag time in seconds effective during a falling slope in the input signal
A sample-and-hold UGen.
A cubic-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26.
A cubic-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26. The function is:
x[n+1] = sin(b * y[n]) + c * sin(b * x[n]) y[n+1] = sin(a * y[n]) + d * sin(a * x[n])
According to Pickover, parameters a and b should be in the range from -3 to +3, and parameters c and d should be in the range from 0.5 to 1.5. The function can, depending on the parameters given, give continuous chaotic output, converge to a single value (silence) or oscillate in a cycle (tone). NOTE: This UGen is experimental and not optimized currently, so is rather hoggish of CPU.
Iteration frequency in Hertz.
Equation variable
Equation variable
Equation variable
Equation variable
Initial value of x
Initial value of y
A linear-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26.
A linear-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26. The function is:
x[n+1] = sin(b * y[n]) + c * sin(b * x[n]) y[n+1] = sin(a * y[n]) + d * sin(a * x[n])
According to Pickover, parameters a and b should be in the range from -3 to +3, and parameters c and d should be in the range from 0.5 to 1.5. The function can, depending on the parameters given, give continuous chaotic output, converge to a single value (silence) or oscillate in a cycle (tone). NOTE: This UGen is experimental and not optimized currently, so is rather hoggish of CPU.
Iteration frequency in Hertz
Equation variable
Equation variable
Equation variable
Equation variable
Initial value of x
Initial value of y
A non-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26.
A non-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26. The function is:
x[n+1] = sin(b * y[n]) + c * sin(b * x[n]) y[n+1] = sin(a * y[n]) + d * sin(a * x[n])
According to Pickover, parameters a and b should be in the range from -3 to +3, and parameters c and d should be in the range from 0.5 to 1.5. The function can, depending on the parameters given, give continuous chaotic output, converge to a single value (silence) or oscillate in a cycle (tone). NOTE: This UGen is experimental and not optimized currently, so is rather hoggish of CPU.
Iteration frequency in Hertz.
Equation variable
Equation variable
Equation variable
Equation variable
Initial value of x
Initial value of y
A filter UGen to remove very low frequency content DC offset.
A filter UGen to remove very low frequency content DC offset.
input signal to be filtered
the leak coefficient determines the filter strength. the value must be between zero and one (exclusive) for the filter to remain stable. values closer to one produce less bass attenuation.
Limits the input amplitude to the given level.
Limits the input amplitude to the given level. Unlike Compander
, this UGen
will never overshoot, but it needs to look ahead in the input signal,
introducing a delay in its output. The delay time is equal to twice the value of
the dur
parameter (the buffer internally used).
input signal to be limited
maximum amplitude to which the signal is limited. The
limiter will kick in when the input signal exceeds
+level
or falls below -level
.
look-ahead time in seconds
A cubic-interpolating sound generator based on the difference equation:
A linear-interpolating sound generator based on the difference equation:
A non-interpolating sound generator based on the difference equation:
A UGen which maps a linear range to an exponential range.
A UGen which maps a linear range to an exponential range. The equivalent
formula is (dstHi / dstLo).pow((in - srcLo) / (srcHi - srcLo)) * dstLo
.
Note: No clipping is performed. If the input signal exceeds the input range, the output will also exceed its range.
input signal to convert
lower limit of input range
upper limit of input range
lower limit of output range
upper limit of output range
An linear two channel cross fading UGen.
An linear two channel cross fading UGen.
The first input signal
The second input signal
the cross-fade position from -1
(only input A
audible) to +1
(only input B audible)
An overall amplitude multiplier that is applied to the output signal
A line generator UGen that moves from a start value to the end value in a given duration.
A UGen that allocates a buffer local to the synth.
A UGen that allocates a buffer local to the synth.
This is convenient for example when using an FFT
chain.
number of channels for the buffer
number of sample frames for the buffer
A strange attractor discovered by Edward N.
A strange attractor discovered by Edward N. Lorenz while studying mathematical models of the atmosphere. The system is composed of three ordinary differential equations:
x' = s * (y - x) y' = x * (r - z) - y z' = x * y - b * z
The time step amount h determines the rate at which the ODE is evaluated. Higher values will increase the rate, but cause more instability. A safe choice is the default amount of 0.05.
Iteration frequency in Hertz
Equation variable
Equation variable
Equation variable
Integration time step
Initial value of x
Initial value of y
Initial value of z
A UGen for the extraction of instantaneous loudness.
A UGen for the extraction of instantaneous loudness. A perceptual loudness function which outputs loudness in sones; this is a variant of an MP3 perceptual model, summing excitation in ERB bands. It models simple spectral and temporal masking, with equal loudness contour correction in ERB bands to obtain phons (relative dB), then a phon to sone transform. The final output is typically in the range of 0 to 64 sones, though higher values can occur with specific synthesised stimuli.
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
the output (buffer) of an FFT UGen which transforms the audio input to track. The FFT size should be 1024 for 44.1 and 48 kHz sampling rate, and 2048 for 88.2 and 96 kHz sampling rate.
Spectral masking parameter: lower bins mask higher bin
power within ERB bands, with a power falloff (leaky
integration multiplier) of smask
per bin. Can be
control-rate modulated.
Temporal masking parameter: the phon level let through
in an ERB band is the maximum of the new measurement,
and the previous minus tmask
phons. Can be
control-rate modulated.
A UGen for extracting mel frequency cepstral coefficients.
A UGen for extracting mel frequency cepstral coefficients. It generates a set of MFCCs; these are obtained from a band-based frequency representation (using the Mel scale by default), and then a discrete cosine transform (DCT). The DCT is an efficient approximation for principal components analysis, so that it allows a compression, or reduction of dimensionality, of the data, in this case reducing 42 band readings to a smaller set of MFCCs. A small number of features (the coefficients) end up describing the spectrum. The MFCCs are commonly used as timbral descriptors.
The output values are somewhat normalised for the range 0.0 to 1.0, but there are no guarantees on exact conformance to this. Commonly, the first coefficient will be the highest value. The number of output channels corresponds to the number of coefficients specified. Technical note: The 0th coefficient is not generated as it consists of multiplying all bands by 1 and summing
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
the output (buffer) of an FFT UGen which transforms the audio input to track. For the FFT chain, with a standard hop of half FFT size, the FFT size should be 1024 at 44.1 or 48 kHz and 2048 at 88.2 or 96 kHz sampling rate.
the number of coefficients, defaults to 13, maximum of
42; more efficient to use less of course! Since this
number determines the number of output channels of the
UGen, it has to be an Int
.
A filter UGen that calculates the median of a running window over its input signal.
A filter UGen that calculates the median of a running window over its input signal. This non-linear filter can be used to reduce impulse noise from a signal.
window size. I.e., the number of input samples in which to find the median. Must be an odd number from 1 to 31. A value of 1 has no effect. Warning: This parameter is only read an initialization time and cannot be modulated while the UGen is running.
The argument order is different from its sclang counterpart.
A single band parametric equalizer UGen.
A single band parametric equalizer UGen. It attenuates or boosts a frequency band.
input signal to be filtered
center frequency in Hertz
reciprocal of Q. The Q (or quality) is conventionally
defined as center-frequency / bandwidth, meaning that rq
= bandwidth / center-frequency. A higher Q or
lower rq produces a steeper filter. Too high values for
rq
may blow the filter up!
The amount of boost (when positive) or attenuation (when negative) applied to the frequency band, in decibels.
A Moog VCF style UGen.
A Moog VCF style UGen. This is a type of resonant low pass filter.
The design of this filter is described in Federico Fontana, "Preserving the Digital Structure of the Moog VCF." In: Proceedings of the ICMC, Copenhagen 2007. Ported to SuperCollider by Dan Stowell.
cutoff frequency in Hertz
filter resonance gain, between 0 and 4
when greater than zero, this will reset the state of the digital filters at the beginning of the next control block.
A UGen that normalizes the input amplitude to the given level.
A UGen that normalizes the input amplitude to the given level. Unlike
Compander
, this UGen will not overshoot, but it needs to look ahead in the
input signal, introducing a delay in its output. The delay time is equal to
twice the value of the dur
parameter (the buffer internally used).
input signal to be normalized
peak output amplitude level to which to normalize the input
look-ahead time in seconds. Shorter times will produce smaller delays and quicker transient response times, but may introduce amplitude modulation artifacts.
Number of audio buses.
Number of audio buses.
Maximum number of audio buffers.
Maximum number of audio buffers.
Number of control buses.
Number of control buses.
Number of input buses.
Number of input buses.
Number of output buses.
Number of output buses.
Number of currently running synths.
Number of currently running synths.
A one pole (IIR) filter UGen.
A one zero (FIR) filter UGen.
A one zero (FIR) filter UGen. Implements the formula :
out(i) = ((1 - abs(coef)) * in(i)) + (coef * in(i-1))
input signal to be processed
feed forward coefficient. +0.5 makes a two point
averaging filter (see also LPZ1
), -0.5 makes a
differentiator (see also HPZ1
), +1 makes a single
sample delay (see also Delay1
), -1 makes an inverted
single sample delay.
An onset detecting UGen for musical audio signals.
An onset detecting UGen for musical audio signals. It detects the beginning of notes/drumbeats/etc. Outputs a control-rate trigger signal which is 1 when an onset is detected, and 0 otherwise.
The onset detection should work well for a general range of monophonic and polyphonic audio signals. The onset detection is purely based on signal analysis and does not make use of any "top-down" inferences such as tempo.
There are different functions available for the analysis:
- 0 "power" -- generally OK, good for percussive input, and also very efficient - 1 "magsum" -- generally OK, good for percussive input, and also very efficient - 2 "complex" -- performs generally very well, but more CPU-intensive - 3 "rcomplex" (default) -- performs generally very well, and slightly more efficient than "complex" - 4 "phase" -- generally good, especially for tonal input, medium efficiency - 5 "wphase" -- generally very good, especially for tonal input, medium efficiency - 6 "mkl" -- generally very good, medium efficiency, pretty different from the other methods
The differences aren't large, so it is recommended you stick with the default "rcomplex" unless you find specific problems with it. Then maybe try "wphase". The "mkl" type is a bit different from the others so maybe try that too. They all have slightly different characteristics, and in tests perform at a similar quality level.
the output (buffer) of an FFT UGen which transforms the audio input to track. For the FFT chain, you should typically use a frame size of 512 or 1024 (at 44.1 kHz sampling rate) and 50% hop size (which is the default setting in SC). For different sampling rates choose an FFT size to cover a similar time-span (around 10 to 20 ms).
the detection threshold, typically between 0 and 1, although in rare cases you may find values outside this range useful
index of a function to be used to analyse the signal. See main paragraph for possible values (usually can be left to default).
(advanced setting) Specifies the time (in seconds) for the normalisation to "forget" about a recent onset. If you find too much re-triggering (e.g. as a note dies away unevenly) then you might wish to increase this value. Not used with "mkl".
(advanced setting) This is a lower limit, connected to the idea of how quiet the sound is expected to get without becoming indistinguishable from noise. For some cleanly-recorded classical music with wide dynamic variations, it was found helpful to go down as far as 1e-6. Not used with "mkl".
(advanced setting) Specifies a minimum gap (in FFT frames) between onset detections, a brute-force way to prevent too many doubled detections.
(advanced setting) Specifies the size (in FFT frames) of the median window used for smoothing the detection function before triggering.
(advanced setting) ?
(advanced setting) ?
A phase vocoder UGen that performs a complex addition of the two inputs.
A phase vocoder UGen that performs a complex addition of the two inputs. The
formula is (Re(A) + Re(B)) + i(Im(A) + Im(B))
.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
A phase vocoder UGen that randomizes the order of the bins.
A phase vocoder UGen that randomizes the order of the bins. The trigger will select a new random ordering.
the FFT'ed buffer
the amount of bins scrambled, from 0 (none) to 1 (all bins scrambled).
a value from zero to one, indicating the maximum randomized distance of a bin from its original location in the spectrum.
causes a new random bin re-ordering to be made. a trigger occurs when passing from non-positive to positive value.
A phase vocoder UGen that stretches and shifts the spectrum.
A phase vocoder UGen that stretches and shifts the spectrum. It takes each bin, first stretches (scales) its position (bin number) with a given factor, and then adds a shift to it.
the FFT'ed buffer
the factor to multiply each bin position with, where 0.5 kind of transposes the signal down by an octave, and 2 transposes it up by an octave.
the translation of the spectrum, in number of bins. Since the FFT produces a linear frequency axis, the will produce harmonic distortion.
A phase vocoder UGen that combine low and high bins from two inputs.
A phase vocoder UGen that combine low and high bins from two inputs. It does so by copying low bins from one input and the high bins of the other, thus realizes a kind of "wipe" between the two input signals.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
can range between -1 and +1. if wipe == 0 then the output is the same as inA. if wipe > 0 then it begins replacing with bins from inB from the bottom up. if wipe < 0 then it begins replacing with bins from inB from the top down.
PV_RandWipe
A phase vocoder UGen that clears bins above or below a cutoff point.
A phase vocoder UGen that clears bins above or below a cutoff point.
the FFT'ed buffer
can range between -1 and +1. if wipe == 0 then there is no effect. if wipe > 0 then it acts like a high pass filter, clearing bins from the bottom up. if wipe < 0 then it acts like a low pass filter, clearing bins from the top down.
A phase vocoder UGen that converts the bins into their complex conjugate counterparts.
A phase vocoder UGen that converts the bins into their complex conjugate counterparts. The complex conjugate is equal to the input, but with reversed sign of the imaginary part.
the FFT'ed buffer
A phase vocoder UGen that copies the spectral frames from chainA to chainB.
A phase vocoder UGen that copies the spectral frames from chainA to chainB. This allows for parallel processing of spectral data without the need for multiple FFT UGens, and to copy out data at that point in the chain for other purposes. chainA and chainB must be the same size. The output will carry further chainA, so you chan insert the ugen at the appropriate place in the signal chain.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
A phase vocoder UGen that combines the magnitudes of first input and phases of the second input.
A phase vocoder UGen that combines the magnitudes of first input and phases of the second input. phases of the first input.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
A phase vocoder UGen that adds a different constant random phase shift to each bin.
A phase vocoder UGen that adds a different constant random phase shift to each bin. The trigger will select a new set of random phases.
the FFT'ed buffer
to trigger a new selection of random phases. A trigger occurs when passing from non-positive to positive value.
A phase vocoder UGen that performs a complex division of the two inputs.
A phase vocoder UGen that performs a complex division of the two inputs. Be
careful that chainB
, the divisor, does not contain zeroes as they would
obviously blow up the division.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
A phase vocoder UGen that passes only those bins whose magnitudes constitute local maxima.
A phase vocoder UGen that passes only those bins whose magnitudes constitute local maxima. Additionally, the given threshold is also used to filter out bins whose magnitude lies below this threshold.
the FFT'ed buffer
magnitude threshold used for general filtering, prior to the local-maximum-filtering
A phase vocoder UGen that passes only those bins whose magnitudes are above a given threshold.
A phase vocoder UGen that passes only those bins whose magnitudes are above a given threshold.
the FFT'ed buffer
magnitude threshold.
A phase vocoder UGen that passes only those bins whose magnitudes are below a given threshold.
A phase vocoder UGen that passes only those bins whose magnitudes are below a given threshold.
the FFT'ed buffer
magnitude threshold.
A phase vocoder UGen that limits (clips) the magnitude of the bins to a given threshold.
A phase vocoder UGen that limits (clips) the magnitude of the bins to a given threshold.
the FFT'ed buffer
magnitude threshold. Each bin's magnitude is limited to be not greater than this threshold.
A phase vocoder UGen that divides magnitudes of two inputs and keeps the phases of the first input.
A phase vocoder UGen that divides magnitudes of two inputs and keeps the phases of the first input.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
the noise floor to assume when detecting zero bins in
chainB that would cause a division by zero and hence
blow up. The ugen will use divide by this magnitude
instead when zeroes are detected, resulting in a maximum
boost of zeroes.reciprocal
.
A phase vocoder UGen that freezes the magnitudes at current levels.
A phase vocoder UGen that freezes the magnitudes at current levels. Freezing happens when the freeze input has a value of > 0.
the FFT'ed buffer
whether the current levels are frozen (> 0) or not (0).
A phase vocoder UGen that multiplies the magnitudes of two inputs and keeps the phases of the first input.
A phase vocoder UGen that multiplies the magnitudes of two inputs and keeps the phases of the first input.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
A phase vocoder UGen that multiplies the magnitudes by random noise.
A phase vocoder UGen that multiplies the magnitudes by random noise.
the FFT'ed buffer
A phase vocoder UGen that stretches and shifts the magnitudes of the spectrum.
A phase vocoder UGen that stretches and shifts the magnitudes of the spectrum.
This is live PV_BinShift
but instead of scaling and shifting the whole complex
bins (magnitude and phase), this only operates on the magnitudes and leaves the
phases in their original bins.
the FFT'ed buffer
the factor to multiply each bin position with
the translation of the spectrum, in number of bins
A phase vocoder UGen that averages each bin's magnitude with its neighbors.
A phase vocoder UGen that averages each bin's magnitude with its neighbors.
the FFT'ed buffer
number of bins to average on each side of bin. As this number rises, so will CPU usage.
A phase vocoder UGen that squares the magnitudes and re-normalizes to previous peak.
A phase vocoder UGen that squares the magnitudes and re-normalizes to previous peak. This makes weak bins weaker.
the FFT'ed buffer
A phase vocoder UGen that outputs the bins with the maximum magnitude of the two inputs.
A phase vocoder UGen that outputs the bins with the maximum magnitude of the two inputs.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
A phase vocoder UGen that outputs the bins with the minimum magnitude of the two inputs.
A phase vocoder UGen that outputs the bins with the minimum magnitude of the two inputs.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
A phase vocoder UGen that performs a complex multiplication of the two inputs.
A phase vocoder UGen that performs a complex multiplication of the two inputs.
The formula is
(Re(A) * Re(B) - Im(A) * Im(B)) + i(Im(A) * Re(B) + Re(A) * Im(B))
.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
A phase vocoder UGen that shifts the phase of each bins by a given amount.
A phase vocoder UGen that shifts the phase of each bins by a given amount.
the FFT'ed buffer
phase shift in radians
A phase vocoder UGen that shift the phase of all bins by 270 (or -90) degrees.
A phase vocoder UGen that shift the phase of all bins by 270 (or -90) degrees.
the FFT'ed buffer
A phase vocoder UGen that shift the phase of all bins by 90 degrees.
A phase vocoder UGen that shift the phase of all bins by 90 degrees.
the FFT'ed buffer
A phase vocoder UGen that randomly clears out bins of the signal.
A phase vocoder UGen that randomly clears out bins of the signal. Which bins are wiped out is subject to a random choice (only the amount is specified) that remains constant between triggers.
the FFT'ed buffer
the probability (from 0 to 1) of bins being wiped out, hence 0 means no bins are wiped out, 1 means all bins are wiped out (output will be silence).
causes a new random bin selection to be made. a trigger occurs when passing from non-positive to positive value.
A phase vocoder UGen that cross-fades between two input spectra by taking bins randomly from them according to a given probability.
A phase vocoder UGen that cross-fades between two input spectra by taking bins randomly from them according to a given probability.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
the crossfader position from 0.0 (all bins are taken
from chainA
) to 1.0 (all bins are taken from chainB
). For instance, if wipe is 0.5, half of the bins are
taken from either input. The decision whether a bin is
taken from A or B is random, however remains constant
between two triggers.
a signal the triggers the re-newed process of determining for each bin whether it will be taken from input A or B. A trigger occurs when passing from non-positive to positive value.
PV_BinWipe
A phase vocoder UGen that makes a series of gaps in a spectrum.
A phase vocoder UGen that makes a series of gaps in a spectrum. This is done by multiplying the spectrum with a kind of rectangle wave that goes from zero to nyquist. The high slope of the rectangle lets the input bins pass (quasi pass-band), the low slope filters them out (quasi stop-band).
the FFT'ed buffer
the number of periods in the rectangle wave, where zero would mean the input signal is not affected, one means that there is exactly one period of the wave across the spectrum, hence one pass-band and one stop-band.
the phase offset of the rectangle wave, where 1.0 is one full period. This is like the offset into the wavetable holding the rectangle, so a value of 0.25 means we start 25% into the basic waveform, and after 0.75 periods the next full period (high slope) begins.
the pulse width between 0.0 (infinitely small high slope, so all bins filtered out) to 0.5 (half period is high slope, half period is low slope) to 1.0 (maximally wide high slope, no bins filtered out).
PV_RectComb2
A phase vocoder UGen that switches between two input spectra according to a rectangle wave.
A phase vocoder UGen that switches between two input spectra according to a
rectangle wave. This is basically identical to PV_RectComb
, however during
the low slopes of the rectangle wave, instead of clearing out the bins, it
copies over the corresponding bins of the second fft input buffer.
the first FFT'ed buffer (this gets replaced by the output signal)
the second FFT'ed buffer
the number of periods in the rectangle wave, where zero would mean the first input signal is fully passed through, one means that there is exactly one period of the wave across the spectrum, hence one pass-band (first signal passed through) and one stop-band (second signal passed through).
the phase offset of the rectangle wave, where 1.0 is one full period. This is like the offset into the wavetable holding the rectangle, so a value of 0.25 means we start 25% into the basic waveform, and after 0.75 periods the next full period (high slope) begins.
the pulse width between 0.0 (infinitely small high slope, so all bins are copied from the second input) to 0.5 (half period is high slope -- copied from first input --, half period is low slope -- copied from second input) to 1.0 (maximally wide high slope, so all bins passed from the first input).
PV_RectComb
An azimuth-based panorama UGen.
An azimuth-based panorama UGen. It uses vector-based-amplitude panning where
the arbitrary number of speakers is supposed to be distributed in a circle with
even spacing between them. It uses an equal-power-curve to transition between
adjacent speakers. Note the different default value for the orient
argument!
Use case: To spread an multi-channel input signal across an output bus with a
different number of channels, such that the first input channel is played on the
first output channel (no spread to adjacent channels) and the last input channel
is played to the last output channel (no spread to adjacent channels), you would
create a dedicated PanAz
per input channel where the pan position is
inChanIdx * 2f / (inChannels - 1) * (outChannels - 1) / outChannels
.
the number of output channels
the input signal
the pan position. Channels are evenly spaced over a
cyclic period of 2.0. the output channel position is
pos / 2 * numChannels + orient
. Thus, assuming an
orient
of 0.0
, and numChannels
being for example
3
, a pos
of 0*2.0/3 == 0.0
corresponds to the
first output channel, a pos
of 1*2.0/3
corresponds
to the second output channel, a pos
of 2*2.0/3=4.0/3
corresponds to the third and last output channel, and a
pos
of 3*2.0/3=2.0
completes the circle and wraps
again to the first channel. Using a bipolar pan
position, such as a sawtooth that ranges from -1 to +1,
all channels will be cyclically panned through.
a control rate level input (linear multiplier).
the width of the panning envelope. The default of 2.0 pans between pairs of adjacent speakers. Width values greater than two will spread the pan over greater numbers of speakers. Width values less than one will leave silent gaps between speakers.
the offset in the output channels regarding a pan
position of zero. Note that ScalaCollider uses a default
of zero which means that a pan pos of zero outputs the
signal exactly on the first output channel. This is
different in sclang where the default is 0.5 which means
that a pan position of zero will output the signal
between the first and second speaker. Accordingly, an
orient
of 1.0
would result in a channel offset of
one, where a pan position of zero would output the
signal exactly on the second output channel, and so
forth.
A UGen which pauses and resumes another node.
A UGen which pauses and resumes another node. Note that the UGen initially
assumes the node is running, that is, if gate
is initially 1, this will
not resume a paused node. Instead, the gate must go to zero and back to
one to resume the node. Additionally, this UGen will only cause action if the
gate value changes, that is, if the node is paused or resumed otherwise, this
UGen will not interfere with that action, unless the gate value is adjusted.
when 0, node is paused, when 1, node is resumed
the id of the node to be paused or resumed
A UGen that, when triggered, pauses enclosing synth.
A UGen that, when its input UGen is finished, pauses enclosing synth.
A UGen that, when its input UGen is finished, pauses enclosing synth. This is
essentially a shortcut for PauseSelf.kr(Done.kr(src))
, so instead of
providing a trigger signal it reads directly the done flag of an appropriate
ugen (such as Line
or PlayBuf
).
This UGen outputs its input signal for convenience.
the input UGen which when finished will trigger the action.
An autocorrelation based pitch following UGen.
An autocorrelation based pitch following UGen. It is more accurate than
ZeroCrossing
, but more also more CPU costly. For most purposes the default
settings can be used and only in
needs to be supplied.
The UGen has two outputs: The first output is the frequency estimate in Hertz,
the second output is a toggle hasFreq
, which tells whether a pitch was found
(1) or not (0). If the clarify
argument is used, hasFreq
has more fine
grained information.
The pitch follower executes periodically at the rate specified by execFreq
in
cps. First it detects whether the input peak to peak amplitude is above the
ampThresh
. If it is not then no pitch estimation is performed, the hasFreq
output is set to zero and the freq
output is held at its previous value.
Otherwise, the autocorrelation is calculated, and the first peak after the peak
around the lag of zero that is above peakThresh
times the amplitude of the
peak at lag zero is reported.
The signal to be analyzed.
The initial value of the freq
output, until the first
valid pitch is found.
The minimum frequency in Hertz to be considered for reporting.
The maximum frequency in Hertz to be considered for reporting.
The frequency at which the pitch is estimated. This
will be automatically clipped to be between minFreq
and maxFreq
.
A value which guides the search for the peak frequency in the first coarse step. Its setting does *not* affect the final pitch resolution; setting it larger will cause the coarse search to take longer, and setting it smaller will cause the fine search to take longer.
This specifies the length of a median filter applied to
the frequency output estimation. With the default value
of 1
the filter is defeated. Median filtering can help
eliminating single spikes and jitter. This will however
add latency to the output.
The minimum amplitude threshold above which the pitch follower operates. An input signal below this threshold is not analyzed.
This is a threshold used to find the first peak in the
autocorrelation signal which gives the reported
frequency. It is a factor of the energy of the signal
(autocorrelation coefficient at zero). Set this value
higher (e.g. to 1
) to eliminate false frequencies
corresponding to overtones.
An integer factor by which the input signal is down
sampled to reduce CPU overhead. This will also reduce
the pitch resolution. The default value of 1
means
that the input signal is not down sampled.
If the clarity
argument is greater than zero (it is
zero by default) then the hasFreq
output is given
additional detail. Rather than simply being 1 when a
pitch is detected, it is a "clarity" measure in the
range between zero and one. (Technically, it's the
height of the autocorrelation peak normalised by the
height of the zero-lag peak.) It therefore gives a kind
of measure of "purity" of the pitched signal.
A time domain granular pitch shifter.
A time domain granular pitch shifter. Grains have a triangular amplitude envelope and an overlap of 4:1.
The input signal.
The size of the grain window in seconds.
The ratio of the pitch shift. Must be from 0 to 4.
The maximum random deviation of the pitch from the pitchRatio.
A random offset of from zero to timeDispersion seconds is added to the delay of each grain. Use of some dispersion can alleviate a hard comb filter effect due to uniform grain placement. It can also be an effect in itself. timeDispersion can be no larger than windowSize.
A UGen to play back samples from a buffer in memory.
A UGen to play back samples from a buffer in memory.
PlayBuf
provides a kind of high-level interface to sample-playback, whereas
BufRd
represents a kind of lower-level access. While BufRd
has a
random-access-pointer in the form of a phase input, PlayBuf
advances the phase
automatically based on a given playback speed. PlayBuf
uses cubic
interpolation.
the number of channels that the buffer will be. Since this is a constant, a change in number of channels of the underlying bus must be reflected by creating different SynthDefs. If a buffer identifier is used of a buffer that has a different numChannels then specified in the PlayBuf, it will fail silently.
the identifier of the buffer to use
1 advances the play head by the server's sample rate
each second. So 2 means doubling speed (and pitch), and
0.5 means half speed (and half pitch). Negative numbers
can be used for backwards playback. If the underlying
buffer represents a sound at a different sample rate,
the rate should be multiplied by
BufRateScale.kr(bufID)
to obtain the correct speed.
a trigger which causes a jump to the given offset
. A
trigger occurs when a signal changes from non-positive
to positive (e.g. <= 0 to > 0).
sample frame to start playback. This is read when a trigger occurs. It may be fractional.
1 to loop after the play head reaches the buffer end, 0 to not loop. This can be modulated.
what to do when the play head reaches the buffer end.
This is only effective when loop
is zero.
A Karplus-Strong UGen.
A Karplus-Strong UGen.
An excitation signal.
Upon a negative to positive transition, the excitation signal will be fed into the delay line.
Maximum delay time in seconds (initializes the internal delay buffer).
Delay time in seconds.
Time for the echoes to decay by 60 decibels. Negative times emphasize odd partials.
the coefficient of the internal OnePole filter. Values should be between -1 and +1 (larger values will be unstable... so be careful!).
A UGen for printing the current output value of its input to the console.
A UGen for printing the current output value of its input to the console.
a non-positive to positive transition telling Poll to return a value
the signal you want to poll
a string or symbol to be printed with the polled value
if greater then 0, a "/tr"
OSC message is sent back
to the client (similar to SendTrig
)
A cubic-interpolating sound generator based on the difference equation:
A linear-interpolating sound generator based on the difference equation:
A non-interpolating sound generator based on the difference equation:
A resonant high pass filter UGen.
A resonant high pass filter UGen.
input signal to be filtered
cutoff frequency in Hertz
reciprocal of Q. The Q (or quality) is conventionally defined as cutoff-frequency / bandwidth, meaning that rq = bandwidth / cutoff-frequency. A higher Q or lower rq produces a steeper filter.
A resonant low pass filter UGen.
A resonant low pass filter UGen.
input signal to be filtered
cutoff frequency in Hertz
reciprocal of Q. The Q (or quality) is conventionally defined as cutoff-frequency / bandwidth, meaning that rq = bandwidth / cutoff-frequency. A higher Q or lower rq produces a steeper filter.
A UGen that delivers the conversion factor from frequency in Hertz to radians (normalized frequency).
A UGen that delivers the conversion factor from frequency in Hertz to radians
(normalized frequency). The relation is RadiansPerSample * sr = 2pi
, thus
multiplying the UGen with a frequency between zero and nyquist (sr/2) yields the
normalized frequency between zero and pi.
A UGen which produces a linear lag (time smear) regarding and input signal.
A UGen which produces a linear lag (time smear) regarding and input signal.
Other than Lag
which is a feedback filter with exponential decay, Ramp
applies a linear ramp. This is achieved by sampling the input signal at regular
intervals given by the lagTime
and starting a new line segment after each
interval.
the signal to smooth out
the ramp-time (seconds) which is also the interval of the sampling
Records input into a Buffer.
Records input into a Buffer. If recLevel is 1.0 and preLevel is 0.0 then the new input overwrites the old data. If they are both 1.0 then the new data is added to the existing data. (Any other settings are also valid.)
the signal to record
the identifier of the buffer to use
sample frame to begin writing from. This is read when a trigger occurs.
value to multiply by input before mixing with existing data.
value by which the previous buffer contents is multiplied when recording. If this value is zero, the buffer contents is completely overwritten. If this value is one, the new signal is added to the previous content.
if zero the recording pauses, otherwise it resumes. The value of run is only read at control-rate! When the recording is paused, the "write-head" remains in its current position and does not advance.
1 to loop after the write head reaches the buffer end, 0 to not loop. This can be modulated.
a trigger which causes a jump to the given offset
. A
trigger occurs when a signal changes from non-positive
to positive (e.g. <= 0 to > 0).
what to do when the write head reaches the buffer end.
This is only effective when loop
is zero.
A two pole resonant filter UGen.
A two pole resonant filter UGen. It has zeroes at z = +1
and z = -1
.
Based on K. Steiglitz, "A Note on Constant-Gain Digital Resonators", Computer Music Journal, vol 18, no. 4, pp. 8-10, Winter 1994.
input signal to be filtered
resonant frequency in Hertz
reciprocal of Q. The Q (or quality) is conventionally defined as center-frequency / bandwidth, meaning that rq = bandwidth / center-frequency. A higher Q or lower rq produces a steeper filter.
A resonant or "ringing" filter UGen.
A resonant or "ringing" filter UGen. This is the same as Resonz
, except that
instead of a Q parameter, the bandwidth is specified as a 60 dB ring decay time.
One Ringz
is equivalent to one component of the Klank
UGen.
input signal to be filtered
resonant frequency in Hertz
the 60 dB decay time in seconds
A UGen calculating the running sum of an input signal over a given number of samples.
A UGen calculating the running sum of an input signal over a given number of samples.
the input signal to sum up
the length of the sliding window over the input signal. these are the number of audio sample-frames for audio-rate calculation, or the number of blocks for control-rate calculation summed up.
A second order filter section (biquad) UGen.
A second order filter section (biquad) UGen. Filter coefficients are given directly rather than calculated for you. The formula is equivalent to:
out(i) = a0 * in(i) + a1 * in(i-1) + a2 * in(i-2) + b1 * out(i-1) + b2 * out(i-2)
input signal to be filtered
A UGen that reports the server's current (audio) sample period in seconds.
A UGen that reports the server's current (audio) sample period in seconds. This
is equivalent to the reciprocal of SampleRate
A UGen that reports the server's current (audio) sample rate.
A UGen that reports the server's current (audio) sample rate. This is
equivalent to the reciprocal of SampleDur
A Schmidt trigger UGen.
A Schmidt trigger UGen. Initially it outputs zero. When the input signal rises
above hi
, its output switches to 1.0, which is hold until the signal falls
below lo
, switching the output again to 0.0. The produces a kind of
hysteresis behavior, preventing heavy oscillations in a noisy system which might
occur with a single-threshold trigger.
input signal to be analyzed
low threshold
high threshold
A UGen which selects among a sequence of inputs, according to an index signal.
A UGen which selects among a sequence of inputs, according to an index signal.
Note that, although only one signal of the multi
input is let through at a
time, sill all ugens are continuously running.
an index signal into the channels of the in
argument.
The index is automatically clipped to lie between 0
and in.numOutputs - 1
. The index is truncated to its
integer part (not rounded), hence using for instance an
index of 0.9
will still be interpreted as index 0
.
a graph element which is composed of the channels to be indexed.
A UGen which sends an sequence of values from the server to all notified clients upon receiving triggers.
A UGen which sends an sequence of values from the server to all notified
clients upon receiving triggers. The message sent is
OSCMessage(<(String) msgName>, <(Int) nodeID>, <(Int) replyID>, <(Float) values>*)
.
For sending a single value, SendTrig
provides an alternative.
a non-positive to positive transition triggers a message
a graph element comprising the signal channels to be polled
a string specifying the OSCMessage's name. by convention, this should start with a forward slash and contain only 7-bit ascii characters.
an integer identifier which is contained in the reply
message. While you can distinguish different SendReply
instances from the same Synth by choosing different
OSCMessage names, depending on the application you may
use the same message name but different ids (similar to
SendTrig
).
The argument order is different from its sclang counterpart.
A UGen that sends a value from the server to all notified clients upon receiving triggers.
A UGen that sends a value from the server to all notified clients upon
receiving triggers. The message sent is
OSCMessage("/tr", <(Int) nodeID>, <(Int) trigID>, <(Float) value>)
.
For sending an array of values, or using an arbitrary reply command, see
SendReply
.
the trigger signal causing the value to be read and sent. A trigger occurs when passing from non-positive to positive.
a changing signal or constant that will be polled at the time of trigger, and its value passed with the trigger message
an arbitrary integer that will be sent along with the
"/tr"
message. This is useful to distinguish between
several SendTrig instances per SynthDef.
The argument order is different from its sclang counterpart.
A sinusoidal (sine tone) oscillator UGen.
A slew rate limiter UGen.
A slew rate limiter UGen. Limits the slope of an input signal. The slope is expressed in units per second.
input signal
maximum upward slope.
maximum downward slope.
A UGen measuring the slope of signal.
A UGen measuring the slope of signal. It calculates the rate of change per second of a signal, as given by the following formula:
out(i) = (in(i) - in(i-1)) * sampleRate
It thus equal to HPZ1.ar(_) * 2 * SampleRate.ir
input signal to be measured
A UGen to measure the spectral centroid.
A UGen to measure the spectral centroid. Given an FFT chain, this measures the spectral centroid, which is the weighted mean frequency, or the "centre of mass" of the spectrum. (DC is ignored.) This can be a useful indicator of the perceptual brightness of a signal.
Note that the output frequency is pretty close to the correct value when
feeding in a sine signal, but the estimate is usually too high when using for
example filtered noise. In that case, you will get better results using
SpecPcile
at 50%.
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
the fft signal (buffer) to analyze
A UGen to measure spectral flatness.
A UGen to measure spectral flatness. Given an FFT chain this calculates the Spectral Flatness measure, defined as a power spectrum's geometric mean divided by its arithmetic mean. This gives a measure which ranges from approx 0 for a pure sinusoid, to approx 1 for white noise.
The measure is calculated linearly. For some applications you may wish to
convert the value to a decibel scale. Note that this UGen may output NaN
when the input is zero (probably due to division by zero). In that case,
CheckBadValues
can be used to prevent further problems.
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
the fft signal (buffer) to analyze
A UGen to find the percentile of a signal's magnitude spectrum.
A UGen to find the percentile of a signal's magnitude spectrum. Given an FFT
chain this calculates the cumulative distribution of the frequency spectrum, and
outputs the frequency value which corresponds to the desired percentile. For
example, to find the frequency at which 90% of the spectral energy lies below
that frequency, you want the 90-percentile, which means the value of percent
should be 0.9. The 90-percentile or 95-percentile is often used as a measure of
spectral roll-off.
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
the fft signal (buffer) to analyze
the percentage between 0.0 (0%) and 1.0 (100%)
specifies whether interpolation should be used to try and make the percentile frequency estimate more accurate, at the cost of a little higher CPU usage. Set it to 1 to enable this.
A linear-interpolating sound generator based on the difference equations:
A linear-interpolating sound generator based on the difference equations:
x[n+1] = (x[n] + y[n+1]) % 2pi y[n+1] = (y[n] + k * sin(x[n])) % 2pi
The standard map is an area preserving map of a cylinder discovered by the plasma physicist Boris Chirikov.
Iteration frequency in Hertz
Perturbation amount
Initial value of x
Initial value of y
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = (x[n] + y[n+1]) % 2pi y[n+1] = (y[n] + k * sin(x[n])) % 2pi
The standard map is an area preserving map of a cylinder discovered by the plasma physicist Boris Chirikov.
Iteration frequency in Hertz
Perturbation amount
Initial value of x
Initial value of y
A pulse counting UGen.
A pulse counting UGen. Each trigger increments a counter which is output as a
signal. The counter wraps inside the interval from lo
to hi
(inclusive).
That if you use a lo
other than zero, you might want to adjust resetVal
as
well. Stepper
always starts with the value in resetVal
, no matter what lo
is or whether the reset
trigger is high or not.
The trigger signal which increments the counter. A
trigger happens when the signal changes from
non-positive to positive. Note that if the UGen is
created with the trigger initially high, the counter
will also be incremented immediately. Thus a
Stepper.kr(Impulse.kr(1))
will begin by outputting 1
. If you want to avoid this, you could their subtract
Impulse.kr(0)
from the trigger input, or set
resetVal
to hi
. E.g.
Stepper.kr(Impulse.kr(1), lo = 0, hi = 4, resetVal = 4)
will produce the sequence 0, 1, 2, 4, 0, ...
A trigger which resets the counter to resetVal
immediately.
The minimum value output. For a decremental step
value, the counter jumps to hi
if it were to fall
below lo
.
The maximum value output. For an incremental step
value, the counter jumps to lo
if it were to rise
beyond hi
.
The amount by which the counter increases or decreases
upon receiving triggers. Note that if you use a
decremental counter, still lo
must be the minimum and
hi
must be the maximum value output. If lo
> hi
,
the UGen behaves wrongly. In the case of decremental
counter, set resetVal
to hi
. E.g. to count from 4
down to 0, use
Stepper.kr(trig, lo = 0, hi = 4, step = -1, resetVal = 4)
, or, if you want to ignore an initial high trigger, you
could do
Stepper.kr(Impulse.kr(1), lo = 0, hi = 4, step = -1, resetVal = 0)
-- so resetVal
is lo
but due to the initial trigger
from Impulse
the Stepper
will in fact start
outputting from 4
.
A frequency domain stereo convolution UGen, capable of performing linear cross-fades between kernel updates.
A frequency domain stereo convolution UGen, capable of performing linear cross-fades between kernel updates. When receiving a trigger, there is a linear cross-fade between the old kernel the new buffer contents. It operates similar to Convolution2L, however uses two buffers and outputs a stereo signal, resulting in better CPU usage than two discrete instances of Convolution2L as this way one FFT transformation per period is saved.
the realtime input to be convolved
buffer identifier for the left channel's fixed kernel, which may be modulated in combination with the trigger
buffer identifier for the right channel's fixed kernel, which may be modulated in combination with the trigger
updates the kernel on a change from non-positive to positive (<= 0 to >0), and starts a new cross-fade from the previous kernel to the new one over the given amount of periods.
size of each kernel. this must be a power of two. the FFT calculated internally by the UGen has a size of twice this value. The maximum allowed frameSize is 65536(?).
The number of periods over which a cross-fade is performed. This must be an integer
A UGen that reports the fractional sample offset of the current Synth from its requested scheduled start.
A UGen that reports the fractional sample offset of the current Synth from its requested scheduled start.
When a synth is created from a time stamped osc-bundle, it starts calculation
at the next possible block (normally 64 samples). Using an OffsetOut
UGen, one
can delay the audio so that it matches sample accurately.
For some synthesis methods, one even needs subsample accuracy.
SubsampleOffset
provides the information where, within the current sample, the
synth was scheduled. It can be used to offset envelopes or resample the audio
output.
A UGen which starts a linear raise from zero each time it is triggered.
A UGen which starts a linear raise from zero each time it is triggered.
When speed is one, one gets a continually-updating measurement of the time (in seconds) since the last trigger.
the trigger that restarts the ramp, when passing from non-positive to positive
the amount of increment of the output signal per
second. In SCLang this argument is named rate
, while
ScalaCollider uses speed
to avoid conflict with the
UGen's calculation rate.
A delay UGen for trigger signals.
A delay UGen for trigger signals. Other than a normal buffer delay, any new trigger arriving in the time between the previous trigger and the passing of the delay time is ignored.
The input trigger. A trigger is recognized when the signal passes from non-positive to positive. Note that, no matter what the amplitude of the input trigger is, the UGen will output a delayed trigger of amplitude 1.0.
The delay time in seconds.
A UGen which polls results from demand-rate ugens in intervals specified by a duration input, and outputs them as trigger values.
A UGen which polls results from demand-rate ugens in intervals specified by a
duration input, and outputs them as trigger values. A value from the level
ugen is demanded and output for one sample (when running at audio-rate) or one
block (when running at control-rate) according to a stream of duration values.
When there is a trigger at the reset input, the level
and the dur
input are
reset.
the provider of time values. Can be a demand-rate ugen or any signal. The next poll is acquired after the previous duration.
a demand-rate ugen providing the output values.
a trigger which resets the dur input (if demand-rated) and the the level input ugen. The reset input may also be a demand-rate ugen, in this case providing a stream of reset times.
a doneAction that is evaluated when the duration stream ends.
when 0 (default), the UGen does the first level poll immediately and then waits for the first duration value. When this is 1, the UGen initially polls the first duration value, waits for that duration, and then polls the first level (along with polling the next duration value).
Triggers generate grains from a buffer.
Triggers generate grains from a buffer. Each grain has a Hanning envelope
(sin2(x) for x from 0 to ᅬタ)
and is panned between two channels of multiple outputs.
Number of output channels.
At each trigger, the following arguments are sampled and used as the arguments of a new grain. A trigger occurs when a signal changes from non-positive to positive value. If the trigger is audio rate then the grains will start with sample accuracy.
The buffer index. It must be a one channel (mono) buffer.
1.0 is normal, 2.0 is one octave up, 0.5 is one octave down -1.0 is backwards normal rate etc.
The position in the buffer in seconds at which the grain envelope will reach maximum amplitude.
Duration of the grain in seconds.
A value from -1 to 1. Determines where to pan the output in the same manner as PanAz.
Amplitude of the grain.
1, 2, or 4. Determines whether the grain uses (1) no interpolation, (2) linear interpolation, or (4) cubic interpolation.
A UGen providing a probability-weighted index into a sequence upon receiving a trigger.
A UGen providing a probability-weighted index into a sequence upon receiving a trigger.
When triggered, returns a random index value based the values of the channels
of the prob
argument functioning as probabilities. The index is zero based,
hence goes from 0
to prob.numOutputs - 1
.
By default the sequence of probabilities should sum to 1.0, however for
convenience, this can be achieved by the ugen when the normalize
flag is set
to 1 (less efficient).
the trigger used to calculate a new index. a trigger occurs when passing from non-positive to positive
a multi-channel graph element, where the output channels correspond to to the probabilities of their respective indices being chosen.
0
if the seq argument already sums up to 1.0 and thus
doesn't need normalization, 1
if the sum is not
guaranteed to be 1.0 and thus the ugen is asked to
provide the normalization.
A UGen that returns time since last triggered.
A UGen that returns time since last triggered. The time returned is in seconds
and is measured from the last received trigger. Note that currently it seems the
initial memory is at -1 sample, so for Impulse.ar(1)
the result (at 44.1 kHz)
is 2.26757e-05, followed strangely by 1.00002, and then (as expected) 1.0.
the trigger to update the output signal. A trigger occurs when trig signal crosses from non-positive to positive.
A UGen that toggles like a flip-flop between zero and one upon receiving a trigger.
A UGen that toggles like a flip-flop between zero and one upon receiving a trigger. The flip-flop initially outputs zero and changes to one when the first trigger arrives.
a signal to trigger the flip-flop. a trigger occurs when the signal changes from non-positive to positive.
A UGen which outputs a value of 1 for a given duration when triggered.
A UGen which outputs a value of 1 for a given duration when triggered.
When a trigger occurs at the input, a value of 1 is output for the specified duration, otherwise zero is output. When a new trigger occurs while this ugens outputs 1, the hold-time is reset to the duration.
the trigger. This can be any signal. A trigger happens when the signal changes from non-positive to positive.
the duration for which the ugens holds the value of 1 when triggered
A two pole filter UGen.
A two zero filter UGen.
A UGen to stream in a signal from an audio file with variable playback speed.
A UGen to stream in a signal from an audio file with variable playback speed. Continuously plays a longer audio file from disk. This requires a buffer to be preloaded with one buffer size of sound. If loop is set to 1, the file will loop.
Note: The buffer size must be a multiple of (2 * the server's block
size). See Buffer#cue
for details.
If the speed is too high, the UGen will not execute, posting a warning.
the amount of channels the file and the buffer will have. This is an Int and hence must be pre-determined. Different SynthDefs must be created for different numbers of channels
the id of the buffer with the correct number of channels and frames
controls the speed of playback. The buffer is always
streamed at a frequency of SampleRate.ir * speed
, so
the buffer's own sample rate is irrelevant. Factors
below 4 are probably fine, but the higher the value, the
more disk activity there is, and the more likelihood
there will be a problem. The following must be true:
rate < bufFrames / (2 * blockSize)
, e.g with typical
default values, this will be 32768 / (2 * 64) = 256
.
whether the file should loop when its end is reached
If a value other than zero is used, the UGen sends an
OSC message with this id and the file position each time
it reloads the buffer:
OSCMessage("/diskin", nodeID, sendID, frame)
A UGen which reads a single sample value from a buffer at a given index.
A UGen which reads a single sample value from a buffer at a given index.
It uses the in
argument as index into the buffer, truncating that argument to
an integer. Out-of-range index values are wrapped around the valid range. For
example, if the buffer has four samples, index 4 is wrapped to index 0, index 5
is wrapped to index 1, index -1 is wrapped to index 3, index -2 is wrapped to
index 2, etc.
While designed for monophonic buffers, it works with multi-channel buffers by
treating them as de-interleaved. See the Index
UGen for details.
The buffer to read from.
The sample index into the buffer. This is truncated to an integer automatically.
An equal power two channel cross fading UGen.
An equal power two channel cross fading UGen.
The first input signal
The second input signal
the cross-fade position from -1
(only input A
audible) to +1
(only input B audible)
An overall amplitude multiplier that is applied to the output signal
An exponential curve generator UGen that moves from a start value to the end value in a given duration.
An exponential curve generator UGen that moves from a start value to the end value in a given duration.
At a given point in time 0 <= t <= dur
, the output value is
start * (stop/start).pow(t/dur)
.
Warning: It must be ensured that the both start
is not zero and start
and end
have the same sign (e.g. a start
of -1
and an end of -0.001
are
valid), otherwise the UGen will output a NaN
! While in the case of end
being zero the UGen will also output zero, it is recommended to treat this case
as pathological as well.
Starting value
Ending value
Duration in seconds
A done-action that is evaluated when the Line has reached the end value after the given duration
The argument order is different from its sclang counterpart.
All pass delay line with cubic interpolation.
All pass delay line with linear interpolation.
All pass delay line with no interpolation.
An amplitude follower UGen.
An amplitude follower UGen. Tracks and reports the peak amplitude of its input signal.
// use sound-card input to control pulse amplitude play { // use headphones to prevent feedback! Pulse.ar(90, 0.3) * Amplitude.kr(PhysicalIn.ar(0)) }
// compare with known amplitude play { val amp = MouseX.kr val in = PinkNoise.ar(amp) val ana = Amplitude.kr(amp, attack = 2, release = 2) (ana - amp).poll(2, "discrepancy") in }
An all pass filter UGen.
An all pass filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
An band pass filter UGen.
An band pass filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
An band stop (reject) filter UGen.
An band stop (reject) filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
A 2nd order (12db per oct roll-off) resonant high pass filter UGen.
A 2nd order (12db per oct roll-off) resonant high pass filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
A high shelf equalizer UGen.
A high shelf equalizer UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
A 2nd order (12db per oct roll-off) resonant low pass filter UGen.
A 2nd order (12db per oct roll-off) resonant low pass filter UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
A low shelf equalizer UGen.
A low shelf equalizer UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
A second order band pass filter UGen.
A second order band pass filter UGen.
// modulated frequency play { val in = Saw.ar(200) * 0.5 val freq = SinOsc.ar(XLine.ar(0.3, 100, 20)).madd(3600, 4000) BPF.ar(in, freq) }
// mouse controlled frequency and Q play { val in = WhiteNoise.ar(0.5) val freq = MouseX.kr(200, 10000, 1) val q = MouseY.kr(1, 100, 1) // bottom to top val flt = BPF.ar(in, freq, q.reciprocal) flt * q.sqrt // compensate for energy loss }
a special fixed band-pass filter UGen.
a special fixed band-pass filter UGen. Implements the formula :
out(i) = 0.5 * (in(i) - in(i-2))
This filter cuts out frequencies around zero Hertz and Nyquist.
// engage with mouse button play { val sig = WhiteNoise.ar(0.5) val flt = BPZ2.ar(sig) LinXFade2.ar(sig, flt, MouseButton.kr(-1, 1)) }
An parametric equalizer UGen.
An parametric equalizer UGen. The B equalization suite is based on the Second Order Section (SOS) biquad UGen.
Note: Biquad coefficient calculations imply certain amount of CPU overhead. These plugin UGens contain optimizations such that the coefficients get updated only when there has been a change to one of the filter's parameters. This can cause spikes in CPU performance and should be considered when using several of these units.
A second order band reject (notch) filter UGen.
A second order band reject (notch) filter UGen.
// modulated frequency play { val in = Saw.ar(200) * 0.5 val freq = SinOsc.ar(XLine.ar(0.3, 100, 20)).madd(3600, 4000) BRF.ar(in, freq) }
// mouse controlled frequency and Q play { val in = WhiteNoise.ar(0.5) val freq = MouseX.kr(200, 10000, 1) val q = MouseY.kr(0.5, 10, 1) // bottom to top BRF.ar(in, freq, q.reciprocal) }
a special fixed band-reject filter UGen.
a special fixed band-reject filter UGen. Implements the formula :
out(i) = 0.5 * (in(i) + in(i-2))
This filter cuts out frequencies around half of the Nyquist frequency.
// engage with mouse button play { val sig = WhiteNoise.ar(0.5) val flt = BRZ2.ar(sig) LinXFade2.ar(sig, flt, MouseButton.kr(-1, 1)) }
An equal power two channel balancing UGen.
An equal power two channel balancing UGen. It takes a left and right input
signal and attenuates them according to the pos
value, producing again a
stereophonic output.
An autocorrelation based beat tracker UGen.
An autocorrelation based beat tracker UGen.
The underlying model assumes 4/4, but it should work on any isochronous beat structure, though there are biases to 100-120 bpm; a fast 7/8 may not be tracked in that sense. There are four control-rate outputs, being ticks at quarter, eighth and sixteenth level from the determined beat, and the current detected tempo. Note that the sixteenth note output won't necessarily make much sense if the music being tracked has swing; it is provided just as a convenience.
This beat tracker determines the beat, biased to the mid-tempo range by weighting functions. It does not determine the measure level, only a tactus. It is also slow reacting, using a 6 second temporal window for its autocorrelation maneuvres. Don't expect human musician level predictive tracking.
On the other hand, it is tireless, relatively general (though obviously best at transient 4/4 heavy material without much expressive tempo variation), and can form the basis of computer processing that is decidedly faster than human.
Warning: This UGen only works properly at 44.1 or 48.0 kHz.
A template matching beat tracker UGen.
A template matching beat tracker UGen. This beat tracker is based on exhaustively testing particular template patterns against feature streams; the testing takes place every 0.5 seconds. The two basic templates are a straight (groove=0) and a swung triplet (groove=1) pattern of 16th notes; this pattern is tried out at scaling factors corresponding to the tempi from 60 to 180 bpm. This is the cross-correlation method of beat tracking. A majority vote is taken on the best tempo detected, but this must be confirmed by a consistency check after a phase estimate. Such a consistency check helps to avoid wild fluctuating estimates, but is at the expense of an additional half second delay. The latency of the beat tracker with default settings is thus at least 2.5 seconds; because of block-based amortisation of calculation, it is actually around 2.8 seconds latency for a 2.0 second temporal window.
This beat tracker is designed to be flexible for user needs; you can try out different window sizes, tempo weights and combinations of features. However, there are no guarantees on stability and effectiveness, and you will need to explore such parameters for a particular situation.
The UGen has six outputs corresponding to beat-tick, eighth-tick, groove-tick, tempo, phase, and groove. Warning: it reads from input control bus instead of taking a regular control input signal as its first argument!
All pass delay line with cubic interpolation which uses a buffer for its internal memory.
All pass delay line with cubic interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
// Compare interpolation types // allocate buffer val b = Buffer.alloc(s, (0.2 * s.sampleRate).toInt.nextPowerOfTwo) // Since the allpass delay has no audible effect as a resonator on // steady state sound ... play { BufAllpassC.ar(b.id, WhiteNoise.ar(0.1), XLine.kr(0.0001, 0.01, 20), 0.2) } // ...these examples add the input to the effected sound and compare variants so that you can hear // the effect of the phase comb: play { val z = WhiteNoise.ar(0.2) z + BufAllpassN.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } play { val z = WhiteNoise.ar(0.2) z + BufAllpassL.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } play { val z = WhiteNoise.ar(0.2) z + BufAllpassC.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } b.free() // after synths have been stopped
All pass delay line with linear interpolation which uses a buffer for its internal memory.
All pass delay line with linear interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
// Compare interpolation types // allocate buffer val b = Buffer.alloc(s, (0.2 * s.sampleRate).toInt.nextPowerOfTwo) // Since the allpass delay has no audible effect as a resonator on // steady state sound ... play { BufAllpassC.ar(b.id, WhiteNoise.ar(0.1), XLine.kr(0.0001, 0.01, 20), 0.2) } // ...these examples add the input to the effected sound and compare variants so that you can hear // the effect of the phase comb: play { val z = WhiteNoise.ar(0.2) z + BufAllpassN.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } play { val z = WhiteNoise.ar(0.2) z + BufAllpassL.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } play { val z = WhiteNoise.ar(0.2) z + BufAllpassC.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } b.free() // after synths have been stopped
All pass delay line with no interpolation which uses a buffer for its internal memory.
All pass delay line with no interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
// Compare interpolation types // allocate buffer val b = Buffer.alloc(s, (0.2 * s.sampleRate).toInt.nextPowerOfTwo) // Since the allpass delay has no audible effect as a resonator on // steady state sound ... play { BufAllpassC.ar(b.id, WhiteNoise.ar(0.1), XLine.kr(0.0001, 0.01, 20), 0.2) } // ...these examples add the input to the effected sound and compare variants so that you can hear // the effect of the phase comb: play { val z = WhiteNoise.ar(0.2) z + BufAllpassN.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } play { val z = WhiteNoise.ar(0.2) z + BufAllpassL.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } play { val z = WhiteNoise.ar(0.2) z + BufAllpassC.ar(b.id, z, XLine.kr(0.0001, 0.01, 20), 0.2) } b.free() // after synths have been stopped
// Used as echo val b = Buffer.alloc(s, (0.2 * s.sampleRate).toInt.nextPowerOfTwo) // doesn't really sound different than Comb, // but it outputs the input signal immediately (inverted) and the echoes // are lower in amplitude. play { BufAllpassN.ar(b.id, Decay.ar(Dust.ar(1) * 0.5, 0.2) * WhiteNoise.ar, 0.2, 3) } b.free()
Returns the current number of channels of the buffer at the provided index.
Comb delay line with cubic interpolation which uses a buffer for its internal memory.
Comb delay line with cubic interpolation which uses a buffer for its internal memory.
// Compare interpolation // These examples compare the variants, so that you can hear the difference in interpolation // allocate buffer val b = Buffer.alloc(s, (0.01 * s.sampleRate).toInt.nextPowerOfTwo) // Comb used as a resonator. The resonant fundamental is equal to // reciprocal of the delay time. play { BufCombN.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } play { BufCombL.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } play { BufCombC.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } // with negative feedback play { BufCombN.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } play { BufCombL.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } play { BufCombC.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } b.free() // do this after the synths have ended
Comb delay line with linear interpolation which uses a buffer for its internal memory.
Comb delay line with linear interpolation which uses a buffer for its internal memory.
// Compare interpolation // These examples compare the variants, so that you can hear the difference in interpolation // allocate buffer val b = Buffer.alloc(s, (0.01 * s.sampleRate).toInt.nextPowerOfTwo) // Comb used as a resonator. The resonant fundamental is equal to // reciprocal of the delay time. play { BufCombN.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } play { BufCombL.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } play { BufCombC.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } // with negative feedback play { BufCombN.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } play { BufCombL.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } play { BufCombC.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } b.free() // do this after the synths have ended
Comb delay line with no interpolation which uses a buffer for its internal memory.
Comb delay line with no interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
// Compare interpolation // These examples compare the variants, so that you can hear the difference in interpolation // allocate buffer val b = Buffer.alloc(s, (0.01 * s.sampleRate).toInt.nextPowerOfTwo) // Comb used as a resonator. The resonant fundamental is equal to // reciprocal of the delay time. play { BufCombN.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } play { BufCombL.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } play { BufCombC.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) } // with negative feedback play { BufCombN.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } play { BufCombL.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } play { BufCombC.ar(b.id, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) } b.free() // do this after the synths have ended
// Used as an echo val b = Buffer.alloc(s, (0.2 * s.sampleRate).toInt.nextPowerOfTwo) play { BufCombN.ar(b.id, Decay.ar(Dust.ar(1) * 0.5, 0.2) * WhiteNoise.ar, 0.2, 3) } b.free() // do this after the synth has ended
Simple delay line with cubic interpolation which uses a buffer for its internal memory.
Simple delay line with cubic interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Simple delay line with linear interpolation which uses a buffer for its internal memory.
Simple delay line with linear interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
Simple delay line with no interpolation which uses a buffer for its internal memory.
Simple delay line with no interpolation which uses a buffer for its internal memory.
Warning: For reasons of efficiency, the effective buffer size is the allocated size rounded down to the next power of two. For example, if 44100 samples are allocated, the maximum delay would be 32768 samples. Also note that the buffer must be monophonic.
// Random white-noise decay // allocate buffer val b = Buffer.alloc(s, (0.2 * s.sampleRate).toInt.nextPowerOfTwo, 1) // Dust randomly triggers Decay to create an exponential // decay envelope for the WhiteNoise input source. // We apply a slight filter to the delayed signal // so it is easier to distinguish play { val z = Decay.ar(Dust.ar(1) * 0.5, 0.3) * WhiteNoise.ar LPF.ar(BufDelayN.ar(b.id, z, 0.2), 8000) + z // input is mixed with delay } b.free() // do this after the synth has ended
Returns the current duration of the buffer at the provided index.
Returns the number of allocated frames of the buffer at the provided index.
Returns a ratio by which the playback of the buffer at the provided index is to be scaled relative to the current sample rate of the server.
Returns a ratio by which the playback of the buffer at the provided index is to be scaled relative to the current sample rate of the server.
buffer sample rate / server sample rate
A UGen which reads the content of a buffer, using an index pointer.
A UGen which reads the content of a buffer, using an index pointer.
Warning: if the supplied bufID
refers to a buffer whose number of channels
differs from numChannels
, the UGen will fail silently.
An alternative to BufRd
is PlayBuf
. While PlayBuf
plays through the
buffer by itself, BufRd
only moves its read point by the index input and
therefore has no pitch input. PlayBuf
uses cubic interpolation, while BufRd
has variable interpolation. PlayBuf
can determine the end of the buffer and
issue a done-action.
// Write and read val b = Buffer.alloc(s, numFrames = 32768, numChannels = 1) // write into the buffer with a BufWr val y = play { val in = SinOsc.ar(LFNoise1.kr(2).madd(300, 400)) * 0.1 val rate = "rate" kr 1 BufWr.ar(in, b.id, Phasor.ar(0, BufRateScale.kr(b.id) * rate, 0, BufFrames.kr(b.id))) 0.0 // quiet } // read it with a BufRd val x = play { val rate = "rate" kr 1 BufRd.ar(1, b.id, Phasor.ar(0, BufRateScale.kr(b.id) * rate, 0, BufFrames.kr(b.id))) } y.set("rate" -> 0.5) // notice the clicks when the play head overtakes the write head! x.set("rate" -> 0.5) y.set("rate" -> 1.0)
Returns the buffer's current sample rate.
Returns the current number of allocated samples in the Buffer at the provided index.
Returns the current number of allocated samples in the Buffer at the provided index. A sample is not the same as a frame (compare with BufFrames ); a frame includes the samples in each channel of the buffer. Only for a mono buffer are samples the same as frames.
samples = frames * numChannels
A UGen that writes a signal to a buffer, using an index pointer.
A UGen that writes a signal to a buffer, using an index pointer.
Warning: if the supplied bufID
refers to a buffer whose number of channels
differs from those of the input signal, the UGen will fail silently.
An alternative to BufWr
is RecordBuf
. While RecordBuf
advances the index
into the buffer by itself, BufWr
only moves its write point by the index
input, making it possible to adjust the writing speed or to access the buffer in
a non-linear way. RecordBuf
can determine the end of the buffer and issue a
done-action.
// record and playback // a two second mono buffer val b = Buffer.alloc(s, numFrames = s.sampleRate.toInt * 2) val y = play { val sig = SinOsc.ar(LFNoise1.kr(2).madd(300, 400)) * 0.1 val rate = "rate" kr 1 BufWr.ar(in = sig, buf = b.id, index = Phasor.ar(speed = BufRateScale.kr(b.id) * rate, lo = 0, hi = BufFrames.kr(b.id))) 0.0 // quiet } // read it with a BufRd val x = play { val rate = "rate" kr 1 BufRd.ar(1, buf = b.id, index = Phasor.ar(speed = BufRateScale.kr(b.id) * rate, lo = 0, hi = BufFrames.kr(b.id))) } x.set("rate" -> 5) y.set("rate" -> 3) x.set("rate" -> 2)
A UGen to test for infinity, not-a-number (NaN), and denormal numbers.
A UGen to test for infinity, not-a-number (NaN), and denormal numbers. Its output is as follows: 0 = a normal float, 1 = NaN, 2 = infinity, and 3 = a denormal. According to the post settings it will print the information to the console along with a given identifier.
The argument order is different from its sclang counterpart.
Comb delay line with cubic interpolation.
Comb delay line with linear interpolation.
Comb delay line with no interpolation.
A compressor, expander, limiter, gate and ducking UGen.
A compressor, expander, limiter, gate and ducking UGen. This dynamic processor uses a hard-knee characteristic. All of the thresholds and ratios are given as direct values, not in decibels!
A UGen that reports the server's current control period in seconds.
A UGen that reports the server's current control period in seconds. This is
equivalent to the reciprocal of ControlRate
// print the control period play { ControlDur.ir.poll(0) }
A UGen that reports the server's current control rate.
A UGen that reports the server's current control rate. This is equivalent to
the reciprocal of ControlDur
// print the control rate play { ControlRate.ir.poll(0) }
// play a sine tone at control rate play { SinOsc.ar(ControlRate.ir) * 0.1 }
A frequency-domain convolution UGen using a fixed kernel which can be updated by a trigger signal.
A frequency-domain convolution UGen using a fixed kernel which can be updated
by a trigger signal. The delay caused by the convolution when the kernel is a
dirac impulse is equal to frameSize - (controlBlockSize + 1)
(measured august
2010), so for a frameSize of 2048 and a controlBlockSize of 64, this is 1983
sample frames.
A UGen for triggered convolution in the time domain.
A linear-interpolating sound generator based on the difference equation:
A linear-interpolating sound generator based on the difference equation:
x[n+1] = a - b * sqrt(abs(x[n]))
// vary frequency play { CuspL.ar(MouseX.kr(20, SampleRate.ir), 1.0, 1.99) * 0.3 }
// mouse-controlled parameters play { CuspL.ar(SampleRate.ir/4, MouseX.kr(0.9, 1.1, 1), MouseY.kr(1.8, 2,1)) * 0.3 }
// as a frequency control play { SinOsc.ar(CuspL.ar(40, MouseX.kr(0.9, 1.1, 1), MouseY.kr(1.8, 2, 1)) * 800 + 900) * 0.4 }
A non-interpolating sound generator based on the difference equation:
A non-interpolating sound generator based on the difference equation:
x[n+1] = a - b * sqrt(abs(x[n]))
// vary frequency play { CuspN.ar(MouseX.kr(20, SampleRate.ir), 1.0, 1.99) * 0.3 }
// mouse-controlled parameters play { CuspN.ar(SampleRate.ir/4, MouseX.kr(0.9, 1.1, 1), MouseY.kr(1.8, 2, 1)) * 0.3 }
// as a frequency control play { SinOsc.ar(CuspN.ar(40, MouseX.kr(0.9, 1.1, 1), MouseY.kr(1.8, 2,1)) * 800 + 900) * 0.4 }
An integrator UGen with exponential decay of past values.
An integrator UGen with exponential decay of past values. This is essentially
the same as Integrator
except that instead of supplying the coefficient
directly, it is calculated from a 60 dB decay time. This is the time required
for the integrator to lose 99.9 % of its value or -60dB.
Note: This should not be confused with Lag
which does not overshoot due to
integration, but asymptotically follows the input signal.
A integrator UGen with controllable attack and release times.
A integrator UGen with controllable attack and release times. While Decay
has
a very sharp attack and can produce clicks, Decay2
rounds off the attack by
subtracting one Decay from another. It can be seen as equivalent to
Decay.ar(in, release) - Decay.ar(in, attack)
Note: This should not be confused with LagUD
which does not overshoot due to
integration, but asymptotically follows the input signal.
Tap a delay line from a DelTapWr
UGen.
Tap a delay line from a DelTapWr
UGen.
Write to a buffer for a DelTapRd
UGen
Write to a buffer for a DelTapRd
UGen
A UGen that delays the input by 1 audio frame or control period.
A UGen that delays the input by 1 audio frame or control period.
For audio-rate signals the delay is 1 audio frame, and for control-rate signals the delay is 1 control period.
// analog to HPZ1 play { val z = PinkNoise.ar val x = z - Delay1.ar(z) // mouse button to compare dry/wet LinXFade2.ar(z, x, MouseButton.kr(-1, 1)) }
A UGen that delays the input by 2 audio frames or control periods.
A UGen that delays the input by 2 audio frames or control periods.
For audio-rate signals the delay is 2 audio frames, and for control-rate signals the delay is 2 control periods.
// high-frequency comb filter play { val z = PinkNoise.ar val x = z - Delay2.ar(z) // mouse button to compare dry/wet LinXFade2.ar(z, x, MouseButton.kr(-1, 1)) }
Simple delay line with cubic interpolation.
Simple delay line with linear interpolation.
Simple delay line with no interpolation.
Simple delay line with no interpolation.
// Delayed random pulses play { // Dust randomly triggers Decay to create an exponential // decay envelope for the WhiteNoise input source val z = Decay.ar(Dust.ar(2) * 0.5, 0.3) * WhiteNoise.ar DelayN.ar(z, 0.2, 0.2) + z // input is mixed with delay via the add input }
// Recursive application play { val z = Decay2.ar(Dust.ar(1) * 0.5, 0.01, 0.1) * Saw.ar(Seq(100, 101)) * 0.5 (z /: (0 until 5)) { (zi, i) => DelayN.ar(RLPF.ar(zi, Rand(100, 3000), 0.03), 1, 1.0 / (2 << i)) + zi * 0.5 } }
A UGen which polls results from demand-rate ugens when receiving a trigger.
A UGen which polls results from demand-rate ugens when receiving a trigger.
When there is a trigger at the trig
input, a value is demanded from each ugen
in the in
input and output. The unit generators in the list should be
demand-rate. When there is a trigger at the reset input, the demand rate ugens
in the list are reset.
Note: By design, a reset trigger only resets the demand ugens; it does not
reset the value at Demand's output. Demand continues to hold its value until the
next value is demanded, at which point its output value will be the first
expected item in the in
argument.
Note: One demand-rate ugen represents a single stream of values, so that embedding the same ugen twice calls this stream twice per demand, possibly yielding different values. To embed the same sequence twice, either make sure the ugen is demanded only once, or create two instances of the ugen.
Warning: Demand currently seems to have problems with infinite sequences.
As a workaround use a very large length instead. E.g. instead of
Dbrown(0, 1, inf)
use Dbrown(0, 1, 0xFFFFFFFF)
!
An envelope generator UGen using demand-rate inputs for the envelope segments.
An envelope generator UGen using demand-rate inputs for the envelope segments. For each parameter of the envelope (levels, durations and shapes), values are polled every time a new segment starts.
DoneAction
Env
A UGen which determines the index in a buffer at which the value matches a given input signal.
A UGen which determines the index in a buffer at which the value matches a given input signal. If the input value is not found, it outputs -1.
For example, if the buffer contains values 5, 3, 2, 8, and the input signal is
3, the output will be 1. If the input is 3.001, the output will be -1. Unlike
IndexInBetween
, this UGen always searches through the entire buffer until the
value is found or the end has been reached (returning -1).
A UGen which detects whether its input signal falls below a given amplitude for a given amount of time (becoming "silent").
A UGen which detects whether its input signal falls below a given amplitude for
a given amount of time (becoming "silent"). A silence is detected if the
absolute sample values of the input remain less than or equal to the amp
threshold for a consecutive amount of time given by the dur
argument.
A value of 1
is output when this condition is met, and a value of 0
is
output when the condition is not met (i.e. at least one sample occurs in the
input whose absolute value is greater than amp
). Besides, when the output
changes from zero to one, the doneAction
is executed (unless it is doNothing
).
A special case is the initial condition of the UGen: It will begin with an
output value of 0
(no silence detected), even if the input signal is below the
amplitude threshold. It is only after the first input sample rising above the
threshold that the actual monitoring begins and a trigger of 1
or the firing
of the done-action may occur.
A UGen to stream in a signal from an audio file.
A UGen to stream in a signal from an audio file. Continuously plays a longer audio file from disk. This requires a buffer to be preloaded with one buffer size of sound. If loop is set to 1, the file will loop.
Note: The buffer size must be a multiple of (2 * the server's block
size). See Buffer#cue
for details.
A UGen which writes a signal to a sound file on disk.
A UGen which writes a signal to a sound file on disk. To achieve this efficiently, a buffer is needs to be provides which is used to buffer the incoming signal.
Note: It might be that the buffer size must be a multiple of (2 * the server's block size). We haven't currently verified this, but to be safe, you should make sure this property is met.
The signal output by the UGen represents the number of frames written.
A UGen which monitors another UGen to see when it is finished.
A UGen which monitors another UGen to see when it is finished. Some UGens, such
as PlayBuf
, RecordBuf
, Line
, XLine
, EnvGen
, Linen
, BufRd
,
BufWr
, DbufRd
, and the Buffer delay UGens set a 'done' flag when they are
finished playing. This UGen echoes that flag as an explicit output signal when
it is set to track a particular UGen. When the tracked UGen changes to done, the
output signal changes from zero to one.
A UGen generating random impulses with values ranging from 0
to +1
.
A UGen generating random impulses with values ranging from -1
to +1
.
A UGen which polls results from demand-rate ugens in intervals specified by a duration input.
A UGen which polls results from demand-rate ugens in intervals specified by a
duration input. A value from the level
ugen is demanded and output according
to a stream of duration values. When there is a trigger at the reset input, the
level
and the dur
input are reset.
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = sin(im * y[n] + fb * x[n]) y[n+1] = (a * y[n] + c) % 2pi
This uses a linear congruential function to drive the phase indexing of a sine wave. For im = 1, fb = 0 , and a = 1 a normal sine wave results.
// default initial parameters play { FBSineC.ar(SampleRate.ir/4) * 0.2 }
// increase feedback play { FBSineC.ar(SampleRate.ir, 1, Line.kr(0.01, 4, 10), 1, 0.1) * 0.2 }
// increase phase multiplier play { FBSineC.ar(SampleRate.ir, 1, 0, XLine.kr(1, 2, 10), 0.1) * 0.2 }
// modulate frequency and index multiplier play { FBSineC.ar(LFNoise2.kr(1).madd(1e4, 1e4), LFNoise2.kr(1).madd(16, 17), 1, 1.005, 0.7) * 0.2 }
// randomly modulate parameters play { FBSineC.ar( LFNoise2.kr(1).madd(1e4, 1e4), LFNoise2.kr(1).madd(32, 33), LFNoise2.kr(1) * 0.5, LFNoise2.kr(1).madd(0.05, 1.05), LFNoise2.kr(1).madd(0.3, 0.3) ) * 0.2 }
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = sin(im * y[n] + fb * x[n]) y[n+1] = (a * y[n] + c) % 2pi
This uses a linear congruential function to drive the phase indexing of a sine wave. For im = 1, fb = 0, and a = 1 a normal sine wave results.
// default initial parameters play { FBSineL.ar(SampleRate.ir/4) * 0.2 }
// increase feedback play { FBSineL.ar(SampleRate.ir, 1, Line.kr(0.01, 4, 10), 1, 0.1) * 0.2 }
// increase phase multiplier play { FBSineL.ar(SampleRate.ir, 1, 0, XLine.kr(1, 2, 10), 0.1) * 0.2 }
// modulate frequency and index multiplier play { FBSineL.ar(LFNoise2.kr(1).madd(1e4, 1e4), LFNoise2.kr(1).madd(16, 17), 1, 1.005, 0.7) * 0.2 }
// randomly modulate parameters play { FBSineL.ar( LFNoise2.kr(1).madd(1e4, 1e4), LFNoise2.kr(1).madd(32, 33), LFNoise2.kr(1) * 0.5, LFNoise2.kr(1).madd(0.05, 1.05), LFNoise2.kr(1).madd(0.3, 0.3) ) * 0.2 }
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = sin(im * y[n] + fb * x[n]) y[n+1] = (a * y[n] + c) % 2pi
This uses a linear congruential function to drive the phase indexing of a sine wave. For im = 1, fb = 0, and a = 1 a normal sine wave results.
// default initial parameters play { FBSineN.ar(SampleRate.ir/4) * 0.2 }
// increase feedback play { FBSineN.ar(SampleRate.ir, 1, Line.kr(0.01, 4, 10), 1, 0.1) * 0.2 }
// increase phase multiplier play { FBSineN.ar(SampleRate.ir, 1, 0, XLine.kr(1, 2, 10), 0.1) * 0.2 }
// modulate frequency and index multiplier play { FBSineN.ar(LFNoise2.kr(1).madd(1e4, 1e4), LFNoise2.kr(1).madd(16, 17), 1, 1.005, 0.7) * 0.2 }
// randomly modulate parameters play { FBSineN.ar( LFNoise2.kr(1).madd(1e4, 1e4), LFNoise2.kr(1).madd(32, 33), LFNoise2.kr(1) * 0.5, LFNoise2.kr(1).madd(0.05, 1.05), LFNoise2.kr(1).madd(0.3, 0.3) ) * 0.2 }
A first order filter section UGen.
A first order filter section UGen. Filter coefficients are given directly rather than calculated for you. The formula is equivalent to:
out(i) = a0 * in(i) + a1 * in(i-1) + b1 * out(i-1)
// same as OnePole play { val x = LFTri.ar(0.4) * 0.99 FOS.ar(LFSaw.ar(200) * 0.1, 1 - x.abs, 0.0, x) }
// same as OneZero play { val x = LFTri.ar(0.4) * 0.99 FOS.ar(LFSaw.ar(200) * 0.1, 1 - x.abs, x, 0.0) }
A UGen which reads a single sample value from a buffer at a given index.
A UGen which reads a single sample value from a buffer at a given index.
It uses the in
argument as index into the buffer, truncating that argument to
an integer. Out-of-range index values are "folded" inside the valid range.
Folding means reflecting the excess at the valid range's boundaries.
For example, if the buffer has four samples, index 4 is wrapped to index 2 (the excess beyond the maximum index of 3 is 4 - 3 = 1, and the excess is folded so that and 3 - 1 = 2), index 5 is folded to index 1, index -1 is folded to index 1, index -2 is folded to index 2, etc.
While designed for monophonic buffers, it works with multi-channel buffers by
treating them as de-interleaved. See the Index
UGen for details.
A FOF-like resonant filter UGen.
A FOF-like resonant filter UGen. Its impulse response is like that of a sine
wave with a Decay2
envelope over it. It is possible to control the attack and
decay times.
Formlet
is equivalent to:
Ringz(in, freq, decay) - Ringz(in, freq, attack)
The great advantage to this filter over FOF (Fonction d'onde formantique) is that there is no limit to the number of overlapping grains since the grain is just the impulse response of the filter.
// modulated formant frequency play { val in = Blip.ar(SinOsc.kr(5,0).madd(20, 300), 1000) * 0.1 Formlet.ar(in, XLine.kr(1500, 700, 8), 0.005, 0.04) }
// mouse control of frequency and decay time play { val in = Blip.ar(SinOsc.kr(5,0).madd(20, 300), 1000) * 0.1 val freq = MouseY.kr(700, 2000, 1) val decay = MouseX.kr(0.01, 0.2, 1) Formlet.ar(in, freq, attack = 0.005, decay = decay) }
A UGen that, when triggered, frees a given node.
A UGen that, when triggered, frees enclosing synth.
A UGen that, when its input UGen is finished, frees enclosing synth.
A UGen that, when its input UGen is finished, frees enclosing synth. This is
essentially a shortcut for FreeSelf.kr(Done.kr(src))
, so instead of providing
a trigger signal it reads directly the done flag of an appropriate ugen (such as
Line
or PlayBuf
).
This UGen outputs its input signal for convenience.
A frequency shifting UGen.
A frequency shifting UGen. It implements single sideband (SSB) amplitude modulation, also known as frequency shifting, but not to be confused with pitch shifting. Frequency shifting moves all the components of a signal by a fixed amount but does not preserve the original harmonic relationships.
// shift a sine frequency from 200 to 700 Hz play { val freq = Line.ar(0, 500, 5) FreqShift.ar(SinOsc.ar(200) * 0.25, freq) }
// negative frequency to shift downwards play { val freq = Line.ar(0, -500, 5) FreqShift.ar(SinOsc.ar(700) * 0.25, freq) }
PV_MagShift
A gate or hold UGen.
A gate or hold UGen. It allows the input signal value to pass when the gate
argument is positive, otherwise it holds last value.
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = 1 - y[n] + abs(x[n]) y[n+1] = x[n]
The behavior of the system is only dependent on its initial conditions. Reference: Devaney, R. L. "The Gingerbreadman." Algorithm 3, 15-16, Jan. 1992.
// default initial parameters play { GbmanN.ar(MouseX.kr(20, SampleRate.ir)) * 0.1 }
// change initial parameters play { GbmanN.ar(MouseX.kr(20, SampleRate.ir), -0.7, -2.7) * 0.1 }
// wait for it... play { GbmanN.ar(MouseX.kr(20, SampleRate.ir), 1.2, 2.0002) * 0.1 }
// as a frequency control play { SinOsc.ar(GbmanN.ar(40) * 400 + 500) * 0.4 }
The argument order is different from its sclang counterpart.
The argument order is different from its sclang counterpart.
A second order high pass filter UGen.
A second order high pass filter UGen.
// modulated frequency play { val in = Saw.ar(200) * 0.5 val freq = SinOsc.ar(XLine.ar(0.3, 100, 20)).madd(3600, 4000) HPF.ar(in, freq) }
// mouse controlled frequency play { val in = WhiteNoise.ar(0.5) val freq = MouseX.kr(200, 10000, 1) HPF.ar(in, freq) }
A two point difference filter UGen.
A two point difference filter UGen. Implements the formula :
out(i) = 0.5 * (in(i) - in(i-1))
// engage with mouse button play { val sig = PinkNoise.ar val flt = HPZ1.ar(sig) LinXFade2.ar(sig, flt, MouseButton.kr(-1, 1)) }
// detect changes play { val z = LFNoise0.ar(2) val f = HPZ1.ar(z) val ch = f sig_!= 0 // input increased or decreased z.poll(ch, "now") 0 }
three point difference filter UGen.
A cubic-interpolating sound generator based on the difference equation:
A cubic-interpolating sound generator based on the difference equation:
x[n+2] = 1 - a * pow(x[n+1], 2) + b * x[n]
This equation was discovered by French astronomer Michel Hénon while studying the orbits of stars in globular clusters.
// default initial parameters play { HenonC.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// mouse-control of parameters play { HenonC.ar(SampleRate.ir/4, MouseX.kr(1,1.4), MouseY.kr(0,0.3)) * 0.2 }
// randomly modulate parameters play { HenonC.ar( SampleRate.ir/8, LFNoise2.kr(1).madd(0.2, 1.2), LFNoise2.kr(1).madd(0.15, 0.15) ) * 0.2 }
// as a frequency control play { SinOsc.ar(HenonC.ar(40, MouseX.kr(1, 1.4), MouseY.kr(0, 0.3)) * 800 + 900) * 0.4 }
A linear-interpolating sound generator based on the difference equation:
A linear-interpolating sound generator based on the difference equation:
x[n+2] = 1 - a * pow(x[n+1], 2) + b * x[n]
This equation was discovered by French astronomer Michel Hénon while studying the orbits of stars in globular clusters.
// default initial parameters play { HenonL.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// mouse-control of parameters play { HenonL.ar(SampleRate.ir/4, MouseX.kr(1,1.4), MouseY.kr(0,0.3)) * 0.2 }
// randomly modulate parameters play { HenonL.ar( SampleRate.ir/8, LFNoise2.kr(1).madd(0.2, 1.2), LFNoise2.kr(1).madd(0.15, 0.15) ) * 0.2 }
// as a frequency control play { SinOsc.ar(HenonL.ar(40, MouseX.kr(1, 1.4), MouseY.kr(0, 0.3)) * 800 + 900) * 0.4 }
A non-interpolating sound generator based on the difference equation:
A non-interpolating sound generator based on the difference equation:
x[n+2] = 1 - a * pow(x[n+1], 2) + b * x[n]
This equation was discovered by French astronomer Michel Hénon while studying the orbits of stars in globular clusters.
// default initial parameters play { HenonN.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// mouse-control of parameters play { HenonN.ar(SampleRate.ir/4, MouseX.kr(1,1.4), MouseY.kr(0,0.3)) * 0.2 }
// randomly modulate parameters play { HenonN.ar( SampleRate.ir/8, LFNoise2.kr(1).madd(0.2, 1.2), LFNoise2.kr(1).madd(0.15, 0.15) ) * 0.2 }
// as a frequency control play { SinOsc.ar(HenonN.ar(40, MouseX.kr(1, 1.4), MouseY.kr(0, 0.3)) * 800 + 900) * 0.4 }
A Hilbert transform UGen.
A Hilbert transform UGen. This transformation produces two signals from a given input with identical frequency content, but with their respective phases shifted to be 90 degrees apart (0.5 pi radians).
The two signals output by Hilbert
correspond to the real and imaginary part
of the complex transformed signal. Due to the method used (an IIR filter),
distortion occurs in the upper octave of the frequency spectrum.
The transform can be used to implemented single-side-band (SSB) modulation, but
a dedicated UGen FreqShift
is already provided for this case.
// a form of envelope tracking play { val in = SinOsc.ar(440) val h = Hilbert.ar(in) val x = h.real.squared + h.imag.squared x.poll(1) // cos(x)^2 + sin(x)^2 == 1 (ideally) 0 }
A UGen which reads a signal from an audio bus with a current or one cycle old timestamp.
A UGen which reads a signal from an audio bus with a current or one cycle old timestamp.
Audio buses adhere to the concept of a cycle timestamp, which increases for
each audio block calculated. When the various output ugens ( Out
, OffsetOut
, XOut
) write data to a bus, they mix it with any data from the current
cycle, but overwrite any data from the previous cycle. ( ReplaceOut
overwrites
all data regardless.) Thus depending on node order and what synths are writing
to the bus, the data on a given bus may be from the current cycle or be one
cycle old at the time of reading.
In.ar
checks the timestamp of any data it reads in and zeros any data from
the previous cycle (for use within that node; the data remains on the bus). This
is fine for audio data, as it avoids feedback, but for control data it is useful
to be able to read data from any place in the node order. For this reason
In.kr
also reads data that is older than the current cycle.
In some cases one might also want to read audio from a node later in the
current node order. This can be achieved with InFeedback
. It reads from the
previous cycle, and hence introduces a delay of one block size, which by
default is 64 sample frames (equal to about 1.45 ms at 44.1 kHz sample rate).
Note that no delay occurs when the bus contains a signal which has been written already in the current cycle. The delay is only introduced when no present signal exists.
A UGen which generates a trigger anytime a control bus is set.
A UGen which generates a trigger anytime a control bus is set.
Any time the bus is "touched" i.e. has its value set (using "/c_set"
etc.), a
single impulse trigger will be generated. Its amplitude is the value that the
bus was set to. Note that if a signal is continuously written to that bus, for
instance using Out.kr
, only one initial trigger is generated once that ugen
starts writing, but no successive triggers are generated.
A UGen which reads a single sample value from a buffer at a given index.
A UGen which reads a single sample value from a buffer at a given index.
It uses the in
argument as index into the buffer, truncating that argument to
an integer. Out-of-range index values are clipped to the valid range.
While designed for monophonic buffers, it works with multi-channel buffers by treating them as de-interleaved. For example, if the buffer has two frames and two channels, index 0 corresponds to frame 0, channel 0, index 1 correspond to frame 0, channel 1, index 2 corresponds to frame 1, channel 0, and index 3 corresponds to frame 1, channel 1.
A UGen which determines the (lowest) index in a buffer at which the two neighboring values contain a given input signal.
A UGen which determines the (lowest) index in a buffer at which the two neighboring values contain a given input signal. The output index is a decimal whose fractional part is suitable for linearly interpolating between the buffer slot values.
For example, if the Buffer contains values 3, 21, 25, 26 and the input signal has the value 22, then the output will be 1.25, because the value 22 is in-between the values stored at indices 1 and 2 and the linear location of 22 is one-quarter of the way along the interval between them: 21 * (1 - 0.25) + 25 * (1 - 0.75) = 22.
If the input value is smaller than the first sample, the output will be zero. If the input value is larger than any sample in the buffer, the output will be the buffer size minus one.
While designed for monophonic buffers, it works with multi-channel buffers by treating them as de-interleaved. For example, if the buffer has two frames and two channels, and the algorithm finds the frame 1 in channel 0, the reported index is 2 (frame * numChannels + channel).
IndexInBetween
is the complement of the IndexL
UGen.
A UGen which reads from a buffer at a given index, linearly interpolating between neighboring points.
A UGen which reads from a buffer at a given index, linearly interpolating between neighboring points.
It uses the in
argument as index into the buffer. Out-of-range index values
are clipped to the valid range. If the index has a fractional part, it is used
to interpolate between the buffer index at the floor and the buffer index at the
ceiling of the index argument.
While designed for monophonic buffers, it works with multi-channel buffers by
treating them as de-interleaved. See the Index
UGen for details.
A filter UGen to integrate an input signal with a leak.
A (12TET major/minor) key tracker UGen.
A (12TET major/minor) key tracker UGen. It is based on a pitch class profile of energy across FFT bins and matching this to templates for major and minor scales in all transpositions. It assumes a 440 Hz concert A reference. Output is 0-11 C major to B major, 12-23 C minor to B minor.
A UGen that randomly generates the values -1 or +1 at a rate given by the nearest integer division of the sample rate by the frequency argument.
A UGen that randomly generates the values -1 or +1 at a rate given by the nearest integer division of the sample rate by the frequency argument.
// generator play { LFClipNoise.ar(500) * 0.2 }
// random panning play { val pos = LFClipNoise.ar(4) Pan2.ar(PinkNoise.ar, pos) }
// modulate frequency play { LFClipNoise.ar(XLine.kr(100, 10000, 20)) * 0.2 }
A dynamic step noise UGen.
A dynamic step noise UGen. Like LFNoise0
, it generates abruptly changing
random values between -1
and +1
at a rate given by the freq
argument, with
two differences: There is no time quantization, and it there is fast recovery
from low freq values.
In contrast, LFNoise0
, LFNoise1
, and LFNoise2
quantize to the nearest
integer division of the sample rate, and they poll the freq argument only when
scheduled, and thus seem to hang when the frequencies get very low.
If very high or very low frequencies are not needed, or fixed frequencies are
used, LFNoise0
is more efficient.
A dynamic ramp noise UGen.
A dynamic ramp noise UGen. Like LFNoise1
, it generates linearly interpolated
random values between -1
and +1
at a rate given by the freq
argument, with
two differences: There is no time quantization, and it there is fast recovery
from low freq values.
In contrast, LFNoise0
, LFNoise1
, and LFNoise2
quantize to the nearest
integer division of the sample rate, and they poll the freq argument only when
scheduled, and thus seem to hang when the frequencies get very low.
If very high or very low frequencies are not needed, or fixed frequencies are
used, LFNoise1
is more efficient.
A dynamic ramp noise UGen.
A dynamic ramp noise UGen. It is similar to LFNoise2
, with three
differences: It uses cubic instead of quadratic interpolation for the random
values between -1
and +1
at a rate given by the freq
argument. There is no
time quantization, and it there is fast recovery from low freq values.
In contrast, LFNoise0
, LFNoise1
, and LFNoise2
quantize to the nearest
integer division of the sample rate, and they poll the freq argument only when
scheduled, and thus seem to hang when the frequencies get very low.
// compare dynamic and non-dynamic play { val r = MouseX.kr(0.1, 1000, 1) val a = LFNoise2 .ar(r) val b = LFDNoise3.ar(r) val freq = Select.ar(MouseButton.kr(lag = 0), Seq(a, b)) SinOsc.ar(freq.madd(200, 500)) * 0.2 }
A step noise UGen.
A step noise UGen. It generates abruptly changing random values between -1
and +1
at a rate given by the freq
argument.
The frequency is quantized to the nearest integer division of the sample rate,
and changes in frequency are only picked up at the next trigger. In contrast,
variant LFDNoise0
has precise frequency and reacts to frequency changes
instantly.
A ramp noise UGen.
A ramp noise UGen. It generates line segments whose start and end points are
chosen randomly between -1
and +1
. New breakpoints are generated at a
specified frequency.
The frequency is quantized to the nearest integer division of the sample rate,
and changes in frequency are only picked up at the next trigger. In contrast,
variant LFDNoise1
has precise frequency and reacts to frequency changes
instantly.
A non-band-limited pulse oscillator UGen.
A non-band-limited pulse oscillator UGen. Outputs a high value of one and a low value of zero.
A sawtooth oscillator UGen.
A sawtooth oscillator UGen. The oscillator is creating an aliased sawtooth,
that is it does not use band-limiting. For a band-limited version use Saw
instead. The signal range is -1 to +1.
A triangle oscillator designed for low frequency control signals (being non-band-limited).
A triangle oscillator designed for low frequency control signals (being non-band-limited). The output varies from -1 to 1.
With an initial phase of zero, the oscillator begins at 0, rises to 1, then falls to -1 and goes back to zero after one complete phase. With an initial phase of 1 (corresponding to 90 degrees), the oscillator begins at 1 and then falls to -1. With an initial phase of 3 (or 270 degrees), the oscillator begins at -1 and then rises to 1.
A second order low pass filter UGen.
A second order low pass filter UGen.
// modulated frequency play { val in = Saw.ar(200) * 0.5 val freq = SinOsc.ar(XLine.ar(0.3, 100, 20)).madd(3600, 4000) LPF.ar(in, freq) }
// mouse controlled frequency play { val in = WhiteNoise.ar(0.5) val freq = MouseX.kr(200, 10000, 1) LPF.ar(in, freq) }
two point average filter UGen.
two point average filter UGen. Implements the formula :
out(i) = 0.5 * (in(i) + in(i-1))
// engage with mouse button play { val sig = WhiteNoise.ar(0.5) val flt = LPZ1.ar(sig) LinXFade2.ar(sig, flt, MouseButton.kr(-1, 1)) }
three point average filter UGen.
An exponential lag UGen.
An exponential lag UGen. This is essentially the same as OnePole
except that
instead of supplying the coefficient directly, it is calculated from a 60 dB lag
time. This is the time required for the filter to converge to within 0.01 % of a
value. This is useful for smoothing out control signals.
A cascaded exponential lag UGen.
A cascaded exponential lag UGen with separate inputs for up and down slope.
A cascaded exponential lag UGen with separate inputs for up and down slope.
Lag2UD.kr(in, up, down)
is equivalent to
LagUD.kr(LagUD.kr(in, up, down), up, down)
, thus resulting in a smoother
transition. This saves on CPU as you only have to calculate the decay factors
once instead of twice.
A cascaded exponential lag UGen.
A cascaded exponential lag UGen with separate inputs for up and down slope.
A cascaded exponential lag UGen with separate inputs for up and down slope.
Lag3UD.kr(in, up, down)
is equivalent to
LagUD.kr(LagUD.kr(LagUD.kr(in, up, down), up, down), up, down)
, thus
resulting in a smoother transition. This saves on CPU as you only have to
calculate the decay factors once instead of three times.
An exponential lag UGen with separate inputs for up and down slope.
A sample-and-hold UGen.
A cubic-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26.
A cubic-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26. The function is:
x[n+1] = sin(b * y[n]) + c * sin(b * x[n]) y[n+1] = sin(a * y[n]) + d * sin(a * x[n])
According to Pickover, parameters a and b should be in the range from -3 to +3, and parameters c and d should be in the range from 0.5 to 1.5. The function can, depending on the parameters given, give continuous chaotic output, converge to a single value (silence) or oscillate in a cycle (tone). NOTE: This UGen is experimental and not optimized currently, so is rather hoggish of CPU.
// default initial parameters play { LatoocarfianC.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// randomly modulate all parameters play { LatoocarfianC.ar( SampleRate.ir/4, LFNoise2.kr(2).madd(1.5, 1.5), LFNoise2.kr(2).madd(1.5, 1.5), LFNoise2.kr(2).madd(0.5, 1.5), LFNoise2.kr(2).madd(0.5, 1.5) ) * 0.2 }
A linear-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26.
A linear-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26. The function is:
x[n+1] = sin(b * y[n]) + c * sin(b * x[n]) y[n+1] = sin(a * y[n]) + d * sin(a * x[n])
According to Pickover, parameters a and b should be in the range from -3 to +3, and parameters c and d should be in the range from 0.5 to 1.5. The function can, depending on the parameters given, give continuous chaotic output, converge to a single value (silence) or oscillate in a cycle (tone). NOTE: This UGen is experimental and not optimized currently, so is rather hoggish of CPU.
// default initial parameters play { LatoocarfianL.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// randomly modulate all parameters play { LatoocarfianL.ar( SampleRate.ir/4, LFNoise2.kr(2).madd(1.5, 1.5), LFNoise2.kr(2).madd(1.5, 1.5), LFNoise2.kr(2).madd(0.5, 1.5), LFNoise2.kr(2).madd(0.5, 1.5) ) * 0.2 }
A non-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26.
A non-interpolating sound generator based on a function given in Clifford Pickover's book Chaos In Wonderland, pg 26. The function is:
x[n+1] = sin(b * y[n]) + c * sin(b * x[n]) y[n+1] = sin(a * y[n]) + d * sin(a * x[n])
According to Pickover, parameters a and b should be in the range from -3 to +3, and parameters c and d should be in the range from 0.5 to 1.5. The function can, depending on the parameters given, give continuous chaotic output, converge to a single value (silence) or oscillate in a cycle (tone). NOTE: This UGen is experimental and not optimized currently, so is rather hoggish of CPU.
// default initial parameters play { LatoocarfianN.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// randomly modulate all parameters play { LatoocarfianN.ar( SampleRate.ir/4, LFNoise2.kr(2).madd(1.5, 1.5), LFNoise2.kr(2).madd(1.5, 1.5), LFNoise2.kr(2).madd(0.5, 1.5), LFNoise2.kr(2).madd(0.5, 1.5) ) * 0.2 }
A filter UGen to remove very low frequency content DC offset.
A filter UGen to remove very low frequency content DC offset.
// show DC with mouse-controlled coefficient play { val freq = 800 val in = LFPulse.ar(freq).madd(0.5, 0.5) val coef = MouseX.kr(0.9, 0.999) val flt = LeakDC.ar(in, coef) val dc = RunningSum.ar(flt, SampleRate.ir/freq) coef.poll(2) dc .poll(2) 0 }
Limits the input amplitude to the given level.
Limits the input amplitude to the given level. Unlike Compander
, this UGen
will never overshoot, but it needs to look ahead in the input signal,
introducing a delay in its output. The delay time is equal to twice the value of
the dur
parameter (the buffer internally used).
// compare dry and wet play { val in = Decay2.ar( Impulse.ar(8, phase = LFSaw.kr(0.25) * 0.7), attack = 0.001, release = 0.3) * FSinOsc.ar(500) val flt = Limiter.ar(in, level = 0.4) LinXFade2.ar(in, flt, MouseButton.kr(-1, 1)) }
A cubic-interpolating sound generator based on the difference equation:
A cubic-interpolating sound generator based on the difference equation:
x[n+1] = (a * x[n] + c) % m
The output signal is automatically scaled to a range of [-1, 1].
// default initial parameters play { LinCongC.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// randomly modulate parameters play { LinCongC.ar( LFNoise2.kr(1.0).madd(1e4, 1e4), LFNoise2.kr(0.1).madd(0.5, 1.4), LFNoise2.kr(0.1).madd(0.1, 0.1), LFNoise2.kr(0.1) ) * 0.2 }
// as frequency control play { SinOsc.ar( LinCongC.ar( 40, LFNoise2.kr(0.1).madd(0.1, 1), LFNoise2.kr(0.1).madd(0.1, 0.1), LFNoise2.kr(0.1) ).madd(500, 600) ) * 0.4 }
A linear-interpolating sound generator based on the difference equation:
A linear-interpolating sound generator based on the difference equation:
x[n+1] = (a * x[n] + c) % m
The output signal is automatically scaled to a range of [-1, 1].
// default initial parameters play { LinCongL.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// randomly modulate parameters play { LinCongL.ar( LFNoise2.kr(1.0).madd(1e4, 1e4), LFNoise2.kr(0.1).madd(0.5, 1.4), LFNoise2.kr(0.1).madd(0.1, 0.1), LFNoise2.kr(0.1) ) * 0.2 }
// as frequency control play { SinOsc.ar( LinCongL.ar( 40, LFNoise2.kr(0.1).madd(0.1, 1), LFNoise2.kr(0.1).madd(0.1, 0.1), LFNoise2.kr(0.1) ).madd(500, 600) ) * 0.4 }
A non-interpolating sound generator based on the difference equation:
A non-interpolating sound generator based on the difference equation:
x[n+1] = (a * x[n] + c) % m
The output signal is automatically scaled to a range of [-1, 1].
// default initial parameters play { LinCongN.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }
// randomly modulate parameters play { LinCongN.ar( LFNoise2.kr(1.0).madd(1e4, 1e4), LFNoise2.kr(0.1).madd(0.5, 1.4), LFNoise2.kr(0.1).madd(0.1, 0.1), LFNoise2.kr(0.1) ) * 0.2 }
// as frequency control play { SinOsc.ar( LinCongN.ar( 40, LFNoise2.kr(0.1).madd(0.1, 1), LFNoise2.kr(0.1).madd(0.1, 0.1), LFNoise2.kr(0.1) ).madd(500, 600) ) * 0.4 }
A UGen which maps a linear range to an exponential range.
An linear two channel cross fading UGen.
An linear two channel cross fading UGen.
A line generator UGen that moves from a start value to the end value in a given duration.
A strange attractor discovered by Edward N.
A strange attractor discovered by Edward N. Lorenz while studying mathematical models of the atmosphere. The system is composed of three ordinary differential equations:
x' = s * (y - x) y' = x * (r - z) - y z' = x * y - b * z
The time step amount h determines the rate at which the ODE is evaluated. Higher values will increase the rate, but cause more instability. A safe choice is the default amount of 0.05.
// vary frequency play { LorenzL.ar(MouseX.kr(20, SampleRate.ir)) * 0.3 }
// randomly modulate parameters play { LorenzL.ar( SampleRate.ir, LFNoise0.kr(1).madd(2, 10), LFNoise0.kr(1).madd(20, 38), LFNoise0.kr(1).madd(1.5, 2) ) * 0.2 }
// as a frequency control play { SinOsc.ar(Lag.ar(LorenzL.ar(MouseX.kr(1, 200)), 3e-3) * 800 + 900) * 0.4 }
A UGen for the extraction of instantaneous loudness.
A UGen for the extraction of instantaneous loudness. A perceptual loudness function which outputs loudness in sones; this is a variant of an MP3 perceptual model, summing excitation in ERB bands. It models simple spectral and temporal masking, with equal loudness contour correction in ERB bands to obtain phons (relative dB), then a phon to sone transform. The final output is typically in the range of 0 to 64 sones, though higher values can occur with specific synthesised stimuli.
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
A UGen for extracting mel frequency cepstral coefficients.
A UGen for extracting mel frequency cepstral coefficients. It generates a set of MFCCs; these are obtained from a band-based frequency representation (using the Mel scale by default), and then a discrete cosine transform (DCT). The DCT is an efficient approximation for principal components analysis, so that it allows a compression, or reduction of dimensionality, of the data, in this case reducing 42 band readings to a smaller set of MFCCs. A small number of features (the coefficients) end up describing the spectrum. The MFCCs are commonly used as timbral descriptors.
The output values are somewhat normalised for the range 0.0 to 1.0, but there are no guarantees on exact conformance to this. Commonly, the first coefficient will be the highest value. The number of output channels corresponds to the number of coefficients specified. Technical note: The 0th coefficient is not generated as it consists of multiplying all bands by 1 and summing
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
A filter UGen that calculates the median of a running window over its input signal.
A filter UGen that calculates the median of a running window over its input signal. This non-linear filter can be used to reduce impulse noise from a signal.
The argument order is different from its sclang counterpart.
// engage with mouse button play { val in = Saw.ar(500) * 0.1 + Dust2.ar(100) * 0.9 // signal plus noise val flt = Median.ar(in, 3) LinXFade2.ar(in, flt, MouseButton.kr(-1, 1)) }
// long filter distorts by chopping off peaks in input play { Median.ar(SinOsc.ar(1000) * 0.2, 31) }
A single band parametric equalizer UGen.
A single band parametric equalizer UGen. It attenuates or boosts a frequency band.
// mouse controlled frequency and boost play { val in = WhiteNoise.ar(0.25) val freq = MouseX.kr(200, 10000, 1) val gain = MouseY.kr(-12, 12) // bottom to top MidEQ.ar(in, freq, rq = 0.5, gain = gain) }
A Moog VCF style UGen.
A Moog VCF style UGen. This is a type of resonant low pass filter.
The design of this filter is described in Federico Fontana, "Preserving the Digital Structure of the Moog VCF." In: Proceedings of the ICMC, Copenhagen 2007. Ported to SuperCollider by Dan Stowell.
// mouse controlled play { val in = WhiteNoise.ar(01.1) val freq = MouseY.kr(100, 10000, 1) val gain = MouseX.kr(0, 4) Limiter.ar(MoogFF.ar(in, freq, gain)) }
A UGen that normalizes the input amplitude to the given level.
A UGen that normalizes the input amplitude to the given level. Unlike
Compander
, this UGen will not overshoot, but it needs to look ahead in the
input signal, introducing a delay in its output. The delay time is equal to
twice the value of the dur
parameter (the buffer internally used).
// compare dry and wet play { val z = Decay2.ar( Impulse.ar(8, phase = LFSaw.kr(0.25) * 0.7), attack = 0.001, release = 0.3) * FSinOsc.ar(500) val in = z * SinOsc.ar(0.05) * 0.5 val flt = Normalizer.ar(in, dur = 0.15, level = 0.4) LinXFade2.ar(in, flt, MouseButton.kr(-1, 1)) }
Number of audio buses.
Number of audio buses.
// print the UGen value play { NumAudioBuses.ir.poll(0) }
Maximum number of audio buffers.
Maximum number of audio buffers.
// print the UGen value play { NumBuffers.ir.poll(0) }
Number of control buses.
Number of control buses.
// print the UGen value play { NumControlBuses.ir.poll(0) }
Number of input buses.
Number of input buses.
// print the UGen value play { NumInputBuses.ir.poll(0) }
Number of output buses.
Number of output buses.
// print the UGen value play { NumOutputBuses.ir.poll(0) }
Number of currently running synths.
Number of currently running synths.
// print the UGen value play { NumRunningSynths.ir.poll(0) }
A one pole (IIR) filter UGen.
A one zero (FIR) filter UGen.
An onset detecting UGen for musical audio signals.
An onset detecting UGen for musical audio signals. It detects the beginning of notes/drumbeats/etc. Outputs a control-rate trigger signal which is 1 when an onset is detected, and 0 otherwise.
The onset detection should work well for a general range of monophonic and polyphonic audio signals. The onset detection is purely based on signal analysis and does not make use of any "top-down" inferences such as tempo.
There are different functions available for the analysis:
- 0 "power" -- generally OK, good for percussive input, and also very efficient - 1 "magsum" -- generally OK, good for percussive input, and also very efficient - 2 "complex" -- performs generally very well, but more CPU-intensive - 3 "rcomplex" (default) -- performs generally very well, and slightly more efficient than "complex" - 4 "phase" -- generally good, especially for tonal input, medium efficiency - 5 "wphase" -- generally very good, especially for tonal input, medium efficiency - 6 "mkl" -- generally very good, medium efficiency, pretty different from the other methods
The differences aren't large, so it is recommended you stick with the default "rcomplex" unless you find specific problems with it. Then maybe try "wphase". The "mkl" type is a bit different from the others so maybe try that too. They all have slightly different characteristics, and in tests perform at a similar quality level.
An azimuth-based panorama UGen.
An azimuth-based panorama UGen. It uses vector-based-amplitude panning where
the arbitrary number of speakers is supposed to be distributed in a circle with
even spacing between them. It uses an equal-power-curve to transition between
adjacent speakers. Note the different default value for the orient
argument!
Use case: To spread an multi-channel input signal across an output bus with a
different number of channels, such that the first input channel is played on the
first output channel (no spread to adjacent channels) and the last input channel
is played to the last output channel (no spread to adjacent channels), you would
create a dedicated PanAz
per input channel where the pan position is
inChanIdx * 2f / (inChannels - 1) * (outChannels - 1) / outChannels
.
A UGen which pauses and resumes another node.
A UGen which pauses and resumes another node. Note that the UGen initially
assumes the node is running, that is, if gate
is initially 1, this will
not resume a paused node. Instead, the gate must go to zero and back to
one to resume the node. Additionally, this UGen will only cause action if the
gate value changes, that is, if the node is paused or resumed otherwise, this
UGen will not interfere with that action, unless the gate value is adjusted.
A UGen that, when triggered, pauses enclosing synth.
A UGen that, when its input UGen is finished, pauses enclosing synth.
A UGen that, when its input UGen is finished, pauses enclosing synth. This is
essentially a shortcut for PauseSelf.kr(Done.kr(src))
, so instead of
providing a trigger signal it reads directly the done flag of an appropriate
ugen (such as Line
or PlayBuf
).
This UGen outputs its input signal for convenience.
An autocorrelation based pitch following UGen.
An autocorrelation based pitch following UGen. It is more accurate than
ZeroCrossing
, but more also more CPU costly. For most purposes the default
settings can be used and only in
needs to be supplied.
The UGen has two outputs: The first output is the frequency estimate in Hertz,
the second output is a toggle hasFreq
, which tells whether a pitch was found
(1) or not (0). If the clarify
argument is used, hasFreq
has more fine
grained information.
The pitch follower executes periodically at the rate specified by execFreq
in
cps. First it detects whether the input peak to peak amplitude is above the
ampThresh
. If it is not then no pitch estimation is performed, the hasFreq
output is set to zero and the freq
output is held at its previous value.
Otherwise, the autocorrelation is calculated, and the first peak after the peak
around the lag of zero that is above peakThresh
times the amplitude of the
peak at lag zero is reported.
// pitch-follower resynthesizing with saw tooth play { // be careful and use headphones! val in = Mix(PhysicalIn.ar(0, 2)) val amp = Amplitude.kr(in, 0.05, 0.05) val p = Pitch.kr(in, ampThresh = 0.02, median = 7) val saw = Mix(VarSaw.ar(p.freq * Seq(0.5, 1, 2), 0, LFNoise1.kr(0.3,0.1,0.1)) * amp) Mix.fold(saw, 6) { res => AllpassN.ar(res, 0.040, Rand(0, 0.040), Rand(0, 0.040), 2) } }
A time domain granular pitch shifter.
A time domain granular pitch shifter. Grains have a triangular amplitude envelope and an overlap of 4:1.
A UGen to play back samples from a buffer in memory.
A UGen to play back samples from a buffer in memory.
PlayBuf
provides a kind of high-level interface to sample-playback, whereas
BufRd
represents a kind of lower-level access. While BufRd
has a
random-access-pointer in the form of a phase input, PlayBuf
advances the phase
automatically based on a given playback speed. PlayBuf
uses cubic
interpolation.
A Karplus-Strong UGen.
A UGen for printing the current output value of its input to the console.
A UGen for printing the current output value of its input to the console.
A cubic-interpolating sound generator based on the difference equation:
A cubic-interpolating sound generator based on the difference equation:
x[n+1] = a * pow(x[n], 2) + b * x[n] + c
// default parameters play { QuadC.ar(SampleRate.ir/4) * 0.2 }
// logistic map play { // equation: x1 = -r*x0^2 + r*x0 val r = MouseX.kr(3.5441, 4) // stable range QuadC.ar(SampleRate.ir/4, -r, r, 0, 0.1) * 0.4 }
// logistic map as frequency control play { val r = MouseX.kr(3.5441, 4) // stable range SinOsc.ar(QuadC.ar(40, -r, r, 0, 0.1).madd(800, 900)) * 0.4 }
A linear-interpolating sound generator based on the difference equation:
A linear-interpolating sound generator based on the difference equation:
x[n+1] = a * pow(x[n], 2) + b * x[n] + c
// default parameters play { QuadL.ar(SampleRate.ir/4) * 0.2 }
// logistic map play { // equation: x1 = -r*x0^2 + r*x0 val r = MouseX.kr(3.5441, 4) // stable range QuadL.ar(SampleRate.ir/4, -r, r, 0, 0.1) * 0.4 }
// logistic map as frequency control play { val r = MouseX.kr(3.5441, 4) // stable range SinOsc.ar(QuadL.ar(40, -r, r, 0, 0.1).madd(800, 900)) * 0.4 }
A non-interpolating sound generator based on the difference equation:
A non-interpolating sound generator based on the difference equation:
x[n+1] = a * pow(x[n], 2) + b * x[n] + c
// default parameters play { QuadN.ar(SampleRate.ir/4) * 0.2 }
// logistic map play { // equation: x1 = -r*x0^2 + r*x0 val r = MouseX.kr(3.5441, 4) // stable range QuadN.ar(SampleRate.ir/4, -r, r, 0, 0.1) * 0.4 }
// logistic map as frequency control play { val r = MouseX.kr(3.5441, 4) // stable range SinOsc.ar(QuadN.ar(40, -r, r, 0, 0.1).madd(800, 900)) * 0.4 }
A resonant high pass filter UGen.
A resonant high pass filter UGen.
// mouse controlled frequency and Q play { val in = WhiteNoise.ar(0.5) val freq = MouseX.kr(200, 10000, 1) val q = MouseY.kr(1, 100, 1) // bottom to top val flt = RHPF.ar(in, freq, q.reciprocal) flt / q.sqrt // compensate for energy loss }
A resonant low pass filter UGen.
A resonant low pass filter UGen.
// mouse controlled frequency and Q play { val in = WhiteNoise.ar(0.5) val freq = MouseX.kr(200, 10000, 1) val q = MouseY.kr(1, 100, 1) // bottom to top val flt = RLPF.ar(in, freq, q.reciprocal) flt / q.sqrt // compensate for energy loss }
A UGen that delivers the conversion factor from frequency in Hertz to radians (normalized frequency).
A UGen that delivers the conversion factor from frequency in Hertz to radians
(normalized frequency). The relation is RadiansPerSample * sr = 2pi
, thus
multiplying the UGen with a frequency between zero and nyquist (sr/2) yields the
normalized frequency between zero and pi.
// print the UGen value play { RadiansPerSample.ir.poll(0) }
A UGen which produces a linear lag (time smear) regarding and input signal.
A UGen which produces a linear lag (time smear) regarding and input signal.
Other than Lag
which is a feedback filter with exponential decay, Ramp
applies a linear ramp. This is achieved by sampling the input signal at regular
intervals given by the lagTime
and starting a new line segment after each
interval.
Records input into a Buffer.
Records input into a Buffer. If recLevel is 1.0 and preLevel is 0.0 then the new input overwrites the old data. If they are both 1.0 then the new data is added to the existing data. (Any other settings are also valid.)
// record and replay // a four second mono buffer val b = Buffer.alloc(s, s.sampleRate.toInt * 4) // record for four seconds play { val sig = Formant.ar(XLine.kr(400, 1000, 4), 2000, 800) * 0.125 RecordBuf.ar(sig, b.id, doneAction = freeSelf, loop = 0) } // play it back play { PlayBuf.ar(1, b.id, doneAction = freeSelf, loop = 0) }
A two pole resonant filter UGen.
A two pole resonant filter UGen. It has zeroes at z = +1
and z = -1
.
Based on K. Steiglitz, "A Note on Constant-Gain Digital Resonators", Computer Music Journal, vol 18, no. 4, pp. 8-10, Winter 1994.
// modulated frequency play { val in = Saw.ar(200) * 0.5 val freq = SinOsc.ar(XLine.ar(0.3, 100, 20)).madd(3600, 4000) Resonz.ar(in, freq) }
// mouse controlled frequency and Q play { val in = WhiteNoise.ar(0.5) val freq = MouseX.kr(200, 10000, 1) val q = MouseY.kr(1, 100, 1) // bottom to top val flt = Resonz.ar(in, freq, q.reciprocal) flt * q.sqrt // compensate for energy loss }
A resonant or "ringing" filter UGen.
A resonant or "ringing" filter UGen. This is the same as Resonz
, except that
instead of a Q parameter, the bandwidth is specified as a 60 dB ring decay time.
One Ringz
is equivalent to one component of the Klank
UGen.
// module ring time play { Ringz.ar(Impulse.ar(6) * 0.3, 2000, XLine.kr(4, 0.04, 8)) }
// modulated frequency play { val in = Saw.ar(200) * 0.02 val freq = SinOsc.ar(XLine.ar(0.3, 100, 20)).madd(2800, 4800) Ringz.ar(in, freq) }
// multiple glissandi excited by noise play { val ex = WhiteNoise.ar(0.001) Mix.fill(10) { Ringz.ar(ex, XLine.kr(ExpRand(100, 5000), ExpRand(100, 5000), 20), 0.5) } }
A UGen calculating the running sum of an input signal over a given number of samples.
A second order filter section (biquad) UGen.
A second order filter section (biquad) UGen. Filter coefficients are given directly rather than calculated for you. The formula is equivalent to:
out(i) = a0 * in(i) + a1 * in(i-1) + a2 * in(i-2) + b1 * out(i-1) + b2 * out(i-2)
// same as TwoPole play { val theta = MouseX.kr(0.2*math.Pi, 0.9*math.Pi) val rho = MouseY.kr(0.6, 0.98) val b1 = 2.0 * rho * theta.cos val b2 = -(rho.squared) SOS.ar(WhiteNoise.ar(Seq(0.05, 0.05)), 1.0, 0.0, 0.0, b1, b2) }
// used as control signal play { val theta = MouseX.kr(0.2*math.Pi, math.Pi) val rho = MouseY.kr(0.6, 0.99) val b1 = 2.0 * rho * theta.cos val b2 = -(rho.squared) val vib = SOS.kr(LFSaw.kr(3.16), 1.0, 0.0, 0.0, b1, b2) SinOsc.ar(vib * 200 + 600) * 0.2 }
A UGen that reports the server's current (audio) sample period in seconds.
A UGen that reports the server's current (audio) sample period in seconds. This
is equivalent to the reciprocal of SampleRate
// print the sample period play { SampleDur.ir.poll(0) }
A UGen that reports the server's current (audio) sample rate.
A UGen that reports the server's current (audio) sample rate. This is
equivalent to the reciprocal of SampleDur
// print the sample rate play { SampleRate.ir.poll(0) }
// use a fraction as oscillator frequency play { val div = MouseX.kr(512, 2, 1, 0).roundTo(1) val change = HPZ1.kr(div).abs val freq = SampleRate.ir / div freq.poll(change, label = "freq") SinOsc.ar(freq) * 0.1 }
A Schmidt trigger UGen.
A Schmidt trigger UGen. Initially it outputs zero. When the input signal rises
above hi
, its output switches to 1.0, which is hold until the signal falls
below lo
, switching the output again to 0.0. The produces a kind of
hysteresis behavior, preventing heavy oscillations in a noisy system which might
occur with a single-threshold trigger.
A UGen which selects among a sequence of inputs, according to an index signal.
A UGen which selects among a sequence of inputs, according to an index signal.
Note that, although only one signal of the multi
input is let through at a
time, sill all ugens are continuously running.
A UGen which sends an sequence of values from the server to all notified clients upon receiving triggers.
A UGen which sends an sequence of values from the server to all notified
clients upon receiving triggers. The message sent is
OSCMessage(<(String) msgName>, <(Int) nodeID>, <(Int) replyID>, <(Float) values>*)
.
For sending a single value, SendTrig
provides an alternative.
The argument order is different from its sclang counterpart.
A UGen that sends a value from the server to all notified clients upon receiving triggers.
A UGen that sends a value from the server to all notified clients upon
receiving triggers. The message sent is
OSCMessage("/tr", <(Int) nodeID>, <(Int) trigID>, <(Float) value>)
.
For sending an array of values, or using an arbitrary reply command, see
SendReply
.
The argument order is different from its sclang counterpart.
A sinusoidal (sine tone) oscillator UGen.
A slew rate limiter UGen.
A slew rate limiter UGen. Limits the slope of an input signal. The slope is expressed in units per second.
A UGen measuring the slope of signal.
A UGen measuring the slope of signal. It calculates the rate of change per second of a signal, as given by the following formula:
out(i) = (in(i) - in(i-1)) * sampleRate
It thus equal to HPZ1.ar(_) * 2 * SampleRate.ir
A UGen to measure the spectral centroid.
A UGen to measure the spectral centroid. Given an FFT chain, this measures the spectral centroid, which is the weighted mean frequency, or the "centre of mass" of the spectrum. (DC is ignored.) This can be a useful indicator of the perceptual brightness of a signal.
Note that the output frequency is pretty close to the correct value when
feeding in a sine signal, but the estimate is usually too high when using for
example filtered noise. In that case, you will get better results using
SpecPcile
at 50%.
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
A UGen to measure spectral flatness.
A UGen to measure spectral flatness. Given an FFT chain this calculates the Spectral Flatness measure, defined as a power spectrum's geometric mean divided by its arithmetic mean. This gives a measure which ranges from approx 0 for a pure sinusoid, to approx 1 for white noise.
The measure is calculated linearly. For some applications you may wish to
convert the value to a decibel scale. Note that this UGen may output NaN
when the input is zero (probably due to division by zero). In that case,
CheckBadValues
can be used to prevent further problems.
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
A UGen to find the percentile of a signal's magnitude spectrum.
A UGen to find the percentile of a signal's magnitude spectrum. Given an FFT
chain this calculates the cumulative distribution of the frequency spectrum, and
outputs the frequency value which corresponds to the desired percentile. For
example, to find the frequency at which 90% of the spectral energy lies below
that frequency, you want the 90-percentile, which means the value of percent
should be 0.9. The 90-percentile or 95-percentile is often used as a measure of
spectral roll-off.
Note that despite running at control-rate, the output remains constant for each FFT frame. E.g. with an FFT size of 1024 and 50% overlap, a new measure is generated every 512 audio frames, or (at control block size 64) every 8 control blocks.
A linear-interpolating sound generator based on the difference equations:
A linear-interpolating sound generator based on the difference equations:
x[n+1] = (x[n] + y[n+1]) % 2pi y[n+1] = (y[n] + k * sin(x[n])) % 2pi
The standard map is an area preserving map of a cylinder discovered by the plasma physicist Boris Chirikov.
// vary frequency play { StandardL.ar(MouseX.kr(20, SampleRate.ir)) * 0.3 }
// mouse-controlled parameter play { StandardL.ar(SampleRate.ir/2, MouseX.kr(0.9, 4)) * 0.3 }
// as a frequency control play { SinOsc.ar(StandardL.ar(40, MouseX.kr(0.9, 4)) * 800 + 900) * 0.4 }
A non-interpolating sound generator based on the difference equations:
A non-interpolating sound generator based on the difference equations:
x[n+1] = (x[n] + y[n+1]) % 2pi y[n+1] = (y[n] + k * sin(x[n])) % 2pi
The standard map is an area preserving map of a cylinder discovered by the plasma physicist Boris Chirikov.
// vary frequency play { StandardN.ar(MouseX.kr(20, SampleRate.ir)) * 0.3 }
// mouse-controlled parameter play { StandardN.ar(SampleRate.ir/2, MouseX.kr(0.9, 4)) * 0.3 }
// as a frequency control play { SinOsc.ar(StandardN.ar(40, MouseX.kr(0.9, 4)) * 800 + 900) * 0.4 }
A pulse counting UGen.
A pulse counting UGen. Each trigger increments a counter which is output as a
signal. The counter wraps inside the interval from lo
to hi
(inclusive).
That if you use a lo
other than zero, you might want to adjust resetVal
as
well. Stepper
always starts with the value in resetVal
, no matter what lo
is or whether the reset
trigger is high or not.
A frequency domain stereo convolution UGen, capable of performing linear cross-fades between kernel updates.
A frequency domain stereo convolution UGen, capable of performing linear cross-fades between kernel updates. When receiving a trigger, there is a linear cross-fade between the old kernel the new buffer contents. It operates similar to Convolution2L, however uses two buffers and outputs a stereo signal, resulting in better CPU usage than two discrete instances of Convolution2L as this way one FFT transformation per period is saved.
A UGen that reports the fractional sample offset of the current Synth from its requested scheduled start.
A UGen that reports the fractional sample offset of the current Synth from its requested scheduled start.
When a synth is created from a time stamped osc-bundle, it starts calculation
at the next possible block (normally 64 samples). Using an OffsetOut
UGen, one
can delay the audio so that it matches sample accurately.
For some synthesis methods, one even needs subsample accuracy.
SubsampleOffset
provides the information where, within the current sample, the
synth was scheduled. It can be used to offset envelopes or resample the audio
output.
A UGen which starts a linear raise from zero each time it is triggered.
A delay UGen for trigger signals.
A delay UGen for trigger signals. Other than a normal buffer delay, any new trigger arriving in the time between the previous trigger and the passing of the delay time is ignored.
A UGen which polls results from demand-rate ugens in intervals specified by a duration input, and outputs them as trigger values.
A UGen which polls results from demand-rate ugens in intervals specified by a
duration input, and outputs them as trigger values. A value from the level
ugen is demanded and output for one sample (when running at audio-rate) or one
block (when running at control-rate) according to a stream of duration values.
When there is a trigger at the reset input, the level
and the dur
input are
reset.
Triggers generate grains from a buffer.
Triggers generate grains from a buffer. Each grain has a Hanning envelope
(sin2(x) for x from 0 to ᅬタ)
and is panned between two channels of multiple outputs.
A UGen providing a probability-weighted index into a sequence upon receiving a trigger.
A UGen providing a probability-weighted index into a sequence upon receiving a trigger.
When triggered, returns a random index value based the values of the channels
of the prob
argument functioning as probabilities. The index is zero based,
hence goes from 0
to prob.numOutputs - 1
.
By default the sequence of probabilities should sum to 1.0, however for
convenience, this can be achieved by the ugen when the normalize
flag is set
to 1 (less efficient).
A UGen that returns time since last triggered.
A UGen that returns time since last triggered. The time returned is in seconds
and is measured from the last received trigger. Note that currently it seems the
initial memory is at -1 sample, so for Impulse.ar(1)
the result (at 44.1 kHz)
is 2.26757e-05, followed strangely by 1.00002, and then (as expected) 1.0.
A UGen that toggles like a flip-flop between zero and one upon receiving a trigger.
A UGen that toggles like a flip-flop between zero and one upon receiving a trigger. The flip-flop initially outputs zero and changes to one when the first trigger arrives.
A UGen which outputs a value of 1 for a given duration when triggered.
A UGen which outputs a value of 1 for a given duration when triggered.
When a trigger occurs at the input, a value of 1 is output for the specified duration, otherwise zero is output. When a new trigger occurs while this ugens outputs 1, the hold-time is reset to the duration.
A two pole filter UGen.
A two pole filter UGen. This provides lower level access to setting of pole
location. For general purposes Resonz
is better.
// static frequency play { TwoPole.ar(WhiteNoise.ar(0.005), 2000, 0.95) }
// sweeping frequency play { TwoPole.ar(WhiteNoise.ar(0.005), XLine.kr(800, 8000, 8), 0.95) }
// mouse controlled frequency play { TwoPole.ar(WhiteNoise.ar(0.005), MouseX.kr(800, 8000, 1), 0.95) }
A two zero filter UGen.
A UGen to stream in a signal from an audio file with variable playback speed.
A UGen to stream in a signal from an audio file with variable playback speed. Continuously plays a longer audio file from disk. This requires a buffer to be preloaded with one buffer size of sound. If loop is set to 1, the file will loop.
Note: The buffer size must be a multiple of (2 * the server's block
size). See Buffer#cue
for details.
If the speed is too high, the UGen will not execute, posting a warning.
A UGen which reads a single sample value from a buffer at a given index.
A UGen which reads a single sample value from a buffer at a given index.
It uses the in
argument as index into the buffer, truncating that argument to
an integer. Out-of-range index values are wrapped around the valid range. For
example, if the buffer has four samples, index 4 is wrapped to index 0, index 5
is wrapped to index 1, index -1 is wrapped to index 3, index -2 is wrapped to
index 2, etc.
While designed for monophonic buffers, it works with multi-channel buffers by
treating them as de-interleaved. See the Index
UGen for details.
An equal power two channel cross fading UGen.
An equal power two channel cross fading UGen.
An exponential curve generator UGen that moves from a start value to the end value in a given duration.
An exponential curve generator UGen that moves from a start value to the end value in a given duration.
At a given point in time 0 <= t <= dur
, the output value is
start * (stop/start).pow(t/dur)
.
Warning: It must be ensured that the both start
is not zero and start
and end
have the same sign (e.g. a start
of -1
and an end of -0.001
are
valid), otherwise the UGen will output a NaN
! While in the case of end
being zero the UGen will also output zero, it is recommended to treat this case
as pathological as well.
The argument order is different from its sclang counterpart.