@fluex/fluexgl-dsp 0.2.2 → 0.3.0
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/lib/dist/effects/classes/Filter.d.ts +3 -0
- package/lib/dist/effects/classes/Filter.d.ts.map +1 -0
- package/lib/dist/effects/classes/Filter.js +2 -0
- package/lib/dist/effects/classes/SoftClip.d.ts +1 -4
- package/lib/dist/effects/classes/SoftClip.d.ts.map +1 -1
- package/lib/dist/effects/classes/SoftClip.js +2 -17
- package/lib/dist/effects/classes/clips/HardClip.d.ts +14 -0
- package/lib/dist/effects/classes/clips/HardClip.d.ts.map +1 -0
- package/lib/dist/effects/classes/clips/HardClip.js +32 -0
- package/lib/dist/effects/classes/clips/SoftClip.d.ts +14 -0
- package/lib/dist/effects/classes/clips/SoftClip.d.ts.map +1 -0
- package/lib/dist/effects/classes/clips/SoftClip.js +32 -0
- package/lib/dist/effects/classes/filters/LowPassFilter.d.ts +1 -1
- package/lib/dist/effects/classes/filters/LowPassFilter.d.ts.map +1 -1
- package/lib/dist/effects/exports.d.ts +1 -1
- package/lib/dist/effects/exports.d.ts.map +1 -1
- package/lib/dist/effects/exports.js +1 -1
- package/lib/dist/index.d.ts +1 -1
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/typings.d.ts +21 -3
- package/lib/dist/typings.d.ts.map +1 -1
- package/lib/dist/typings.js +13 -0
- package/lib/src/effects/classes/clips/HardClip.ts +41 -0
- package/lib/src/effects/classes/clips/SoftClip.ts +41 -0
- package/lib/src/effects/classes/filters/LowPassFilter.ts +2 -1
- package/lib/src/effects/exports.ts +1 -1
- package/lib/src/index.ts +5 -1
- package/lib/src/typings.ts +29 -3
- package/package.json +1 -1
- package/lib/src/effects/classes/SoftClip.ts +0 -61
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../../src/effects/classes/Filter.ts"],"names":[],"mappings":"AAAA,qBAAa,MAAM;CAAG"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { Effector } from "../../core/classes/Effector";
|
|
2
2
|
export declare class SoftClip extends Effector {
|
|
3
3
|
drive: number;
|
|
4
|
-
gain: number;
|
|
5
4
|
label: string | null;
|
|
6
5
|
name: string;
|
|
7
|
-
constructor(drive?: number
|
|
6
|
+
constructor(drive?: number);
|
|
8
7
|
InitializeOnAttachment(parentialContext: AudioContext): Promise<void>;
|
|
9
8
|
SetDrive(drive: number): SoftClip;
|
|
10
|
-
GetDrive(): number;
|
|
11
|
-
SetGain(gain: number): SoftClip;
|
|
12
9
|
}
|
|
13
10
|
//# sourceMappingURL=SoftClip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SoftClip.d.ts","sourceRoot":"","sources":["../../../src/effects/classes/SoftClip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD,qBAAa,QAAS,SAAQ,QAAQ;IAKf,KAAK,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"SoftClip.d.ts","sourceRoot":"","sources":["../../../src/effects/classes/SoftClip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD,qBAAa,QAAS,SAAQ,QAAQ;IAKf,KAAK,EAAE,MAAM;IAHzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAc;IAClC,IAAI,EAAE,MAAM,CAAc;gBAEd,KAAK,GAAE,MAAU;IAIvB,sBAAsB,CAAC,gBAAgB,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB3E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ;CAU3C"}
|
|
@@ -3,13 +3,11 @@ import { Effector } from "../../core/classes/Effector";
|
|
|
3
3
|
import { Debug } from "../../utilities/debugger";
|
|
4
4
|
export class SoftClip extends Effector {
|
|
5
5
|
drive;
|
|
6
|
-
gain;
|
|
7
6
|
label = "SoftClip";
|
|
8
7
|
name = "SoftClip";
|
|
9
|
-
constructor(drive = 1
|
|
8
|
+
constructor(drive = 1) {
|
|
10
9
|
super();
|
|
11
10
|
this.drive = drive;
|
|
12
|
-
this.gain = gain;
|
|
13
11
|
}
|
|
14
12
|
async InitializeOnAttachment(parentialContext) {
|
|
15
13
|
if (!compiledWebAssemblyModule)
|
|
@@ -21,8 +19,7 @@ export class SoftClip extends Effector {
|
|
|
21
19
|
numberOfOutputs: 1,
|
|
22
20
|
outputChannelCount: [2],
|
|
23
21
|
parameterData: {
|
|
24
|
-
drive: this.drive
|
|
25
|
-
gain: this.gain
|
|
22
|
+
drive: this.drive
|
|
26
23
|
},
|
|
27
24
|
processorOptions: {
|
|
28
25
|
module: compiledWebAssemblyModule
|
|
@@ -39,16 +36,4 @@ export class SoftClip extends Effector {
|
|
|
39
36
|
this.drive = drive;
|
|
40
37
|
return this;
|
|
41
38
|
}
|
|
42
|
-
GetDrive() {
|
|
43
|
-
return this.drive;
|
|
44
|
-
}
|
|
45
|
-
SetGain(gain) {
|
|
46
|
-
if (this.audioWorkletNode)
|
|
47
|
-
this.audioWorkletNode.port.postMessage({
|
|
48
|
-
type: "set-gain",
|
|
49
|
-
value: gain
|
|
50
|
-
});
|
|
51
|
-
this.gain = gain;
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
39
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Effector } from "../../../core/classes/Effector";
|
|
2
|
+
import { HardClipOptions } from "../../../typings";
|
|
3
|
+
export declare class HardClip extends Effector {
|
|
4
|
+
label: string | null;
|
|
5
|
+
name: string;
|
|
6
|
+
drive: number;
|
|
7
|
+
gain: number;
|
|
8
|
+
constructor({ drive, gain }: Partial<HardClipOptions>);
|
|
9
|
+
InitializeOnAttachment(parentialContext: AudioContext): Promise<void>;
|
|
10
|
+
ReturnOptionsAsObject(): HardClipOptions;
|
|
11
|
+
SetDrive(drive: number): boolean;
|
|
12
|
+
SetGain(gain: number): boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=HardClip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HardClip.d.ts","sourceRoot":"","sources":["../../../../src/effects/classes/clips/HardClip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAwD,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEzG,qBAAa,QAAS,SAAQ,QAAQ;IAE3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAc;IAClC,IAAI,EAAE,MAAM,CAAc;IAE1B,KAAK,EAAE,MAAM,CAAK;IAClB,IAAI,EAAE,MAAM,CAAK;gBAEZ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,eAAe,CAAC;IAOxC,sBAAsB,CAAC,gBAAgB,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3E,qBAAqB,IAAI,eAAe;IAOvC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAKjC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAIxC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Effector } from "../../../core/classes/Effector";
|
|
2
|
+
import { CreateAudioWorkletNode, SendMessageToWorklet } from "../../../utilities/helpers";
|
|
3
|
+
import { HardClipMessageCommandId, AudioWorkletProcessorNames } from "../../../typings";
|
|
4
|
+
export class HardClip extends Effector {
|
|
5
|
+
label = "HardClip";
|
|
6
|
+
name = "HardClip";
|
|
7
|
+
drive = 1;
|
|
8
|
+
gain = 1;
|
|
9
|
+
constructor({ drive, gain }) {
|
|
10
|
+
super();
|
|
11
|
+
this.drive = drive ?? this.drive;
|
|
12
|
+
this.gain = gain ?? this.gain;
|
|
13
|
+
}
|
|
14
|
+
async InitializeOnAttachment(parentialContext) {
|
|
15
|
+
this.parentialContext = parentialContext;
|
|
16
|
+
this.audioWorkletNode = CreateAudioWorkletNode(parentialContext, AudioWorkletProcessorNames.HardClip, this.ReturnOptionsAsObject());
|
|
17
|
+
}
|
|
18
|
+
ReturnOptionsAsObject() {
|
|
19
|
+
return {
|
|
20
|
+
drive: this.drive,
|
|
21
|
+
gain: this.gain
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
SetDrive(drive) {
|
|
25
|
+
this.drive = drive;
|
|
26
|
+
return SendMessageToWorklet(this.audioWorkletNode, HardClipMessageCommandId.SetDrive, drive);
|
|
27
|
+
}
|
|
28
|
+
SetGain(gain) {
|
|
29
|
+
this.gain = gain;
|
|
30
|
+
return SendMessageToWorklet(this.audioWorkletNode, HardClipMessageCommandId.SetGain, gain);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Effector } from "../../../core/classes/Effector";
|
|
2
|
+
import { SoftClipOptions } from "../../../typings";
|
|
3
|
+
export declare class SoftClip extends Effector {
|
|
4
|
+
label: string | null;
|
|
5
|
+
name: string;
|
|
6
|
+
drive: number;
|
|
7
|
+
gain: number;
|
|
8
|
+
constructor({ drive, gain }: Partial<SoftClipOptions>);
|
|
9
|
+
InitializeOnAttachment(parentialContext: AudioContext): Promise<void>;
|
|
10
|
+
ReturnOptionsAsObject(): SoftClipOptions;
|
|
11
|
+
SetDrive(drive: number): boolean;
|
|
12
|
+
SetGain(gain: number): boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SoftClip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoftClip.d.ts","sourceRoot":"","sources":["../../../../src/effects/classes/clips/SoftClip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAwD,MAAM,kBAAkB,CAAC;AAEzG,qBAAa,QAAS,SAAQ,QAAQ;IAE3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAc;IAClC,IAAI,EAAE,MAAM,CAAc;IAE1B,KAAK,EAAE,MAAM,CAAK;IAClB,IAAI,EAAE,MAAM,CAAK;gBAEZ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,eAAe,CAAC;IAOxC,sBAAsB,CAAC,gBAAgB,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3E,qBAAqB,IAAI,eAAe;IAOxC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAKhC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAIxC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CreateAudioWorkletNode, SendMessageToWorklet } from "../../../utilities/helpers";
|
|
2
|
+
import { Effector } from "../../../core/classes/Effector";
|
|
3
|
+
import { AudioWorkletProcessorNames, SoftClipMessageCommandId } from "../../../typings";
|
|
4
|
+
export class SoftClip extends Effector {
|
|
5
|
+
label = "SoftClip";
|
|
6
|
+
name = "SoftClip";
|
|
7
|
+
drive = 1;
|
|
8
|
+
gain = 1;
|
|
9
|
+
constructor({ drive, gain }) {
|
|
10
|
+
super();
|
|
11
|
+
this.drive = drive ?? this.drive;
|
|
12
|
+
this.gain = gain ?? this.gain;
|
|
13
|
+
}
|
|
14
|
+
async InitializeOnAttachment(parentialContext) {
|
|
15
|
+
this.parentialContext = parentialContext;
|
|
16
|
+
this.audioWorkletNode = CreateAudioWorkletNode(parentialContext, AudioWorkletProcessorNames.SoftClip, this.ReturnOptionsAsObject());
|
|
17
|
+
}
|
|
18
|
+
ReturnOptionsAsObject() {
|
|
19
|
+
return {
|
|
20
|
+
drive: this.drive,
|
|
21
|
+
gain: this.gain
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
SetDrive(drive) {
|
|
25
|
+
this.drive = drive;
|
|
26
|
+
return SendMessageToWorklet(this.audioWorkletNode, SoftClipMessageCommandId.SetDrive, drive);
|
|
27
|
+
}
|
|
28
|
+
SetGain(gain) {
|
|
29
|
+
this.gain = gain;
|
|
30
|
+
return SendMessageToWorklet(this.audioWorkletNode, SoftClipMessageCommandId.SetGain, gain);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -5,7 +5,7 @@ export declare class LowPassFilter extends Effector {
|
|
|
5
5
|
label: string | null;
|
|
6
6
|
cutoff: number;
|
|
7
7
|
minFrequency: number;
|
|
8
|
-
constructor({ cutoff, minFrequency }: LowPassFilterOptions);
|
|
8
|
+
constructor({ cutoff, minFrequency }: Partial<LowPassFilterOptions>);
|
|
9
9
|
InitializeOnAttachment(parentialContext: AudioContext): Promise<void>;
|
|
10
10
|
ReturnOptionsAsObject(): LowPassFilterOptions;
|
|
11
11
|
SetCutoff(cutoff?: number): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LowPassFilter.d.ts","sourceRoot":"","sources":["../../../../src/effects/classes/filters/LowPassFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAE,oBAAoB,EAA6D,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,aAAc,SAAQ,QAAQ;IAEhC,IAAI,EAAE,MAAM,CAAmB;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAmB;IAEvC,MAAM,EAAE,MAAM,CAAQ;IACtB,YAAY,EAAE,MAAM,CAAM;gBAErB,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,oBAAoB;
|
|
1
|
+
{"version":3,"file":"LowPassFilter.d.ts","sourceRoot":"","sources":["../../../../src/effects/classes/filters/LowPassFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAE,oBAAoB,EAA6D,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,aAAc,SAAQ,QAAQ;IAEhC,IAAI,EAAE,MAAM,CAAmB;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAmB;IAEvC,MAAM,EAAE,MAAM,CAAQ;IACtB,YAAY,EAAE,MAAM,CAAM;gBAErB,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAOtD,sBAAsB,CAAC,gBAAgB,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3E,qBAAqB,IAAI,oBAAoB;IAO7C,SAAS,CAAC,MAAM,GAAE,MAAa,GAAG,OAAO;IAWzC,eAAe,CAAC,YAAY,GAAE,MAAW,GAAG,OAAO;CAS7D"}
|
|
@@ -4,7 +4,7 @@ export { Equalizer } from "./classes/Equalizer";
|
|
|
4
4
|
export { Limiter } from "./classes/Limiter";
|
|
5
5
|
export { Saturation } from "./classes/Saturation";
|
|
6
6
|
export { StereoPanner } from "./classes/StereoPanner";
|
|
7
|
-
export { SoftClip } from "./classes/SoftClip";
|
|
7
|
+
export { SoftClip } from "./classes/clips/SoftClip";
|
|
8
8
|
export { Compressor } from "./classes/compressors/Compressor";
|
|
9
9
|
export { MultibandCompressor } from "./classes/compressors/MultibandCompressor";
|
|
10
10
|
export { AdvancedDelay } from "./classes/delays/AdvancedDelay";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/effects/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/effects/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -4,7 +4,7 @@ export { Equalizer } from "./classes/Equalizer";
|
|
|
4
4
|
export { Limiter } from "./classes/Limiter";
|
|
5
5
|
export { Saturation } from "./classes/Saturation";
|
|
6
6
|
export { StereoPanner } from "./classes/StereoPanner";
|
|
7
|
-
export { SoftClip } from "./classes/SoftClip";
|
|
7
|
+
export { SoftClip } from "./classes/clips/SoftClip";
|
|
8
8
|
export { Compressor } from "./classes/compressors/Compressor";
|
|
9
9
|
export { MultibandCompressor } from "./classes/compressors/MultibandCompressor";
|
|
10
10
|
export { AdvancedDelay } from "./classes/delays/AdvancedDelay";
|
package/lib/dist/index.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export { AudioDevice, Channel, Effector, Master, AudioClip, DspPipeline } from "
|
|
|
9
9
|
export { InitializeDspPipeline, ResolveAudioOutputDevices, ResolveAudioInputDevices, ResolveDefaultAudioInputDevice, ResolveDefaultAudioOutputDevice, LoadAudioSource, LoadAudioSourceFromBlob, LoadWorkletOnMasterChannel, SendMessageToWorklet } from "./utilities/helpers";
|
|
10
10
|
export { SUPPORTED_FILE_TYPES } from "./utilities/constants";
|
|
11
11
|
export { hasInitializedWasm, } from "./utilities/web-assembly";
|
|
12
|
-
export type { FluexGLAudioDescriptor, FluexGLAudioDebuggerOptions, FluexGLAudioOptions, LoadAudioSourceOptions, AudioSourceData, ChannelOptions, ChannelSpatialization, AudioClipEventMap, AudioClipEvents, AudioClipOnProgressEvent, AudioClipAnalyserProperty, AudioClipAnalyserType, DspPipelineInitializationOptions, DspPipelineInitializationState, ChorusEffectOptions, LowPassFilterOptions, LowPassFilterMessageCommandId, ChorusMessageCommandId, AudioWorkletProcessorNames } from "./typings";
|
|
12
|
+
export type { FluexGLAudioDescriptor, FluexGLAudioDebuggerOptions, FluexGLAudioOptions, LoadAudioSourceOptions, AudioSourceData, ChannelOptions, ChannelSpatialization, AudioClipEventMap, AudioClipEvents, AudioClipOnProgressEvent, AudioClipAnalyserProperty, AudioClipAnalyserType, DspPipelineInitializationOptions, DspPipelineInitializationState, ChorusEffectOptions, LowPassFilterOptions, LowPassFilterMessageCommandId, ChorusMessageCommandId, AudioWorkletProcessorNames, SoftClipMessageCommandId, SoftClipOptions, HardClipMessageCommandId, HardClipOptions } from "./typings";
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAEnD,eAAO,MAAM,YAAY,EAAE,sBAkB1B,CAAA;AAED,OAAO,EACH,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,UAAU,EACV,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,WAAW,EACX,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,WAAW,EACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,eAAe,EACf,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,oBAAoB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACH,kBAAkB,GACrB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACR,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,gCAAgC,EAChC,8BAA8B,EAC9B,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACtB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAEnD,eAAO,MAAM,YAAY,EAAE,sBAkB1B,CAAA;AAED,OAAO,EACH,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,UAAU,EACV,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,WAAW,EACX,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,WAAW,EACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,eAAe,EACf,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,oBAAoB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACH,kBAAkB,GACrB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACR,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,gCAAgC,EAChC,8BAA8B,EAC9B,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,wBAAwB,EACxB,eAAe,EAClB,MAAM,WAAW,CAAC"}
|
package/lib/dist/typings.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ export declare enum ChorusMessageCommandId {
|
|
|
15
15
|
SetMix = 3,
|
|
16
16
|
SetFeedback = 4
|
|
17
17
|
}
|
|
18
|
+
export declare enum SoftClipMessageCommandId {
|
|
19
|
+
SetDrive = 0,
|
|
20
|
+
SetGain = 1
|
|
21
|
+
}
|
|
22
|
+
export declare enum HardClipMessageCommandId {
|
|
23
|
+
SetDrive = 0,
|
|
24
|
+
SetGain = 1
|
|
25
|
+
}
|
|
18
26
|
export declare enum AudioWorkletProcessorNames {
|
|
19
27
|
Compressor = "CompressorProcessor",
|
|
20
28
|
MultibandCompressor = "MultibandCompressorProcessor",
|
|
@@ -29,7 +37,9 @@ export declare enum AudioWorkletProcessorNames {
|
|
|
29
37
|
Chorus = "ChorusProcessor",
|
|
30
38
|
Flanger = "FlangerProcessor",
|
|
31
39
|
Phaser = "PhaserProcessor",
|
|
32
|
-
Reverb = "ReverbProcessor"
|
|
40
|
+
Reverb = "ReverbProcessor",
|
|
41
|
+
SoftClip = "SoftClipProcessor",
|
|
42
|
+
HardClip = "HardClipProcessor"
|
|
33
43
|
}
|
|
34
44
|
export interface FluexGLAudioDebuggerOptions {
|
|
35
45
|
breakOnError: boolean;
|
|
@@ -92,7 +102,15 @@ export interface ChorusEffectOptions {
|
|
|
92
102
|
feedback: number;
|
|
93
103
|
}
|
|
94
104
|
export interface LowPassFilterOptions {
|
|
95
|
-
cutoff
|
|
96
|
-
minFrequency
|
|
105
|
+
cutoff: number;
|
|
106
|
+
minFrequency: number;
|
|
107
|
+
}
|
|
108
|
+
export interface SoftClipOptions {
|
|
109
|
+
drive: number;
|
|
110
|
+
gain: number;
|
|
111
|
+
}
|
|
112
|
+
export interface HardClipOptions {
|
|
113
|
+
drive: number;
|
|
114
|
+
gain: number;
|
|
97
115
|
}
|
|
98
116
|
//# sourceMappingURL=typings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../src/typings.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,MAAM,CAAC;AACnD,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,uBAAuB,CAAC;AAE5G,MAAM,MAAM,eAAe,GAAI;KAC1B,CAAC,IAAI,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAAE;CACzD,CAAA;
|
|
1
|
+
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../src/typings.ts"],"names":[],"mappings":"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"}
|
package/lib/dist/typings.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// ======== Audio worklet command id's ========
|
|
1
2
|
export var LowPassFilterMessageCommandId;
|
|
2
3
|
(function (LowPassFilterMessageCommandId) {
|
|
3
4
|
LowPassFilterMessageCommandId[LowPassFilterMessageCommandId["SetCutoff"] = 0] = "SetCutoff";
|
|
@@ -11,6 +12,16 @@ export var ChorusMessageCommandId;
|
|
|
11
12
|
ChorusMessageCommandId[ChorusMessageCommandId["SetMix"] = 3] = "SetMix";
|
|
12
13
|
ChorusMessageCommandId[ChorusMessageCommandId["SetFeedback"] = 4] = "SetFeedback";
|
|
13
14
|
})(ChorusMessageCommandId || (ChorusMessageCommandId = {}));
|
|
15
|
+
export var SoftClipMessageCommandId;
|
|
16
|
+
(function (SoftClipMessageCommandId) {
|
|
17
|
+
SoftClipMessageCommandId[SoftClipMessageCommandId["SetDrive"] = 0] = "SetDrive";
|
|
18
|
+
SoftClipMessageCommandId[SoftClipMessageCommandId["SetGain"] = 1] = "SetGain";
|
|
19
|
+
})(SoftClipMessageCommandId || (SoftClipMessageCommandId = {}));
|
|
20
|
+
export var HardClipMessageCommandId;
|
|
21
|
+
(function (HardClipMessageCommandId) {
|
|
22
|
+
HardClipMessageCommandId[HardClipMessageCommandId["SetDrive"] = 0] = "SetDrive";
|
|
23
|
+
HardClipMessageCommandId[HardClipMessageCommandId["SetGain"] = 1] = "SetGain";
|
|
24
|
+
})(HardClipMessageCommandId || (HardClipMessageCommandId = {}));
|
|
14
25
|
export var AudioWorkletProcessorNames;
|
|
15
26
|
(function (AudioWorkletProcessorNames) {
|
|
16
27
|
AudioWorkletProcessorNames["Compressor"] = "CompressorProcessor";
|
|
@@ -27,4 +38,6 @@ export var AudioWorkletProcessorNames;
|
|
|
27
38
|
AudioWorkletProcessorNames["Flanger"] = "FlangerProcessor";
|
|
28
39
|
AudioWorkletProcessorNames["Phaser"] = "PhaserProcessor";
|
|
29
40
|
AudioWorkletProcessorNames["Reverb"] = "ReverbProcessor";
|
|
41
|
+
AudioWorkletProcessorNames["SoftClip"] = "SoftClipProcessor";
|
|
42
|
+
AudioWorkletProcessorNames["HardClip"] = "HardClipProcessor";
|
|
30
43
|
})(AudioWorkletProcessorNames || (AudioWorkletProcessorNames = {}));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Effector } from "../../../core/classes/Effector";
|
|
2
|
+
import { CreateAudioWorkletNode, SendMessageToWorklet } from "../../../utilities/helpers";
|
|
3
|
+
import { HardClipMessageCommandId, AudioWorkletProcessorNames, HardClipOptions } from "../../../typings";
|
|
4
|
+
|
|
5
|
+
export class HardClip extends Effector {
|
|
6
|
+
|
|
7
|
+
public label: string | null = "HardClip";
|
|
8
|
+
public name: string = "HardClip";
|
|
9
|
+
|
|
10
|
+
public drive: number = 1;
|
|
11
|
+
public gain: number = 1;
|
|
12
|
+
|
|
13
|
+
constructor({ drive, gain }: Partial<HardClipOptions>) {
|
|
14
|
+
super();
|
|
15
|
+
|
|
16
|
+
this.drive = drive ?? this.drive;
|
|
17
|
+
this.gain = gain ?? this.gain;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public async InitializeOnAttachment(parentialContext: AudioContext): Promise<void> {
|
|
21
|
+
this.parentialContext = parentialContext;
|
|
22
|
+
this.audioWorkletNode = CreateAudioWorkletNode<HardClipOptions>(parentialContext, AudioWorkletProcessorNames.HardClip, this.ReturnOptionsAsObject());
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public ReturnOptionsAsObject(): HardClipOptions {
|
|
26
|
+
return {
|
|
27
|
+
drive: this.drive,
|
|
28
|
+
gain: this.gain
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public SetDrive(drive: number): boolean {
|
|
33
|
+
this.drive = drive;
|
|
34
|
+
return SendMessageToWorklet<HardClipMessageCommandId, number>(this.audioWorkletNode, HardClipMessageCommandId.SetDrive, drive);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public SetGain(gain: number): boolean{
|
|
38
|
+
this.gain = gain;
|
|
39
|
+
return SendMessageToWorklet<HardClipMessageCommandId, number>(this.audioWorkletNode, HardClipMessageCommandId.SetGain, gain);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CreateAudioWorkletNode, SendMessageToWorklet } from "../../../utilities/helpers";
|
|
2
|
+
import { Effector } from "../../../core/classes/Effector";
|
|
3
|
+
import { SoftClipOptions, AudioWorkletProcessorNames, SoftClipMessageCommandId } from "../../../typings";
|
|
4
|
+
|
|
5
|
+
export class SoftClip extends Effector {
|
|
6
|
+
|
|
7
|
+
public label: string | null = "SoftClip";
|
|
8
|
+
public name: string = "SoftClip";
|
|
9
|
+
|
|
10
|
+
public drive: number = 1;
|
|
11
|
+
public gain: number = 1;
|
|
12
|
+
|
|
13
|
+
constructor({ drive, gain }: Partial<SoftClipOptions>) {
|
|
14
|
+
super();
|
|
15
|
+
|
|
16
|
+
this.drive = drive ?? this.drive;
|
|
17
|
+
this.gain = gain ?? this.gain;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public async InitializeOnAttachment(parentialContext: AudioContext): Promise<void> {
|
|
21
|
+
this.parentialContext = parentialContext;
|
|
22
|
+
this.audioWorkletNode = CreateAudioWorkletNode<SoftClipOptions>(parentialContext, AudioWorkletProcessorNames.SoftClip, this.ReturnOptionsAsObject());
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public ReturnOptionsAsObject(): SoftClipOptions {
|
|
26
|
+
return {
|
|
27
|
+
drive: this.drive,
|
|
28
|
+
gain: this.gain
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public SetDrive(drive: number): boolean {
|
|
33
|
+
this.drive = drive;
|
|
34
|
+
return SendMessageToWorklet<SoftClipMessageCommandId, number>(this.audioWorkletNode, SoftClipMessageCommandId.SetDrive, drive);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public SetGain(gain: number): boolean{
|
|
38
|
+
this.gain = gain;
|
|
39
|
+
return SendMessageToWorklet<SoftClipMessageCommandId, number>(this.audioWorkletNode, SoftClipMessageCommandId.SetGain, gain);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -12,7 +12,7 @@ export class LowPassFilter extends Effector {
|
|
|
12
12
|
public cutoff: number = 4000;
|
|
13
13
|
public minFrequency: number = 10;
|
|
14
14
|
|
|
15
|
-
constructor({ cutoff, minFrequency }: LowPassFilterOptions) {
|
|
15
|
+
constructor({ cutoff, minFrequency }: Partial<LowPassFilterOptions>) {
|
|
16
16
|
super();
|
|
17
17
|
|
|
18
18
|
this.cutoff = cutoff ?? this.cutoff;
|
|
@@ -45,6 +45,7 @@ export class LowPassFilter extends Effector {
|
|
|
45
45
|
|
|
46
46
|
public SetMinFrequency(minFrequency: number = 10): boolean {
|
|
47
47
|
|
|
48
|
+
|
|
48
49
|
if (minFrequency < 10)
|
|
49
50
|
minFrequency = 10;
|
|
50
51
|
|
|
@@ -4,7 +4,7 @@ export { Equalizer } from "./classes/Equalizer";
|
|
|
4
4
|
export { Limiter } from "./classes/Limiter";
|
|
5
5
|
export { Saturation } from "./classes/Saturation";
|
|
6
6
|
export { StereoPanner } from "./classes/StereoPanner";
|
|
7
|
-
export { SoftClip } from "./classes/SoftClip";
|
|
7
|
+
export { SoftClip } from "./classes/clips/SoftClip";
|
|
8
8
|
|
|
9
9
|
export { Compressor } from "./classes/compressors/Compressor";
|
|
10
10
|
export { MultibandCompressor } from "./classes/compressors/MultibandCompressor";
|
package/lib/src/index.ts
CHANGED
|
@@ -95,5 +95,9 @@ export type {
|
|
|
95
95
|
LowPassFilterOptions,
|
|
96
96
|
LowPassFilterMessageCommandId,
|
|
97
97
|
ChorusMessageCommandId,
|
|
98
|
-
AudioWorkletProcessorNames
|
|
98
|
+
AudioWorkletProcessorNames,
|
|
99
|
+
SoftClipMessageCommandId,
|
|
100
|
+
SoftClipOptions,
|
|
101
|
+
HardClipMessageCommandId,
|
|
102
|
+
HardClipOptions
|
|
99
103
|
} from "./typings";
|
package/lib/src/typings.ts
CHANGED
|
@@ -7,6 +7,8 @@ export type AudioClipEvents = {
|
|
|
7
7
|
[K in keyof AudioClipEventMap]: AudioClipEventMap[K][];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
// ======== Audio worklet command id's ========
|
|
11
|
+
|
|
10
12
|
export enum LowPassFilterMessageCommandId {
|
|
11
13
|
SetCutoff,
|
|
12
14
|
SetMinFrequency
|
|
@@ -20,6 +22,16 @@ export enum ChorusMessageCommandId {
|
|
|
20
22
|
SetFeedback
|
|
21
23
|
}
|
|
22
24
|
|
|
25
|
+
export enum SoftClipMessageCommandId {
|
|
26
|
+
SetDrive,
|
|
27
|
+
SetGain
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum HardClipMessageCommandId {
|
|
31
|
+
SetDrive,
|
|
32
|
+
SetGain
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
export enum AudioWorkletProcessorNames {
|
|
24
36
|
Compressor = "CompressorProcessor",
|
|
25
37
|
MultibandCompressor = "MultibandCompressorProcessor",
|
|
@@ -34,7 +46,9 @@ export enum AudioWorkletProcessorNames {
|
|
|
34
46
|
Chorus = "ChorusProcessor",
|
|
35
47
|
Flanger = "FlangerProcessor",
|
|
36
48
|
Phaser = "PhaserProcessor",
|
|
37
|
-
Reverb = "ReverbProcessor"
|
|
49
|
+
Reverb = "ReverbProcessor",
|
|
50
|
+
SoftClip = "SoftClipProcessor",
|
|
51
|
+
HardClip = "HardClipProcessor"
|
|
38
52
|
}
|
|
39
53
|
|
|
40
54
|
export interface FluexGLAudioDebuggerOptions {
|
|
@@ -100,6 +114,8 @@ export interface DspPipelineInitializationState {
|
|
|
100
114
|
workletBlobUrl: string;
|
|
101
115
|
}
|
|
102
116
|
|
|
117
|
+
// ======== Effect options ========
|
|
118
|
+
|
|
103
119
|
export interface ChorusEffectOptions {
|
|
104
120
|
baseDelayMs: number;
|
|
105
121
|
depthMs: number;
|
|
@@ -109,6 +125,16 @@ export interface ChorusEffectOptions {
|
|
|
109
125
|
}
|
|
110
126
|
|
|
111
127
|
export interface LowPassFilterOptions {
|
|
112
|
-
cutoff
|
|
113
|
-
minFrequency
|
|
128
|
+
cutoff: number;
|
|
129
|
+
minFrequency: number;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface SoftClipOptions {
|
|
133
|
+
drive: number;
|
|
134
|
+
gain: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface HardClipOptions {
|
|
138
|
+
drive: number;
|
|
139
|
+
gain: number;
|
|
114
140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluex/fluexgl-dsp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "An open-source, web-based DSP library developed alongside FluexGL, designed for creating and manipulating sounds in various contexts.",
|
|
5
5
|
"main": "lib/dist/index.js",
|
|
6
6
|
"types": "lib/dist/index.d.ts",
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { compiledWebAssemblyModule } from "../../utilities/web-assembly";
|
|
2
|
-
import { Effector } from "../../core/classes/Effector";
|
|
3
|
-
import { Debug } from "../../utilities/debugger";
|
|
4
|
-
|
|
5
|
-
export class SoftClip extends Effector {
|
|
6
|
-
|
|
7
|
-
public label: string | null = "SoftClip";
|
|
8
|
-
public name: string = "SoftClip";
|
|
9
|
-
|
|
10
|
-
constructor(public drive: number = 1, public gain: number = 1) {
|
|
11
|
-
super();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public async InitializeOnAttachment(parentialContext: AudioContext): Promise<void> {
|
|
15
|
-
|
|
16
|
-
if(!compiledWebAssemblyModule) return Debug.Error("Could not initialize effector because the nessecary WASM file has not been specified.", [
|
|
17
|
-
`Effector type: SoftClip`
|
|
18
|
-
]);
|
|
19
|
-
|
|
20
|
-
this.audioWorkletNode = new AudioWorkletNode(parentialContext, "SoftClipProcessor", {
|
|
21
|
-
numberOfInputs: 1,
|
|
22
|
-
numberOfOutputs: 1,
|
|
23
|
-
outputChannelCount: [2],
|
|
24
|
-
parameterData: {
|
|
25
|
-
drive: this.drive,
|
|
26
|
-
gain: this.gain
|
|
27
|
-
},
|
|
28
|
-
processorOptions: {
|
|
29
|
-
module: compiledWebAssemblyModule
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
this.parentialContext = parentialContext;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public SetDrive(drive: number): SoftClip {
|
|
37
|
-
|
|
38
|
-
if(this.audioWorkletNode) this.audioWorkletNode.port.postMessage({
|
|
39
|
-
type: "set-drive",
|
|
40
|
-
value: drive
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
this.drive = drive;
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public GetDrive(): number {
|
|
48
|
-
return this.drive;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public SetGain(gain: number): SoftClip {
|
|
52
|
-
|
|
53
|
-
if(this.audioWorkletNode) this.audioWorkletNode.port.postMessage({
|
|
54
|
-
type: "set-gain",
|
|
55
|
-
value: gain
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
this.gain = gain;
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
}
|