cycle~
Description
Use the cycle~ object to generate a periodic waveform. The default waveform is one cycle of a cosine wave. You can also use the wave~ object, which offers additional flexibility though slightly less optimization.
Examples

Discussion
The cycle~ object is an interpolating oscillator that reads repeatedly through one cycle of a waveform, using a wavetable. The wavetable can be changed using the 'set' message. This wavetable may be of any size, but historically was limited to 512 samples.
Arguments
frequency [number]
Oscillator frequency (initial) The initial frequency of the oscillator
Attributes
buffer [symbol]
Buffer containing an external waveform. Setting the buffer~ with the attribute is analogous to sending the message.
buffer_offset [atom_long]
First sample of a buffer (if an external buffer is providing the waveform)
buffer_sizeinsamps [atom_long]
Override the size of the buffer used for the wavetable. If using the buffer~ length. Use this attribute to define a different size (the size should be a power of two). Setting this size to 0 will result in an effective size of 512 and setting it to -1 will result an effective size of the whole buffer~ length.
Possible values:
'-1'
'0'
'16'
'32'
'64'
'128'
'256'
'512'
'1024'
'2048'
'4096'
'8192'
'16384'
'32768'
'65536'
frequency [float]
Oscillator frequency
phase [float]
Phase offset
Common Box Attributes
Messages
float
Arguments
Right inlet: phase of the oscillator in the range 0.0 to 1.0
(mouse)
reset
Arguments
set
Arguments
sample-offset [int]
setall
Arguments
signal
Right inlet: phase of the oscillator in the range 0.0 to 1.0
Output
signal
A waveform (cosine by default) repeating at the specified frequency, with the specified phase.
See Also
Name | Description |
---|---|
buffer~ | |
buffir~ | |
cos~ | |
line~ | |
phasor~ | |
rect~ | |
saw~ | |
techno~ | |
trapezoid~ | |
tri~ | |
triangle~ | |
wave~ | |
2d.wave~ | |
MSP Basics Tutorial 2: Adjustable Oscillator | MSP Basics Tutorial 2: Adjustable Oscillator |
MSP Basics Tutorial 3: Wavetable Oscillator | MSP Basics Tutorial 3: Wavetable Oscillator |
Sampling Tutorial 5: Waveshaping | Sampling Tutorial 5: Waveshaping |
MSP Sampling Tutorial 1: Recording and Playback | MSP Sampling Tutorial 1: Recording and Playback |