A UGen that reads in an audio file.
A binary operator UGen, for example two sum or multiply two signals.
A binary operator UGen, for example two sum or multiply two signals.
The left or a
input is "hot", i.e. it keeps the UGen running,
while the right or b
input may close early, and the last value will
be remembered.
the identifier of the operator (e.g. BinaryOp.Times.id
)
the left operand which determines how long the UGen computes
the right operand.
Straight outta ScalaCollider.
Creates a constant infinite signal.
A scalar constant used as an input to a UGen.
Creates a constant infinite signal.
A UGen for type II discrete cosine transform.
A UGen for type II discrete cosine transform.
input signal
input signal window size
number of coefficients output
if zero (default), the zero'th coefficient is
_not_ skipped in the output, if
non-zero, the zero'th coefficient is
included. In any case, the output
window size is numCoeffs
.
A UGen that reads in an audio file.
A UGen that reads in an audio file. The output signal
is the monotonously increasing number of frames written,
which can be used to monitor progress or determine the
end of the writing process. The UGen keeps running until
the in
signal ends.
the signal to write.
A UGen that prints snapshots of its input to the console.
A UGen that prints snapshots of its input to the console. Note that arguments have different order than in ScalaCollider!
the input to be pulled. If this is a constant,
the UGen will close after polling it. This is to
prevent a dangling DebugPoll
whose trigger is
infinite (such as Impulse
). If you want to avoid
that, you should wrap the input in a DC
.
an identifying label to prepend to the printing.
A debugging UGen that installs a persistent no-op sink,
allowing the in
UGen to remain in the graph even if
it does not have a side-effect and it is not connected
to any other graph element.
A debugging UGen that installs a persistent no-op sink,
allowing the in
UGen to remain in the graph even if
it does not have a side-effect and it is not connected
to any other graph element.
the element to keep inside the graph
A UGen that outputs triggers for local maxima within a sliding window.
A UGen that outputs triggers for local maxima within a sliding window. If multiple local maxima occur within the current window, only the one with the largest value will cause the trigger.
By definition, the first and last value in the input stream cannot qualify for local maxima.
the signal to analyze for local maxima
the sliding window size. Each two
emitted triggers are spaced apart at least
by size
frames.
A UGen that outputs a single frame of 1
when the input
is finished.
Insert a buffer into the stream of num
blocks.
Disk-buffered (large) Fourier transform.
Disk-buffered (large) Fourier transform.
Output windows will have a complex size of (size + padding).nextPowerOfTwo
input signal to transform. This must be complex (Re, Im interleaved)
the (complex) window size
the (complex) zero-padding size for each window
the direction is 1
for forward and -1
for backward transform.
other numbers will do funny things.
the amount of frames (chunk size) to buffer in memory. this should be a power of two.
A UGen that generates a signal that incrementally counts the frames of its input.
A repeated window generator UGen.
A repeated window generator UGen. It repeats the same window again and again (unless parameters are modulated). The parameters are demand-rate, polled once per window.
the window size
the identifier of the window shape, such as GenWindow.Hann
.
parameter used by some window shapes, such as GenWindow.Kaiser
A UGen that orthogonalizes an input matrix using the stabilized Gram-Schmidt algorithm.
A UGen that orthogonalizes an input matrix using the stabilized Gram-Schmidt algorithm. It processes the row vectors per matrix by making them orthogonal to one another, optionally also orthonormal.
the input matrices
the number of rows of the _input_
the number of columns of the _input_
Impulse (repeated dirac) generator.
Impulse (repeated dirac) generator. For a single impulse that is never repeated, use zero.
normalized frequency (reciprocal of frame period)
phase offset in cycles (0 to 1).
Reports the length of the input as a single value one the input has terminated.
A line segment generating UGen.
A line segment generating UGen. The UGen terminates when the segment has reached the end.
starting value
ending value
length of the segment in sample frames
A UGen that maps short-time Fourier transformed spectra to the mel scale.
A UGen that maps short-time Fourier transformed spectra to the mel scale. To obtain
the MFCC, one has to take the log of the output of this UGen and decimate it with a DCT
.
Example:
def mfcc(in: GE) = { val fsz = 1024 val lap = Sliding(in, fsz, fsz/2) * GenWindow(fsz, GenWindow.Hann) val fft = Real1FFT(lap, fsz, mode = 1) val mag = fft.complex.mag.max(-80) val mel = MelFilter(mag, fsz/2, bands = 42) DCT_II(mel.log, 42, 13, zero = 0) }
magnitudes of spectra, as output by Real1FFT(..., mode = 1).complex.abs
bands in input spectrum (assumed to be fft-size / 2
).
lowest band corresponds to DC and highest to (size - 1)/size * sampleRate/2
.
lower frequency to sample. Will be clipped between zero (inclusive) and Nyquist (exclusive).
upper frequency to sample. Will be clipped between minFreq
(inclusive) and Nyquist (exclusive).
number of filter bands output
Metronome (repeated dirac) generator.
Metronome (repeated dirac) generator.
For a single impulse that is never repeated,
use a period of zero. Unlike Impulse
which
uses a frequency and generates fractional phases
prone to floating point noise, this is UGen is
useful for exact sample frame spacing. Unlike Impulse
,
the phase cannot be modulated.
number of frames between impulses. Zero is short-hand
for Long.MaxValue
phase offset in frames. Initialization time only!
A one pole (IIR) filter UGen.
A one pole (IIR) filter UGen. Implements the formula :
out(i) = ((1 - abs(coef)) * in(i)) + (coef * out(i-1))
input signal to be processed
feedback coefficient. Should be between -1 and +1
A one pole (IIR) filter UGen applied to windowed data.
A one pole (IIR) filter UGen applied to windowed data. Implements the formula :
out(i) = ((1 - abs(coef)) * in(i)) + (coef * out(i-1))
This filter runs in parallel for all frames of the window (or matrix).
That is, in the above formula out
is replaced by each window element, and
i
is the window count.
input signal to be processed
window size
feedback coefficient. Should be between -1 and +1
A UGen that performs overlap-and-add operation on a stream of input windows.
A UGen that performs overlap-and-add operation on a stream of input windows.
The size
and step
parameters are demand-rate, polled once per (input) window.
the non-overlapped input
the window size in the input
the step between successive windows in the output.
when smaller than size
, the overlapping portions are summed together.
A UGen that calculates the Pearson product-moment correlation coefficient of two input matrices.
A UGen that calculates the Pearson product-moment correlation coefficient of two input matrices.
first matrix
second matrix
matrix or window size
Debugging utility that plots 1D "windows" of the input data.
A UGen that prints snapshots of its input to the console.
A UGen that prints snapshots of its input to the console. Note that arguments have different order than in ScalaCollider!
the input to be pulled. If this is a constant,
the UGen will close after polling it. This is to
prevent a dangling Poll
whose trigger is
infinite (such as Impulse
). If you want to avoid
that, you should wrap the input in a DC
.
trigger that causes the UGen to print a snapshot of the input.
an identifying label to prepend to the printing.
A sorting UGen that can be thought of as a bounded priority queue.
A sorting UGen that can be thought of as a bounded priority queue.
It keeps all data in memory but limits the size to the
top size
items. By its nature, the UGen only starts outputting
values once the input signal (keys
) has finished.
the sorting keys; higher values mean higher priority
the values corresponding with the keys and eventually
output by the UGen. It is well possible to use the
same signal both for keys
and values
.
the maximum size of the priority queue.
A UGen that contributes to the progress monitoring of a graph.
A UGen that contributes to the progress monitoring of a graph. It is possible to instantiate multiple instances of this UGen, in which cases their individual progress reports will simply be added up (and clipped to the range from zero to one).
progress fraction from zero to one
trigger that causes the UGen to submit a snapshot of the progress to the control instance.
the label can be used to distinguish the contributions of different progress UGens
Forward short-time Fourier transform UGen for a real-valued input signal.
Forward short-time Fourier transform UGen for a real-valued input signal.
The FFT size is equal to size + padding
. The output is a succession
of complex half-spectra, i.e. from DC to Nyquist. Depending on mode
,
the output window size is either size + padding
or size + padding + 2
.
the real signal to transform. If overlapping windows
are desired, a Sliding
should already have been applied
to this signal, as well as multiplication with a window function.
the input window size
amount of zero padding for each input window.
packing mode.
0
(default) is standard "packed" mode,
whereby the real part of the bin at Nyquist is stored in the imaginary
slot of the DC. This mode allows perfect reconstruction with a
Real1IFFT
using the same mode.
1
is "unpacked" mode,
whereby the output windows are made two samples longer,
so that the Nyquist bin is included in the very end. By
definition, the imaginary parts of DC and Nyquist are zero.
This mode allows perfect reconstruction with a
Real1IFFT
using the same mode.
2
is "discarded" mode,
whereby the Nyquist bin is omitted. While it doesn't allow
a perfect reconstruction, this mode is useful for analysis,
because the output window size is equal to the fft-size,
and the imaginary part of DC is correctly zero'ed.
A band-limited resampling UGen.
A band-limited resampling UGen.
It uses an internal table for the anti-aliasing filter.
Table resolution is currently fixed at 4096 filter samples per zero crossing and
linear interpolation in the FIR table, but the total filter length can be specified
through the zeroCrossings
parameter. Note: If filter parameters are changed, the
table must be recalculated which is very expensive. However, factor
modulation
is efficient.
Note: Unlike most other UGens, all parameters but in
are read at "output rate".
That is particular important for factor
modulation. For each frame output, one
frame from factor
is consumed.
the signal to resample
the resampling factor, where values greater than one mean the signal is stretched (sampling-rate increases or pitch lowers) and values less than one mean the signal is condensed (sampling-rate decreases or pitch rises)
the minimum expected resampling factor, which controls
the amount of buffering needed for the input signal. This is used at
initialization time only. The default
value of zero makes the UGen settles on the first factor
value encountered.
It is possible to use a value actually higher than the lowest provided
factor
, in order to limit the buffer usage. In that case, the FIR anti-aliasing
filter will be truncated.
the FIR anti-aliasing roll-off width
the FIR windowing function's parameter
the number of zero-crossings in the truncated and windowed sinc FIR.
A band-limited resampling UGen for images/matrices.
A band-limited resampling UGen for images/matrices.
This works like Resample
but processes each window cell
across time. Thus is is not _resampling each window by itself_,
but each "pixel" or matrix cell in a window across successive windows.
the signal to resample
the window size. Currently this is only read once upon initialization.
the resampling factor, where values greater than one mean the signal is stretched (sampling-rate increases or pitch lowers) and values less than one mean the signal is condensed (sampling-rate decreases or pitch rises)
the minimum expected resampling factor, which controls
the amount of buffering needed for the input signal. This is used at
initialization time only. The default
value of zero makes the UGen settles on the first factor
value encountered.
It is possible to use a value actually higher than the lowest provided
factor
, in order to limit the buffer usage. In that case, the FIR anti-aliasing
filter will be truncated.
the FIR anti-aliasing roll-off width
the FIR windowing function's parameter
the number of zero-crossings in the truncated and windowed sinc FIR.
A UGen that resizes the windowed input signal by trimming each
windows boundaries (if start
is greater than zero
or stop
is less than zero) or padding the boundaries
with zeroes (if start
is less than zero or stop
is
greater than zero).
A UGen that resizes the windowed input signal by trimming each
windows boundaries (if start
is greater than zero
or stop
is less than zero) or padding the boundaries
with zeroes (if start
is less than zero or stop
is
greater than zero). The output window size is thus
size - start + stop
.
the signal to window and resize
the input window size
the delta window size at the output window's beginning
the delta window size at the output window's ending
A UGen that like RunningMax
calculates the maximum observed value of the
running input.
A UGen that like RunningMax
calculates the maximum observed value of the
running input. However, it operates on entire windows, i.e. it outputs
windows that contain the maximum elements of all the past windows observed.
the windowed signal to monitor
the window size. This should normally be a constant. If modulated, the internal buffer will be re-allocated, essentially causing a reset trigger.
a trigger signal that clears the internal state. When a trigger is observed, the _currently processed_ window is reset altogether until its end, beginning accumulation again from the successive window. Normally one will thus want to emit a trigger in sync with the _start_ of each window. Emitting multiple triggers per window does not have any effect different from emitting the first trigger in each window.
A UGen that like RunningMin
calculates the minimum observed value of the
running input.
A UGen that like RunningMin
calculates the minimum observed value of the
running input. However, it operates on entire windows, i.e. it outputs
windows that contain the minimum elements of all the past windows observed.
the windowed signal to monitor
the window size. This should normally be a constant. If modulated, the internal buffer will be re-allocated, essentially causing a reset trigger.
a trigger signal that clears the internal state. When a trigger is observed, the _currently processed_ window is reset altogether until its end, beginning accumulation again from the successive window. Normally one will thus want to emit a trigger in sync with the _start_ of each window. Emitting multiple triggers per window does not have any effect different from emitting the first trigger in each window.
A UGen that like RunningSum
calculates the sum of the
running input.
A UGen that like RunningSum
calculates the sum of the
running input. However, it operates on entire windows, i.e. it outputs
windows that contain the sum elements of all the past windows observed.
the windowed signal to monitor
the window size. This should normally be a constant. If modulated, the internal buffer will be re-allocated, essentially causing a reset trigger.
a trigger signal that clears the internal state. When a trigger is observed, the _currently processed_ window is reset altogether until its end, beginning accumulation again from the successive window. Normally one will thus want to emit a trigger in sync with the _start_ of each window. Emitting multiple triggers per window does not have any effect different from emitting the first trigger in each window.
Sine oscillator.
Sine oscillator.
Note that the frequency is not in Hertz but
the normalized frequency
as we do not maintained one global sample rate.
For a frequency in Hertz, freqN
would be
that frequency divided by the assumed sample rate.
normalized frequency (f/sr).
phase offset in radians
A UGen that assembles slices of an input signal in random access fashion.
A UGen that assembles slices of an input signal in random access fashion. It does so by buffering the input to disk.
the signal to re-arrange.
successive frame start (inclusive) and
stop (exclusive) frame
positions determining the spans that
are output by the UGen. This parameter
is read on demand. First, the first two
values are read, specifying the first span.
Only after this span has been output,
the next two values from spans
are
read, and so on. Values are clipped to
zero (inclusive) and the length of the
input signal (exclusive). If a
start position is greater than a stop
position, the span is output in reversed order.
input signal to be convolved
filter kernel (will be read only once)
length of filter kernel (static)
threshold for input samples within kernel range. convolution is only applied to those frames whose absolute difference to the centre inter
a trigger signal that determines logical "boundaries" in the input signal. The convolution is truncated to the left and right of the boundary positions, making it possible to perform convolutions on windowed signals.
A UGen that outputs the number of sample frames passed since last triggered.
A UGen that outputs the number of sample frames passed since last triggered. If no trigger is used, it simply outputs a linearly rising ramp.
trigger signal to reset the counter. Note that the UGen
shuts down when trig
finishes, so to use a constant like 0
,
it has to be wrapped in a DC
, for example.
A UGen that transposes 2-dimensional matrices.
A UGen that transposes 2-dimensional matrices.
This is a 2-dimensional windowed process, where
each window has length rows * columns
. Input
is assumed to be "left-to-right, top-to-bottom",
so the first samples constitute the first row,
the next samples constitute the second row, etc.
The output matrix is transposed (rows and columns
exchanged). So an input of (a, b, c, d, e, f)
with rows = 2
and columns = 3
is interpreted
as ((a, b, c), (d, e, f))
, transposed as
((a, d), (b, e), (c, f))
and output flat as
(a, d, b, e, c, f)
.
To rotate an image ninety
degrees clockwise, you would have rows = height
and columns = width
.
the input matrices
the number of rows of the _input_
the number of columns of the _input_
A UGenOutProxy refers to a particular output of a multi-channel UGen.
A UGenOutProxy refers to a particular output of a multi-channel UGen. A sequence of these form the representation of a multi-channel-expanded UGen.
Binary operator assuming operands are complex signals (real and imaginary interleaved).
Binary operator assuming operands are complex signals (real and imaginary interleaved). Outputs another complex stream even if the operator yields a purely real-valued result.
XXX TODO - need more ops such as conjugate, polar-to-cartesian, ...
Unary operator assuming stream is complex signal (real and imaginary interleaved).
Unary operator assuming stream is complex signal (real and imaginary interleaved).
Outputs another complex stream even if the operator yields a purely real-valued result
(ex. abs
).
XXX TODO - need more ops such as conjugate, polar-to-cartesian, ...
A UGen that reads in an audio file. The output signal is the monotonously increasing number of frames written, which can be used to monitor progress or determine the end of the writing process. The UGen keeps running until the
in
signal ends.the file to write to
the spec for the audio file, including numbers of channels and sample-rate
the signal to write.