2

I'm using the following code from this documentation:

const sampler = new Tone.Sampler({
    urls: {
        A1: "one.mp3",
        A2: "two.mp3",
    },
    baseUrl: "https://example.com/",
    onload: () => {
        sampler.triggerAttackRelease(["A1", "A2"], 0.5);
    }
}).toDestination();

I want to be able to replace note A1 with another mp3 file, after the onload function is called. Is there a way to do that? If not, what's a recommended approach (e.g. create a new sampler)?

mark mark
  • 306
  • 2
  • 13

0 Answers0