A Signal is a FloatArray that represents a sampled function of time buffer. Signals support math operations.
Fill a Signal of the given size with a sum of sines at the given amplitudes and phases. The Signal will be normalized.
size |
the number of samples in the Signal. |
amplitudes |
an Array of amplitudes for each harmonic beginning with the fundamental. |
phases |
an Array of phases in radians for each harmonic beginning with the fundamental. |
Fill a Signal of the given size with a sum of Chebyshev polynomials at the given amplitudes. For eventual use in waveshaping by the Shaper ugen; see Shaper helpfile and Buffer:cheby too.
size |
the number of samples in the Signal. |
amplitudes |
an Array of amplitudes for each Chebyshev polynomial beginning with order 1. |
normalize |
a Boolean indicating whether to normalize the resulting Signal. If the zeroOffset argument is true, the normalization is done for use as a transfer function, using normalizeTransfer, otherwise it just uses normalize to make the absolute peak value 1. Default is true. |
zeroOffset |
a Boolean indicating whether to offset the middle of each polynomial to zero. If true, then a zero input will always result in a zero output when used as a waveshaper. If false, then the "raw" (unshifted) Chebyshev polynomials are used. Default is false. |
Fill a Signal of the given size with a Hanning window.
size |
the number of samples in the Signal. |
pad |
the number of samples of the size that is zero padding. |
Fill a Signal of the given size with a Hamming window.
Signal.hammingWindow
had incorrect coefficients. To get the old behavior back, use Signal.hammingWindow_old
.size |
the number of samples in the Signal. |
pad |
the number of samples of the size that is zero padding. |
Fill a Signal of the given size with a Welch window.
size |
the number of samples in the Signal. |
pad |
the number of samples of the size that is zero padding. |
Fill a Signal of the given size with a rectangular window.
size |
the number of samples in the Signal. |
pad |
the number of samples of the size that is zero padding. |
Fourier Transform: Fill a Signal with the cosine table needed by the FFT methods. See also the instance methods -fft and -ifft.
This used to be Signal.hammingWindow
, but the coefficients were incorrect (making it a different window in the generalized Hamming window family). It is provided to assist in porting code to 3.11 and later.
Plot the Signal in a window. The arguments are not required and if not given defaults will be used.
For details, see plot
Loads the signal into a buffer on the server and plays it. Returns the buffer so you can free it again.
loop |
A Boolean whether to loop the entire signal or play it once. Default is false. |
mul |
volume at which to play it, 0.2 by default. |
numChannels |
if the signal is an interleaved multichannel file, number of channels, default is 1. |
server |
the server on which to load the signal into a buffer. |
Fill the Signal with a function evaluated over an interval.
function |
a function that should calculate the value of a sample. The function is called with three arguments:
As arguments, three values are passed to the function: the current input value (abscissa), the old value (if the signal is overwritten), and the index. |
start |
the starting value of the interval. |
end |
the ending value of the interval. |
Convert the Signal into a Wavetable.
Fill the Signal with a value.
Scale the Signal by a factor in place.
Offset the Signal by a value in place.
Return the peak absolute value of a Signal.
Normalize the Signal in place such that the maximum absolute peak value is 1.
Normalizes a transfer function so that the center value of the table is offset to zero and the absolute peak value is 1. Transfer functions are meant to be used in the Shaper ugen.
Invert the Signal in place.
Reverse a subrange of the Signal in place.
Fade a subrange of the Signal in place.
Return the integral of a signal.
Add a signal to myself starting at the index. If the other signal is too long only the first part is overdubbed.
Write a signal to myself starting at the index. If the other signal is too long only the first part is overdubbed.
Blend two signals by some proportion.
Perform an FFT on a real and imaginary signal in place. See also the class method *fftCosTable.
Perform an inverse FFT on a real and imaginary signal in place. See also the class method *fftCosTable.
Signal will respond to unary operators by returning a new Signal.
Signal will respond to binary operators by returning a new Signal.
Thresholding replaces every value < threshold with 0.