An implementation of the classic four pole with feedback structure. Cutoff is mapped to incoming MIDI CC. Resonance is controlled with the gain of the inverting input on the sum stage which should stay between 0 and 4. It could be bound to a separate CC in an enhanced version.

This approach could easily be extended to other classic filter topologies.

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

z.set_divisor(z.CLOCK_SYS1, 6)

osc = z.OscillatorTriSqr(
oscillation_frequency=0.044
)
osc.set_clock(z.CLOCK3)

sum = z.SumTwo()
sum.set_clock(z.CLOCK3)
sum.input2_polarity = z.INVERTING
sum.gain_input2 = 1.75

osc.square.connect(sum.input1)

poles = [
z.FilterLowpass(
corner_frequency=1,
gain=1.0)
for i in range(4)]

for pole in poles:
pole.set_clock(z.CLOCK3)
pole.corner_frequency.listen(
midi=z.CC,
min=0.1,
max=5)

audio_out = z.AudioOut()
z.run()