UNPKG

1.26 kBTypeScriptView Raw
1import { Gain } from "../core/context/Gain.js";
2import { Param } from "../core/context/Param.js";
3import { Signal, SignalOptions } from "./Signal.js";
4/**
5 * Add a signal and a number or two signals. When no value is
6 * passed into the constructor, Tone.Add will sum input and `addend`
7 * If a value is passed into the constructor, the it will be added to the input.
8 *
9 * @example
10 * return Tone.Offline(() => {
11 * const add = new Tone.Add(2).toDestination();
12 * add.addend.setValueAtTime(1, 0.2);
13 * const signal = new Tone.Signal(2);
14 * // add a signal and a scalar
15 * signal.connect(add);
16 * signal.setValueAtTime(1, 0.1);
17 * }, 0.5, 1);
18 * @category Signal
19 */
20export declare class Add extends Signal {
21 override: boolean;
22 readonly name: string;
23 /**
24 * the summing node
25 */
26 private _sum;
27 readonly input: Gain<"gain">;
28 readonly output: Gain<"gain">;
29 /**
30 * The value which is added to the input signal
31 */
32 readonly addend: Param<"number">;
33 /**
34 * @param value If no value is provided, will sum the input and {@link addend}.
35 */
36 constructor(value?: number);
37 constructor(options?: Partial<SignalOptions<"number">>);
38 static getDefaults(): SignalOptions<"number">;
39 dispose(): this;
40}