tone 15.4.1 → 15.4.3
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/effect/AutoPanner.test.ts +18 -0
- package/Tone/effect/AutoPanner.ts +30 -4
- package/Tone/effect/Effect.ts +1 -1
- package/Tone/version.ts +1 -1
- package/build/Tone.js +1 -1
- package/build/Tone.js.map +1 -1
- package/build/esm/effect/AutoPanner.d.ts +13 -3
- package/build/esm/effect/AutoPanner.js +20 -2
- package/build/esm/effect/AutoPanner.js.map +1 -1
- package/build/esm/effect/Effect.d.ts +1 -1
- package/build/esm/effect/Effect.js +1 -1
- package/build/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Frequency } from "../core/type/Units.js";
|
|
1
|
+
import { Frequency, NormalRange } from "../core/type/Units.js";
|
|
3
2
|
import { LFOEffect, LFOEffectOptions } from "./LFOEffect.js";
|
|
4
3
|
export interface AutoPannerOptions extends LFOEffectOptions {
|
|
5
4
|
channelCount: number;
|
|
5
|
+
width: NormalRange;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* AutoPanner is a {@link Panner} with an {@link LFO} connected to the pan amount.
|
|
@@ -20,12 +20,22 @@ export declare class AutoPanner extends LFOEffect<AutoPannerOptions> {
|
|
|
20
20
|
/**
|
|
21
21
|
* The filter node
|
|
22
22
|
*/
|
|
23
|
-
readonly _panner
|
|
23
|
+
private readonly _panner;
|
|
24
|
+
private _width;
|
|
24
25
|
/**
|
|
25
26
|
* @param frequency Rate of left-right oscillation.
|
|
26
27
|
*/
|
|
27
28
|
constructor(frequency?: Frequency);
|
|
28
29
|
constructor(options?: Partial<AutoPannerOptions>);
|
|
29
30
|
static getDefaults(): AutoPannerOptions;
|
|
31
|
+
/**
|
|
32
|
+
* Updates the LFO min/max based on width
|
|
33
|
+
*/
|
|
34
|
+
private _updateLFORange;
|
|
35
|
+
/**
|
|
36
|
+
* The width of the panning effect. 0 = no panning, 1 = full left-right panning.
|
|
37
|
+
*/
|
|
38
|
+
get width(): NormalRange;
|
|
39
|
+
set width(width: NormalRange);
|
|
30
40
|
dispose(): this;
|
|
31
41
|
}
|
|
@@ -21,17 +21,35 @@ export class AutoPanner extends LFOEffect {
|
|
|
21
21
|
context: this.context,
|
|
22
22
|
channelCount: options.channelCount,
|
|
23
23
|
});
|
|
24
|
+
this._width = options.width;
|
|
24
25
|
// connections
|
|
25
26
|
this.connectEffect(this._panner);
|
|
26
27
|
this._lfo.connect(this._panner.pan);
|
|
27
|
-
this.
|
|
28
|
-
this._lfo.max = 1;
|
|
28
|
+
this._updateLFORange();
|
|
29
29
|
}
|
|
30
30
|
static getDefaults() {
|
|
31
31
|
return Object.assign(LFOEffect.getDefaults(), {
|
|
32
32
|
channelCount: 1,
|
|
33
|
+
width: 1,
|
|
33
34
|
});
|
|
34
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Updates the LFO min/max based on width
|
|
38
|
+
*/
|
|
39
|
+
_updateLFORange() {
|
|
40
|
+
this._lfo.min = -this._width;
|
|
41
|
+
this._lfo.max = this._width;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The width of the panning effect. 0 = no panning, 1 = full left-right panning.
|
|
45
|
+
*/
|
|
46
|
+
get width() {
|
|
47
|
+
return this._width;
|
|
48
|
+
}
|
|
49
|
+
set width(width) {
|
|
50
|
+
this._width = width;
|
|
51
|
+
this._updateLFORange();
|
|
52
|
+
}
|
|
35
53
|
dispose() {
|
|
36
54
|
super.dispose();
|
|
37
55
|
this._panner.dispose();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoPanner.js","sourceRoot":"","sources":["../../../Tone/effect/AutoPanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO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AAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,IAAI,KAAK,CAAC,KAAkB;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,eAAe,EAAE,CAAC;IACxB,CAAC;IAED,OAAO;QACN,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -24,7 +24,7 @@ export declare abstract class Effect<Options extends EffectOptions> extends Tone
|
|
|
24
24
|
*/
|
|
25
25
|
wet: Signal<"normalRange">;
|
|
26
26
|
/**
|
|
27
|
-
* connect the effectSend to the input of
|
|
27
|
+
* connect the effectSend to the input of the effect
|
|
28
28
|
*/
|
|
29
29
|
protected effectSend: Gain;
|
|
30
30
|
/**
|
|
@@ -22,7 +22,7 @@ export class Effect extends ToneAudioNode {
|
|
|
22
22
|
*/
|
|
23
23
|
this.wet = this._dryWet.fade;
|
|
24
24
|
/**
|
|
25
|
-
* connect the effectSend to the input of
|
|
25
|
+
* connect the effectSend to the input of the effect
|
|
26
26
|
*/
|
|
27
27
|
this.effectSend = new Gain({ context: this.context });
|
|
28
28
|
/**
|
package/build/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "15.4.
|
|
1
|
+
export const version = "15.4.3";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|