Chapter 6 of 10
Instruments — audio & MIDI
Companion lab · Read full chapter in the guide →
Stack MIDI → envelope → oscillator → filter → master gain inside renderDevice(), then wax.render.
In this lab you will
- Combine the MIDI voice path with an oscillator and filter
- Sum poly voices and set master gain
- Re-render when knobs change (stable
wax.constkeys)
Minimal pattern
const osc = wax.blepsaw(wax.latch(trigger, frequency));
const tone = wax.mul(ampEnv, wax.mul(velocity, osc));
const out = wax.mul(wax.const({ key: "master", value: master }), tone);
wax.render(out, out);
Try it
Example code
Loading…