Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.41k stars 976 forks source link

Uncaught Error: Tone.Sampler: url keys must be the note's pitch using sampler #885

Closed Poliuti closed 3 years ago

Poliuti commented 3 years ago

HI, when i run this code

const sampler = new Tone.Sampler({ urls: { C2: "kick.mp3", D2: "snare.mp3", E2: "hihat.mp3", }, release: 1, baseUrl: "https://tonejs.github.io/audio/drum-samples/CR78/", }).toDestination();

I get the following error

Uncaught Error: Tone.Sampler: url keys must be the note's pitch

I looked at forums and other issues but I didn't find anything, do you have any idea to solve it? Thank you in advance

tambien commented 3 years ago

I'm unable to recreate this error. Here's an example with the code copied from your issue: https://codesandbox.io/s/sampler-keys-bg564

codenickycode commented 3 years ago

Hi @Poliuti ✋

Are you programmatically adding urls to the sampler anywhere else or is this the only place you configure the sampler?

tambien commented 3 years ago

Closing bc of inactivity.