sc3.synth.ugens.oscillators module

Osc.sc

class Osc(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

Interpolating wavetable oscillator.

Linear interpolating wavetable lookup oscillator with frequency and phase modulation inputs.

Parameters
  • bufnum (int) – Buffer index.

  • freq (float) – Frequency in Hertz.

  • phase (float) – Phase offset or modulator in radians. Note: phase values should be within the range +-8pi. If your phase values are larger then simply use .mod(2pi) to wrap them.

Notes

This oscillator requires a buffer to be filled with a wavetable format signal. This preprocesses the Signal into a form which can be used efficiently by the oscillator. The buffer size must be a power of 2.

This can be achieved by creating a Buffer object and sending it one of the ‘/b_gen’ messages, e.g. sine1, sine2 or sine3, with the wavetable flag set to true.

Note

The following part is not implemented yet.

This can also be achieved by creating a Signal object and sending it the as_wavetable message, thereby creating a Wavetable object in the required format. Then, the wavetable data may be transmitted to the server using the Buffer’s new_send_list or new_load_list constructors.

Examples

Allocate the buffer in the server and send the gen command as wavetable through the sine1 method. By default, normalize and as_wavetable parameters are true.

>>> b = Buffer(8192, 1)
>>> b.sine1([1.0 / x for x in range(1, 7)])

Create the synthdef in the server.

>>> @synthdef
... def osc(outbus, buf, freq=220, amp=0.1):
...     Out.ar(outbus, Osc.ar(buf, freq) * amp)

Create the synth node with the wavetable buffer as argument.

>>> x = osc(buf=b)
>>> x.free()
classmethod ar(bufnum, freq=440.0, phase=0.0)
classmethod kr(bufnum, freq=440.0, phase=0.0)
class SinOsc(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

Interpolating sine wavetable oscillator.

Parameters
  • freq (float) – Frequency in Hertz. Sampled at audio-rate.

  • phase (float) – Phase in radians. Sampled at audio-rate.

Notes

Generates a sine wave. Uses a wavetable lookup oscillator with linear interpolation. Frequency and phase modulation are provided for audio-rate modulation. Technically, SinOsc uses the same implementation as Osc except that its table is fixed to be a sine wave made of 8192 samples.

Phase values should be within the range +-8pi. If your phase values are larger then simply use mod(2pi) to wrap them.

Examples

Create the synthdef in the server.

>>> @synthdef
... def sine(freq=440, amp=0.1):
...     sig = SinOsc.ar(freq) * amp
...     Out.ar(0, sig)

Create the synth node using a dictionary for the initial arguments.

>>> x = Synth('sine', {'freq': 220, 'amp': 0.1, 'pan': -0.25})
>>> x.free()
classmethod ar(freq=440.0, phase=0.0)
classmethod kr(freq=440.0, phase=0.0)
class SinOscFB(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(freq=440.0, feedback=0.0)
classmethod kr(freq=440.0, feedback=0.0)
class OscN(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(bufnum, freq=440.0, phase=0.0)
classmethod kr(bufnum, freq=440.0, phase=0.0)
class VOsc(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(bufpos, freq=440.0, phase=0.0)
classmethod kr(bufpos, freq=440.0, phase=0.0)
class VOsc3(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(bufpos, freq1=110.0, freq2=220.0, freq3=440.0)
classmethod kr(bufpos, freq1=110.0, freq2=220.0, freq3=440.0)
class COsc(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(bufnum, freq=440.0, beats=0.5)
classmethod kr(bufnum, freq=440.0, beats=0.5)
class Formant(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(fundfreq=440.0, formfreq=1760.0, bwfreq=880.0)
class LFSaw(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(freq=440.0, iphase=0.0)
classmethod kr(freq=440.0, iphase=0.0)
class LFPar(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.LFSaw

class LFCub(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.LFSaw

class LFTri(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.LFSaw

class LFGauss(*args, **kwargs)

Bases: sc3.synth.ugen.UGen

classmethod ar(duration=1, width=0.1, iphase=0.0, loop=1, done_action=0)
classmethod kr(duration=1, width=0.1, iphase=0.0, loop=1, done_action=0)
range(min=0, max=1)
class LFPulse(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(freq=440.0, iphase=0.0, width=0.5)
classmethod kr(freq=440.0, iphase=0.0, width=0.5)
classmethod signal_range()
class VarSaw(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(freq=440.0, iphase=0.0, width=0.5)
classmethod kr(freq=440.0, iphase=0.0, width=0.5)
class Impulse(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(freq=440.0, phase=0.0)
classmethod kr(freq=440.0, phase=0.0)
classmethod signal_range()
class SyncSaw(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(sync_freq=440.0, saw_freq=440.0)
classmethod kr(sync_freq=440.0, saw_freq=440.0)
class Index(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(bufnum, input=0.0)
classmethod kr(bufnum, input=0.0)
class WrapIndex(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.Index

class IndexInBetween(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.Index

class DetectIndex(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.Index

class Shaper(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.Index

class IndexL(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.Index

class DegreeToKey(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(bufnum, input=0.0, octave=12.0)
classmethod kr(bufnum, input=0.0, octave=12.0)
class Select(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(which, lst)
classmethod kr(which, lst)
class SelectX(*args, **kwargs)

Bases: sc3.synth.ugen.PseudoUGen

classmethod ar(which, lst, wrap=1)
classmethod kr(which, lst, wrap=1)
class LinSelectX(*args, **kwargs)

Bases: sc3.synth.ugens.oscillators.SelectX

class SelectXFocus(*args, **kwargs)

Bases: sc3.synth.ugen.PseudoUGen

classmethod new(which, lst, focus=1, wrap=False)
classmethod ar(which, lst, focus=1, wrap=False)
classmethod kr(which, lst, focus=1, wrap=False)
class Vibrato(*args, **kwargs)

Bases: sc3.synth.ugen.PureUGenMixin, sc3.synth.ugen.UGen

classmethod ar(freq=440.0, rate=6, depth=0.02, delay=0.0, onset=0.0, rate_variation=0.04, depth_variation=0.1, iphase=0.0, trig=0.0)
classmethod kr(freq=440.0, rate=6, depth=0.02, delay=0.0, onset=0.0, rate_variation=0.04, depth_variation=0.1, iphase=0.0, trig=0.0)
class TChoose(*args, **kwargs)

Bases: sc3.synth.ugen.PseudoUGen

classmethod ar(trig, lst)
classmethod kr(trig, lst)
class TWChoose(*args, **kwargs)

Bases: sc3.synth.ugen.PseudoUGen

classmethod ar(trig, lst, weights, normalize=0)
classmethod kr(trig, lst, weights, normalize=0)