EX / Hz.Plugins / Hz.ADSR

Right-click to copy examples to your workspace


Intro

This example is the same as one found here.

adsr.js (snippet)

// Oscillator with built-in ADSR inactive to show side-chaining.
let id = `t${this.GetId()}`;
let scene = await Ascene.BeginFiber(this);
let osc = scene.NewAnode("Hz.Osc", {name:"osc", cfg: "mono"});
let adsr = scene.NewAnode("Hz.ADSR", {name:"adsr"});
let mix = scene.NewAnode("Hz.Mix", {name:"Mix", cfg: "1to2"});
scene.Chain(osc, mix, scene.GetDAC()); // clean
scene.Chain([adsr,0,1], mix); // connect adsr to mix's "sidechain"
await scene.Sync();
scene.VisualizeGraph();
osc.SetParam("/adsr/Active", 0); // deactivate built-in ADSR

See Also

Reference: Hz.Mix, Hz.ADSR, Hz.Osc

home .. topics .. interface .. reference .. examples .. tipjar