UNPKG

1.17 kBTypeScriptView Raw
1import { WaveShaper } from "./WaveShaper.js";
2import { SignalOperator } from "./SignalOperator.js";
3import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode.js";
4export interface PowOptions extends ToneAudioNodeOptions {
5 value: number;
6}
7/**
8 * Pow applies an exponent to the incoming signal. The incoming signal must be AudioRange [-1, 1]
9 *
10 * @example
11 * const pow = new Tone.Pow(2);
12 * const sig = new Tone.Signal(0.5).connect(pow);
13 * // output of pow is 0.25.
14 * @category Signal
15 */
16export declare class Pow extends SignalOperator<PowOptions> {
17 readonly name: string;
18 private _exponent;
19 private _exponentScaler;
20 input: WaveShaper;
21 output: WaveShaper;
22 /**
23 * @param value Constant exponent value to use
24 */
25 constructor(value?: number);
26 constructor(options?: Partial<PowOptions>);
27 static getDefaults(): PowOptions;
28 /**
29 * the function which maps the waveshaper
30 * @param exponent exponent value
31 */
32 private _expFunc;
33 /**
34 * The value of the exponent.
35 */
36 get value(): number;
37 set value(exponent: number);
38 /**
39 * Clean up.
40 */
41 dispose(): this;
42}