Super useful tool in learning timbre: https://learningsynths.ableton.com/en/get-started
let osc = new Tone.Oscillator(440,"sine").toDestination();
var ampEnv = new Tone.AmplitudeEnvelope({
"attack": 0.1,
"decay": 0.2,
"sustain": 1.0,
"release": 0.8
})
//create an oscillator and connect it
var osc = new Tone.Oscillator().connect(ampEnv).toDestination();
osc.triggerAttack();
var sampler = new Tone.Sampler({
"C3" : "path/to/C3.mp3",
"A3" : "path/to/A3.mp3" //the more reference soundtrack provided, the more accurate
}, function(){
//sampler will repitch the closest sample
sampler.triggerAttack("D3")
})
let aFilter = new Tone.Filter(200, "highpass");
aFilter.toDestiniation();
osc.connect(ampEnv);
ampEnv.connect(aFilter);