tone 14.8.27 → 14.8.28
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/component/analysis/Meter.test.ts +1 -1
- package/Tone/component/analysis/Meter.ts +3 -3
- package/Tone/component/channel/Recorder.ts +1 -1
- package/Tone/core/clock/Ticker.ts +0 -1
- package/Tone/core/context/BaseContext.ts +1 -1
- package/Tone/core/context/Context.test.ts +1 -1
- package/Tone/core/context/Context.ts +4 -0
- package/Tone/core/context/ToneAudioBuffer.ts +7 -1
- package/Tone/core/context/ToneAudioNode.ts +1 -1
- package/Tone/core/util/Debug.ts +1 -1
- package/Tone/effect/Distortion.test.ts +1 -1
- package/Tone/instrument/DuoSynth.ts +1 -1
- package/Tone/instrument/PolySynth.ts +2 -1
- package/Tone/source/OneShotSource.ts +2 -1
- package/Tone/version.ts +1 -1
- package/build/Tone.js +2 -21
- package/build/Tone.js.LICENSE.txt +6 -0
- package/build/Tone.js.map +1 -1
- package/build/esm/component/analysis/Meter.d.ts +1 -1
- package/build/esm/component/analysis/Meter.js +2 -2
- package/build/esm/component/analysis/Meter.js.map +1 -1
- package/build/esm/component/channel/Recorder.d.ts +1 -1
- package/build/esm/component/channel/Recorder.js.map +1 -1
- package/build/esm/core/clock/Ticker.js +0 -1
- package/build/esm/core/clock/Ticker.js.map +1 -1
- package/build/esm/core/context/Context.d.ts +4 -0
- package/build/esm/core/context/Context.js +4 -0
- package/build/esm/core/context/Context.js.map +1 -1
- package/build/esm/core/context/ToneAudioBuffer.js +5 -1
- package/build/esm/core/context/ToneAudioBuffer.js.map +1 -1
- package/build/esm/core/context/ToneAudioNode.js +0 -4
- package/build/esm/core/context/ToneAudioNode.js.map +1 -1
- package/build/esm/core/util/Debug.d.ts +1 -1
- package/build/esm/instrument/DuoSynth.js.map +1 -1
- package/build/esm/instrument/PolySynth.d.ts +1 -1
- package/build/esm/instrument/PolySynth.js.map +1 -1
- package/build/esm/source/OneShotSource.js +2 -1
- package/build/esm/source/OneShotSource.js.map +1 -1
- package/build/esm/version.js +1 -1
- package/docs/tone.json +1 -1
- package/package.json +24 -25
|
@@ -8,7 +8,7 @@ import { Analyser } from "./Analyser";
|
|
|
8
8
|
export interface MeterOptions extends MeterBaseOptions {
|
|
9
9
|
smoothing: NormalRange;
|
|
10
10
|
normalRange: boolean;
|
|
11
|
-
|
|
11
|
+
channelCount: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -59,7 +59,7 @@ export class Meter extends MeterBase<MeterOptions> {
|
|
|
59
59
|
context: this.context,
|
|
60
60
|
size: 256,
|
|
61
61
|
type: "waveform",
|
|
62
|
-
channels: options.
|
|
62
|
+
channels: options.channelCount,
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
this.smoothing = options.smoothing,
|
|
@@ -70,7 +70,7 @@ export class Meter extends MeterBase<MeterOptions> {
|
|
|
70
70
|
return Object.assign(MeterBase.getDefaults(), {
|
|
71
71
|
smoothing: 0.8,
|
|
72
72
|
normalRange: false,
|
|
73
|
-
|
|
73
|
+
channelCount: 1,
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -111,7 +111,7 @@ export class Recorder extends ToneAudioNode<RecorderOptions> {
|
|
|
111
111
|
*/
|
|
112
112
|
async start() {
|
|
113
113
|
assert(this.state !== "started", "Recorder is already started");
|
|
114
|
-
const startPromise = new Promise(done => {
|
|
114
|
+
const startPromise = new Promise<void>(done => {
|
|
115
115
|
const handleStart = () => {
|
|
116
116
|
this._recorder.removeEventListener("start", handleStart, false);
|
|
117
117
|
|
|
@@ -116,7 +116,7 @@ describe("Context", () => {
|
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
await context.resume();
|
|
119
|
-
await new Promise((done) => setTimeout(() => done(), 10));
|
|
119
|
+
await new Promise<void>((done) => setTimeout(() => done(), 10));
|
|
120
120
|
expect(triggerChange).to.equal(true);
|
|
121
121
|
context.dispose();
|
|
122
122
|
return ac.close();
|
|
@@ -463,6 +463,10 @@ export class Context extends BaseContext {
|
|
|
463
463
|
|
|
464
464
|
/**
|
|
465
465
|
* The current audio context time plus a short [[lookAhead]].
|
|
466
|
+
* @example
|
|
467
|
+
* setInterval(() => {
|
|
468
|
+
* console.log("now", Tone.now());
|
|
469
|
+
* }, 100);
|
|
466
470
|
*/
|
|
467
471
|
now(): Seconds {
|
|
468
472
|
return this._context.currentTime + this.lookAhead;
|
|
@@ -372,7 +372,13 @@ export class ToneAudioBuffer extends Tone {
|
|
|
372
372
|
|
|
373
373
|
// make sure there is a slash between the baseUrl and the url
|
|
374
374
|
const baseUrl = ToneAudioBuffer.baseUrl === "" || ToneAudioBuffer.baseUrl.endsWith("/") ? ToneAudioBuffer.baseUrl : ToneAudioBuffer.baseUrl + "/";
|
|
375
|
-
|
|
375
|
+
|
|
376
|
+
// encode special characters in file path
|
|
377
|
+
const location = document.createElement("a");
|
|
378
|
+
location.href = (baseUrl + url);
|
|
379
|
+
location.pathname = (location.pathname + location.hash).split("/").map(encodeURIComponent).join("/");
|
|
380
|
+
|
|
381
|
+
const response = await fetch(location.href);
|
|
376
382
|
if (!response.ok) {
|
|
377
383
|
throw new Error(`could not load url: ${url}`);
|
|
378
384
|
}
|
|
@@ -27,7 +27,7 @@ export abstract class ToneAudioNode<Options extends ToneAudioNodeOptions = ToneA
|
|
|
27
27
|
/**
|
|
28
28
|
* The name of the class
|
|
29
29
|
*/
|
|
30
|
-
abstract readonly name: string
|
|
30
|
+
abstract readonly name: string;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* The input node or nodes. If the object is a source,
|
package/Tone/core/util/Debug.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @param statement
|
|
4
4
|
* @param error The message which is passed into an Error
|
|
5
5
|
*/
|
|
6
|
-
export function assert(statement: boolean, error: string):
|
|
6
|
+
export function assert(statement: boolean, error: string): asserts statement {
|
|
7
7
|
if (!statement) {
|
|
8
8
|
throw new Error(error);
|
|
9
9
|
}
|
|
@@ -26,7 +26,8 @@ type VoiceOptions<T> =
|
|
|
26
26
|
T extends MonoSynth ? MonoSynthOptions :
|
|
27
27
|
T extends AMSynth ? AMSynthOptions :
|
|
28
28
|
T extends Synth ? SynthOptions :
|
|
29
|
-
|
|
29
|
+
T extends Monophonic<infer U> ? U :
|
|
30
|
+
never;
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* The settable synth options. excludes monophonic options.
|
package/Tone/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version: string = "14.8.
|
|
1
|
+
export const version: string = "14.8.28";
|