How to instantiate effect with a wet setting in tone.js?

Viewed 58

How do I instantiate an effect with a specific wet setting? I want to be able to create a new synth with updated effect parameters upon a range input change. However, I can't figure out how to make the wet/dry balance be anything but 100% wet. Is there a way to create an effect with a specific wet parameter? Something along the lines of newDelay = new Tone.PingPongDelay(.5,.5).wet(.5)? Or would I have to assign the effect to a variable and access it like newDelay.wet = .5 after instantiating it?

1 Answers

To create an effect with a specific wet property, you can pass your options as an object like so:

const delay = new Tone.PingPongDelay({wet: 0.5, delayTime: "8n", feedback: 0.5});

Most Tone.js effects have different properties for that "options" object. You can find their documentation under the Constructor heading in the docs.

For instance, here's the reference for PingPongDelayOptions.

Related