# pink.oscillators

Oscillator Functions

### blit-pulse

`(blit-pulse freq pulse-width)`

`(blit-pulse freq pulse-width nharmonics)`

Implementation of BLIT algorithm by Stilson and Smith for band-limited pulse waveform. Returns an optimized audio-function if freq is a number, or a slower version if freq is itself an audio-function.

### blit-saw

`(blit-saw freq)`

`(blit-saw freq nharmonics)`

Implementation of BLIT algorithm by Stilson and Smith for band-limited sawtooth waveform. Based on the C++ implementation from STK. Returns an optimized audio-function if freq is a number, or a slower version if freq is itself an audio-function.

### blit-square

`(blit-square freq)`

`(blit-square freq nharmonics)`

Implementation of BLIT algorithm by Stilson and Smith for band-limited square waveform. Returns an optimized audio-function if freq is a number, or a slower version if freq is itself an audio-function.

### blit-triangle

`(blit-triangle freq)`

`(blit-triangle freq nharmonics)`

Generates BLIT-based triangle wave, via integration of BLIT square wave.

### lfo

`(lfo amp freq)`

`(lfo amp freq lfo-type)`

Low-Frequency Oscillator with various types. Based on Csound's LFO opcode by John ffitch. Accepted lfo-types are: TYPE RANGE :sine [-amp,amp] :triangle [-amp,amp] :square [-amp,amp] :square-unipolar [0.0, amp] :saw [0.0, amp] :saw-down [0.0, amp] Note: This is not a bandlimited oscillator and should be used only for parameter modulation. Also, unlike Csound's lfo, does not allow switching the lfo-type at performance time.

### oscil

`(oscil amp freq)`

`(oscil amp freq table)`

`(oscil amp freq table phase)`

Oscillator with table (defaults to sine wave table, truncates indexing)

### oscil3

`(oscil3 amp freq)`

`(oscil3 amp freq table)`

`(oscil3 amp freq table phase)`

Cubic-interpolating oscillator with table (defaults to sine wave table) (based on Csound's oscil3)

### oscili

`(oscili amp freq)`

`(oscili amp freq table)`

`(oscili amp freq table phase)`

Linear-interpolating oscillator with table (defaults to sine wave table)

### phasor

`(phasor freq phase)`

Phasor with frequency and starting phase

### phasor-fixed

`(phasor-fixed freq phase)`

Phasor with fixed frequency and starting phase

### pulse

`(pulse freq)`

`(pulse freq amp)`

Pulse generator. If freq is number and <= 0.0, will return a single impulse. Otherwise returns impulses at given frequency. Freq may be time-vary function.

### sine

`(sine freq)`

`(sine freq phase)`

Sine generator with fixed frequency and starting phase

### sine-table

### sine2

`(sine2 f)`

`(sine2 f p)`

Sine generator with variable frequency and fixed starting phase.

### unirect

`(unirect freq duty-cycle)`

Unipolar rectangle signal generator. Takes in frequency and duty cycle. Useful as a periodic gate signal.

### vphasor

`(vphasor freq phase)`

Phasor with variable frequency and variable starting phase.