rect~ Reference

Anti-aliased rectangular (pulse) oscillator.

rect~

Examples

Arguments

frequency [auto]

Optional

Sets the frequency of the oscillator in Hertz.

pulsewidth [auto]

Optional

Sets the duty cycle of the oscillator. Signal is wrapped into the range 0-1. A value of 0.5 will produce a rectangular wave that spends equal amounts of time on the positive and negative edges of its cycle.

Inlets

frequency [auto]

Sets the frequency of the oscillator in Hertz.

pulsewidth [auto]

Sets the duty cycle of the oscillator. Signal is wrapped into the range 0-1. A value of 0.5 will produce a rectangular wave that spends equal amounts of time on the positive and negative edges of its cycle.

syncPhase [auto]

A sync signal. When the control phasor transitions from 1 to 0, the oscillator resets itself. A phasor~ object works well for this purpose. The classic use is to set this control signal to your fundamental frequency and "sweep" the left frequency input in a range somewhere several octaves higher than the fundamental.

Outlets

out1 [signal]

An antialiased rectangular waveform. An ideal, straight-line rectangular wave generated in a computer contains aliased frequencies that can sound irritating. rect~ produces a nice, analog-esque output waveform.

out2 [signal]

The phase of the oscillator.

Dynamic Attributes

These attributes can be modified in the code during execution using the set object

frequency [auto]

Sets the frequency of the oscillator in Hertz.

pulsewidth [auto]

Sets the duty cycle of the oscillator. Signal is wrapped into the range 0-1. A value of 0.5 will produce a rectangular wave that spends equal amounts of time on the positive and negative edges of its cycle.

reset [bang] (default: 0)

Banging this attribute will reset the object to its default state.

syncPhase [auto]

A sync signal. When the control phasor transitions from 1 to 0, the oscillator resets itself. A phasor~ object works well for this purpose. The classic use is to set this control signal to your fundamental frequency and "sweep" the left frequency input in a range somewhere several octaves higher than the fundamental.

See Also

Name Description
rect~ Antialiased rectangular (pulse) oscillator
cycle~ Sinusoidal oscillator
phasor~ Generate sawtooth signals
cycle~ A periodic waveform oscillator.
phasor~ Generate sawtooth signals
triangle~ A triangle/ramp wavetable oscillator with a phase input.
saw~ Anti-aliased sawtooth oscillator.