Simple Synth

Detuned sawtooth oscillators and a 2-pole filter.

import zrna
z = zrna.api.Client()
z.connect()
z.clear()

osc1 = z.OscillatorSaw(
    oscillation_frequency=0.110,
    peak_amplitude=1.0
)

osc2 = z.OscillatorSaw(
    oscillation_frequency=0.1656,
    peak_amplitude=1.0
)

sum = z.SumTwo()

lpf = z.FilterBiquadLowpass(
    corner_frequency=1,
    gain=0.25,
    quality_factor=5
)

audio_out = z.AudioOut()
z.add(audio_out)

for module in [osc1, osc2, sum, lpf]:
    module.set_clock(z.CLOCK3)
    z.add(module)

lpf.corner_frequency.listen(
    midi=z.CC,
    min=0.125,
    max=2)

osc1.saw.connect(sum.input1)
osc2.saw.connect(sum.input2)

sum.output.connect(lpf.input)

lpf.output.connect(audio_out.input)

z.set_divisor(z.CLOCK_SYS1, 4)

z.run()

Privacy

© 2019 Zrna Research