smplr 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2256,7 +2256,17 @@ var SplendidGrandPiano = class {
|
|
|
2256
2256
|
return this.player.start(sample);
|
|
2257
2257
|
}
|
|
2258
2258
|
stop(sample) {
|
|
2259
|
-
|
|
2259
|
+
var _a;
|
|
2260
|
+
if (typeof sample === "string") {
|
|
2261
|
+
return this.player.stop((_a = toMidi(sample)) != null ? _a : sample);
|
|
2262
|
+
} else if (typeof sample === "object") {
|
|
2263
|
+
const midi = toMidi(sample.stopId);
|
|
2264
|
+
return this.player.stop(
|
|
2265
|
+
midi !== void 0 ? __spreadProps(__spreadValues({}, sample), { stopId: midi }) : sample
|
|
2266
|
+
);
|
|
2267
|
+
} else {
|
|
2268
|
+
return this.player.stop(sample);
|
|
2269
|
+
}
|
|
2260
2270
|
}
|
|
2261
2271
|
};
|
|
2262
2272
|
_SplendidGrandPiano_instances = new WeakSet();
|
|
@@ -2288,7 +2298,9 @@ function splendidGrandPianoLoader(baseUrl, storage, notesToLoad) {
|
|
|
2288
2298
|
) : LAYERS;
|
|
2289
2299
|
return (context, buffers) => __async(this, null, function* () {
|
|
2290
2300
|
for (const layer of layers) {
|
|
2291
|
-
const samples = notesToLoad ? layer.samples.filter(
|
|
2301
|
+
const samples = notesToLoad ? layer.samples.filter(
|
|
2302
|
+
(sample) => notesToLoad.notes.includes(sample[0])
|
|
2303
|
+
) : layer.samples;
|
|
2292
2304
|
yield Promise.all(
|
|
2293
2305
|
samples.map((_0) => __async(this, [_0], function* ([midi, name]) {
|
|
2294
2306
|
const url = `${baseUrl}/${name}.${format}`;
|