tone 15.2.6 → 15.2.8
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/Tone/instrument/Sampler.test.ts +93 -0
- package/Tone/instrument/Sampler.ts +131 -3
- package/Tone/version.ts +1 -1
- package/build/Tone.js +1 -1
- package/build/Tone.js.map +1 -1
- package/build/esm/instrument/Sampler.d.ts +56 -0
- package/build/esm/instrument/Sampler.js +107 -3
- package/build/esm/instrument/Sampler.js.map +1 -1
- package/build/esm/version.js +1 -1
- package/package.json +11 -13
|
@@ -14,6 +14,9 @@ export interface SamplerOptions extends InstrumentOptions {
|
|
|
14
14
|
baseUrl: string;
|
|
15
15
|
curve: ToneBufferSourceCurve;
|
|
16
16
|
urls: SamplesMap;
|
|
17
|
+
loop: boolean;
|
|
18
|
+
loopEnd: number;
|
|
19
|
+
loopStart: number;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* Pass in an object which maps the note's pitch or midi value to the url,
|
|
@@ -46,6 +49,22 @@ export declare class Sampler extends Instrument<SamplerOptions> {
|
|
|
46
49
|
* The object of all currently playing BufferSources
|
|
47
50
|
*/
|
|
48
51
|
private _activeSources;
|
|
52
|
+
/**
|
|
53
|
+
* The list of all provided midi notes
|
|
54
|
+
*/
|
|
55
|
+
private _providedMidiNotes;
|
|
56
|
+
/**
|
|
57
|
+
* if the buffer should loop once its over
|
|
58
|
+
*/
|
|
59
|
+
private _loop;
|
|
60
|
+
/**
|
|
61
|
+
* if 'loop' is true, the loop will start at this position
|
|
62
|
+
*/
|
|
63
|
+
private _loopStart;
|
|
64
|
+
/**
|
|
65
|
+
* if 'loop' is true, the loop will end at this position
|
|
66
|
+
*/
|
|
67
|
+
private _loopEnd;
|
|
49
68
|
/**
|
|
50
69
|
* The envelope applied to the beginning of the sample.
|
|
51
70
|
* @min 0
|
|
@@ -118,6 +137,43 @@ export declare class Sampler extends Instrument<SamplerOptions> {
|
|
|
118
137
|
* If the buffers are loaded or not
|
|
119
138
|
*/
|
|
120
139
|
get loaded(): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Set the loop start and end. Will only loop if loop is set to true.
|
|
142
|
+
* @param loopStart The loop start time
|
|
143
|
+
* @param loopEnd The loop end time
|
|
144
|
+
* @example
|
|
145
|
+
* const sampler = new Tone.Sampler({
|
|
146
|
+
* urls: {
|
|
147
|
+
* A1: "https://tonejs.github.io/audio/berklee/guitar_chord4.mp3",
|
|
148
|
+
* },
|
|
149
|
+
* }).toDestination();
|
|
150
|
+
* // loop between the given points
|
|
151
|
+
* sampler.setLoopPoints(0.2, 0.3);
|
|
152
|
+
* sampler.loop = true;
|
|
153
|
+
*/
|
|
154
|
+
setLoopPoints(loopStart: Time, loopEnd: Time): this;
|
|
155
|
+
/**
|
|
156
|
+
* If loop is true, the loop will start at this position.
|
|
157
|
+
*/
|
|
158
|
+
get loopStart(): Time;
|
|
159
|
+
set loopStart(loopStart: Time);
|
|
160
|
+
/**
|
|
161
|
+
* If loop is true, the loop will end at this position.
|
|
162
|
+
*/
|
|
163
|
+
get loopEnd(): Time;
|
|
164
|
+
set loopEnd(loopEnd: Time);
|
|
165
|
+
/**
|
|
166
|
+
* If the buffers should loop once they are over.
|
|
167
|
+
* @example
|
|
168
|
+
* const sampler = new Tone.Sampler({
|
|
169
|
+
* urls: {
|
|
170
|
+
* A4: "https://tonejs.github.io/audio/berklee/femalevoice_aa_A4.mp3",
|
|
171
|
+
* },
|
|
172
|
+
* }).toDestination();
|
|
173
|
+
* sampler.loop = true;
|
|
174
|
+
*/
|
|
175
|
+
get loop(): boolean;
|
|
176
|
+
set loop(loop: boolean);
|
|
121
177
|
/**
|
|
122
178
|
* Clean up
|
|
123
179
|
*/
|
|
@@ -2,9 +2,9 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { ToneAudioBuffers } from "../core/context/ToneAudioBuffers.js";
|
|
3
3
|
import { ftomf, intervalToFrequencyRatio } from "../core/type/Conversions.js";
|
|
4
4
|
import { FrequencyClass } from "../core/type/Frequency.js";
|
|
5
|
-
import { assert } from "../core/util/Debug.js";
|
|
5
|
+
import { assert, assertRange } from "../core/util/Debug.js";
|
|
6
6
|
import { timeRange } from "../core/util/Decorator.js";
|
|
7
|
-
import { optionsFromArguments } from "../core/util/Defaults.js";
|
|
7
|
+
import { defaultArg, optionsFromArguments } from "../core/util/Defaults.js";
|
|
8
8
|
import { noOp } from "../core/util/Interface.js";
|
|
9
9
|
import { isArray, isNote, isNumber } from "../core/util/TypeCheck.js";
|
|
10
10
|
import { Instrument } from "../instrument/Instrument.js";
|
|
@@ -39,6 +39,10 @@ export class Sampler extends Instrument {
|
|
|
39
39
|
* The object of all currently playing BufferSources
|
|
40
40
|
*/
|
|
41
41
|
this._activeSources = new Map();
|
|
42
|
+
/**
|
|
43
|
+
* The list of all provided midi notes
|
|
44
|
+
*/
|
|
45
|
+
this._providedMidiNotes = [];
|
|
42
46
|
const urlMap = {};
|
|
43
47
|
Object.keys(options.urls).forEach((note) => {
|
|
44
48
|
const noteNumber = parseInt(note, 10);
|
|
@@ -62,6 +66,9 @@ export class Sampler extends Instrument {
|
|
|
62
66
|
this.attack = options.attack;
|
|
63
67
|
this.release = options.release;
|
|
64
68
|
this.curve = options.curve;
|
|
69
|
+
this._loop = options.loop;
|
|
70
|
+
this._loopStart = options.loopStart;
|
|
71
|
+
this._loopEnd = options.loopEnd;
|
|
65
72
|
// invoke the callback if it's already loaded
|
|
66
73
|
if (this._buffers.loaded) {
|
|
67
74
|
// invoke onload deferred
|
|
@@ -77,6 +84,9 @@ export class Sampler extends Instrument {
|
|
|
77
84
|
onerror: noOp,
|
|
78
85
|
release: 0.1,
|
|
79
86
|
urls: {},
|
|
87
|
+
loop: false,
|
|
88
|
+
loopEnd: 0,
|
|
89
|
+
loopStart: 0,
|
|
80
90
|
});
|
|
81
91
|
}
|
|
82
92
|
/**
|
|
@@ -108,6 +118,7 @@ export class Sampler extends Instrument {
|
|
|
108
118
|
if (!Array.isArray(notes)) {
|
|
109
119
|
notes = [notes];
|
|
110
120
|
}
|
|
121
|
+
const offset = defaultArg(this._loopStart, 0);
|
|
111
122
|
notes.forEach((note) => {
|
|
112
123
|
const midiFloat = ftomf(new FrequencyClass(this.context, note).toFrequency());
|
|
113
124
|
const midi = Math.round(midiFloat);
|
|
@@ -117,6 +128,9 @@ export class Sampler extends Instrument {
|
|
|
117
128
|
const closestNote = midi - difference;
|
|
118
129
|
const buffer = this._buffers.get(closestNote);
|
|
119
130
|
const playbackRate = intervalToFrequencyRatio(difference + remainder);
|
|
131
|
+
const duration = this._loop
|
|
132
|
+
? undefined
|
|
133
|
+
: buffer.duration / playbackRate;
|
|
120
134
|
// play that note
|
|
121
135
|
const source = new ToneBufferSource({
|
|
122
136
|
url: buffer,
|
|
@@ -124,9 +138,12 @@ export class Sampler extends Instrument {
|
|
|
124
138
|
curve: this.curve,
|
|
125
139
|
fadeIn: this.attack,
|
|
126
140
|
fadeOut: this.release,
|
|
141
|
+
loop: this._loop,
|
|
142
|
+
loopStart: this._loopStart,
|
|
143
|
+
loopEnd: this._loopEnd,
|
|
127
144
|
playbackRate,
|
|
128
145
|
}).connect(this.output);
|
|
129
|
-
source.start(time,
|
|
146
|
+
source.start(time, offset, duration, velocity);
|
|
130
147
|
// add it to the active sources
|
|
131
148
|
if (!isArray(this._activeSources.get(midi))) {
|
|
132
149
|
this._activeSources.set(midi, []);
|
|
@@ -237,6 +254,93 @@ export class Sampler extends Instrument {
|
|
|
237
254
|
get loaded() {
|
|
238
255
|
return this._buffers.loaded;
|
|
239
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Set the loop start and end. Will only loop if loop is set to true.
|
|
259
|
+
* @param loopStart The loop start time
|
|
260
|
+
* @param loopEnd The loop end time
|
|
261
|
+
* @example
|
|
262
|
+
* const sampler = new Tone.Sampler({
|
|
263
|
+
* urls: {
|
|
264
|
+
* A1: "https://tonejs.github.io/audio/berklee/guitar_chord4.mp3",
|
|
265
|
+
* },
|
|
266
|
+
* }).toDestination();
|
|
267
|
+
* // loop between the given points
|
|
268
|
+
* sampler.setLoopPoints(0.2, 0.3);
|
|
269
|
+
* sampler.loop = true;
|
|
270
|
+
*/
|
|
271
|
+
setLoopPoints(loopStart, loopEnd) {
|
|
272
|
+
this.loopStart = loopStart;
|
|
273
|
+
this.loopEnd = loopEnd;
|
|
274
|
+
return this;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* If loop is true, the loop will start at this position.
|
|
278
|
+
*/
|
|
279
|
+
get loopStart() {
|
|
280
|
+
return this._loopStart;
|
|
281
|
+
}
|
|
282
|
+
set loopStart(loopStart) {
|
|
283
|
+
this._loopStart = loopStart;
|
|
284
|
+
this._providedMidiNotes.forEach((midiNote) => {
|
|
285
|
+
const buffer = this._buffers.get(midiNote);
|
|
286
|
+
if (buffer.loaded) {
|
|
287
|
+
assertRange(this.toSeconds(loopStart), 0, buffer.duration);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
// get the current sources
|
|
291
|
+
this._activeSources.forEach((sourceList) => {
|
|
292
|
+
sourceList.forEach((source) => {
|
|
293
|
+
source.loopStart = loopStart;
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* If loop is true, the loop will end at this position.
|
|
299
|
+
*/
|
|
300
|
+
get loopEnd() {
|
|
301
|
+
return this._loopEnd;
|
|
302
|
+
}
|
|
303
|
+
set loopEnd(loopEnd) {
|
|
304
|
+
this._loopEnd = loopEnd;
|
|
305
|
+
this._providedMidiNotes.forEach((midiNote) => {
|
|
306
|
+
const buffer = this._buffers.get(midiNote);
|
|
307
|
+
if (buffer.loaded) {
|
|
308
|
+
assertRange(this.toSeconds(loopEnd), 0, buffer.duration);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
// get the current sources
|
|
312
|
+
this._activeSources.forEach((sourceList) => {
|
|
313
|
+
sourceList.forEach((source) => {
|
|
314
|
+
source.loopEnd = loopEnd;
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* If the buffers should loop once they are over.
|
|
320
|
+
* @example
|
|
321
|
+
* const sampler = new Tone.Sampler({
|
|
322
|
+
* urls: {
|
|
323
|
+
* A4: "https://tonejs.github.io/audio/berklee/femalevoice_aa_A4.mp3",
|
|
324
|
+
* },
|
|
325
|
+
* }).toDestination();
|
|
326
|
+
* sampler.loop = true;
|
|
327
|
+
*/
|
|
328
|
+
get loop() {
|
|
329
|
+
return this._loop;
|
|
330
|
+
}
|
|
331
|
+
set loop(loop) {
|
|
332
|
+
// if no change, do nothing
|
|
333
|
+
if (this._loop === loop) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
this._loop = loop;
|
|
337
|
+
// set the loop of all of the sources
|
|
338
|
+
this._activeSources.forEach((sourceList) => {
|
|
339
|
+
sourceList.forEach((source) => {
|
|
340
|
+
source.loop = loop;
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
}
|
|
240
344
|
/**
|
|
241
345
|
* Clean up
|
|
242
346
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sampler.js","sourceRoot":"","sources":["../../../Tone/instrument/Sampler.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Sampler.js","sourceRoot":"","sources":["../../../Tone/instrument/Sampler.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAA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AAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA9YA;IADC,SAAS,CAAC,CAAC,CAAC;uCACA;AAQb;IADC,SAAS,CAAC,CAAC,CAAC;wCACC"}
|
package/build/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "15.2.
|
|
1
|
+
export const version = "15.2.8";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tone",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.8",
|
|
4
4
|
"description": "A Web Audio framework for making interactive music in the browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/esm/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"Tone"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"remove": "node -e \"fs.rmSync('./build', { recursive: true, force: true })\"",
|
|
19
|
+
"build": "npm run increment && npm run remove && npm run ts:build && npm run webpack:build",
|
|
20
20
|
"docs:json": "typedoc --options \"./scripts/typedoc.json\" --json \"./docs/tone.json\"",
|
|
21
21
|
"increment": "node scripts/increment_version.cjs",
|
|
22
22
|
"lint": "tsc --noEmit && eslint ./Tone",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"scratch": "webpack serve --env scratch=1 --mode=development --config ./scripts/webpack.config.cjs",
|
|
26
26
|
"spellcheck": "cspell --config ./scripts/cspell.json ./Tone ./test/**/*.ts ./examples/**/*.html",
|
|
27
27
|
"test": "tsc && web-test-runner --config=./test/web-test-runner.config.js --coverage",
|
|
28
|
-
"test:examples": "node ./test/scripts/test_examples.
|
|
29
|
-
"test:html": "node ./test/scripts/test_html.
|
|
28
|
+
"test:examples": "node ./test/scripts/test_examples.mjs",
|
|
29
|
+
"test:html": "node ./test/scripts/test_html.mjs",
|
|
30
30
|
"test:integrations": "zx ./test/scripts/test_integrations.mjs",
|
|
31
|
-
"test:readme": "node ./test/scripts/test_readme.
|
|
31
|
+
"test:readme": "node ./test/scripts/test_readme.mjs",
|
|
32
32
|
"test:watch": "tsc && concurrently --raw \"tsc -w\" \"web-test-runner --config=./test/web-test-runner.config.js --watch\"",
|
|
33
33
|
"ts:build": "tsc --project ./scripts/tsconfig.build.json",
|
|
34
34
|
"watch": "tsc --watch",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"url": "https://github.com/Tonejs/Tone.js/issues"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@rollup/plugin-commonjs": "^
|
|
58
|
+
"@rollup/plugin-commonjs": "^26.0.3",
|
|
59
59
|
"@stylistic/eslint-plugin-js": "^4.2.0",
|
|
60
60
|
"@stylistic/eslint-plugin-ts": "^4.2.0",
|
|
61
61
|
"@types/chai": "^4.3.0",
|
|
@@ -77,20 +77,18 @@
|
|
|
77
77
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
78
78
|
"fft-windowing": "^0.1.4",
|
|
79
79
|
"fourier-transform": "^1.1.2",
|
|
80
|
-
"fs-
|
|
81
|
-
"glob": "^10.3.12",
|
|
80
|
+
"fs-fixture": "^2.7.1",
|
|
82
81
|
"html-webpack-plugin": "^5.6.3",
|
|
83
82
|
"http-server": "^13.0.2",
|
|
84
|
-
"jsdom": "^
|
|
83
|
+
"jsdom": "^26.1.0",
|
|
84
|
+
"marked": "^15.0.12",
|
|
85
85
|
"mocha": "^11.1.0",
|
|
86
86
|
"plotly.js-dist": "^2.32.0",
|
|
87
87
|
"prettier": "^3.2.5",
|
|
88
88
|
"puppeteer": "^24.2.1",
|
|
89
|
-
"rimraf": "^5.0.5",
|
|
90
89
|
"semver": "^5.7.1",
|
|
91
|
-
"showdown": "^2.1.0",
|
|
92
90
|
"teoria": "^2.5.0",
|
|
93
|
-
"
|
|
91
|
+
"tinyglobby": "^0.2.14",
|
|
94
92
|
"tonal": "^6.0.1",
|
|
95
93
|
"ts-loader": "^9.5.1",
|
|
96
94
|
"typedoc": "^0.25.13",
|