UNPKG

2.05 kBTypeScriptView Raw
1import { Effect, EffectOptions } from "./Effect.js";
2import { Positive } from "../core/type/Units.js";
3export interface ChebyshevOptions extends EffectOptions {
4 order: Positive;
5 oversample: OverSampleType;
6}
7/**
8 * Chebyshev is a waveshaper which is good
9 * for making different types of distortion sounds.
10 * Note that odd orders sound very different from even ones,
11 * and order = 1 is no change.
12 * Read more at [music.columbia.edu](http://music.columbia.edu/cmc/musicandcomputers/chapter4/04_06.php).
13 * @example
14 * // create a new cheby
15 * const cheby = new Tone.Chebyshev(50).toDestination();
16 * // create a monosynth connected to our cheby
17 * const synth = new Tone.MonoSynth().connect(cheby);
18 * synth.triggerAttackRelease("C2", 0.4);
19 * @category Effect
20 */
21export declare class Chebyshev extends Effect<ChebyshevOptions> {
22 readonly name: string;
23 /**
24 * The private waveshaper node
25 */
26 private _shaper;
27 /**
28 * holds onto the order of the filter
29 */
30 private _order;
31 /**
32 * @param order The order of the chebyshev polynomial. Normal range between 1-100.
33 */
34 constructor(order?: Positive);
35 constructor(options?: Partial<ChebyshevOptions>);
36 static getDefaults(): ChebyshevOptions;
37 /**
38 * get the coefficient for that degree
39 * @param x the x value
40 * @param degree
41 * @param memo memoize the computed value. this speeds up computation greatly.
42 */
43 private _getCoefficient;
44 /**
45 * The order of the Chebyshev polynomial which creates the equation which is applied to the incoming
46 * signal through a Tone.WaveShaper. Must be an integer. The equations are in the form:
47 * ```
48 * order 2: 2x^2 + 1
49 * order 3: 4x^3 + 3x
50 * ```
51 * @min 1
52 * @max 100
53 */
54 get order(): Positive;
55 set order(order: Positive);
56 /**
57 * The oversampling of the effect. Can either be "none", "2x" or "4x".
58 */
59 get oversample(): OverSampleType;
60 set oversample(oversampling: OverSampleType);
61 dispose(): this;
62}