osc - A generator for sine, saw and square waves.
Inputs:
function [STRING] [REQUIRED]: waveform: ’sin’, ’square’, ’saw’ or ’input’.
waveform [BUFFER] [OPTIONAL]: buffer containing waveform, used when ’input’ is specified in ’function’.
freq [BUFFER|FLOAT] [REQUIRED]: frequency in Hz.
amplitude [BUFFER|FLOAT] [OPTIONAL]: amplitude in unit.
p_offset [FLOAT] [OPTIONAL] period offset, in period (1. = full period).
a_offset [FLOAT] [OPTIONAL] amplitude offset, a constant that gets added to the resulting signal.
duration [FLOAT] [REQUIRED]: duration of resulting signal in seconds.
sampling [FLOAT] [OPTIONAL]: sampling rate, def 44100Hz.
interp [STRING] [OPTIONAL]: interpolation of the resulting buffer, ’step’, ’linear’ or ’sine’.
param0 [BUFFER|FLOAT] [OPTIONAL]: wave parameter 0.
param1 [BUFFER|FLOAT] [OPTIONAL]: wave parameter 1.
param2 [BUFFER|FLOAT] [OPTIONAL]: wave parameter 2.
param3 [BUFFER|FLOAT] [OPTIONAL]: wave parameter 3.
param4 [BUFFER|FLOAT] [OPTIONAL]: wave parameter 4.
param5 [BUFFER|FLOAT] [OPTIONAL]: wave parameter 5.
Outputs:
out [BUFFER]: output signal.
Generates a periodic signal with the frequency freq and the amplitude amplitude. Both frequency and amplitude can be variable and given as a buffer.
Furthermore, a_offset can be specified to add a constant to the resulting signal, and p_offset can be specified to offset the period (0. = no offset, 1. = one full period).
Some waveforms accept one or several parameters to modify their shape, in param<n>.
function must be one of:
sin |
generates a simple sinusoidal function, sin(t). It has no parameter. | ||
saw |
generates a saw tooth signal. param0 can be used to change the shape of the signal, specifically the up ramp / down ramp ratio. -0.5 = immediate up ramp, slow down ramp, 0 = triangular signal, 0.5 = slow ramp up, immediate ramp down, and all values in between. Note that param0 can vary and be given as a buffer, which will produce a signal with fluctuating shape. | ||
square |
generates a square signal. param0 can be used to change the level up/down ratio. -0.5 = always down, 0 = even, 0.5 = always up. param0 can be a variable buffer. | ||
custom |
generates a periodic signal with the shape given in the waveform buffer. It has no parameter. |