Skip to content

Reference library > Oscillators > Impulse

Impulse

Impulse(frequency=1.0)

Produces a value of 1 at the given frequency, with output of 0 at all other times. If frequency is 0, produces a single impulse.

Examples

#-------------------------------------------------------------------------------
# Using an Impulse node as a clock to trigger an envelope once per second.
#-------------------------------------------------------------------------------
clock = Impulse(1.0)
osc = TriangleOscillator(250)
envelope = ASREnvelope(0.01, 0.0, 0.5, 1.0, clock)
output = StereoPanner(osc * envelope)
output.play()

Last update: 2024-02-15
Created: 2023-12-03