UNPKG

1.71 kBTypeScriptView Raw
1import { FrequencyClass } from "../core/type/Frequency.js";
2import { Frequency, Positive, Time } from "../core/type/Units.js";
3import { RecursivePartial } from "../core/util/Interface.js";
4import { Synth, SynthOptions } from "./Synth.js";
5export interface MembraneSynthOptions extends SynthOptions {
6 pitchDecay: Time;
7 octaves: Positive;
8}
9/**
10 * MembraneSynth makes kick and tom sounds using a single oscillator
11 * with an amplitude envelope and frequency ramp. A Tone.OmniOscillator
12 * is routed through a Tone.AmplitudeEnvelope to the output. The drum
13 * quality of the sound comes from the frequency envelope applied
14 * during MembraneSynth.triggerAttack(note). The frequency envelope
15 * starts at <code>note * .octaves</code> and ramps to <code>note</code>
16 * over the duration of <code>.pitchDecay</code>.
17 * @example
18 * const synth = new Tone.MembraneSynth().toDestination();
19 * synth.triggerAttackRelease("C2", "8n");
20 * @category Instrument
21 */
22export declare class MembraneSynth extends Synth<MembraneSynthOptions> {
23 readonly name: string;
24 /**
25 * The number of octaves the pitch envelope ramps.
26 * @min 0.5
27 * @max 8
28 */
29 octaves: Positive;
30 /**
31 * The amount of time the frequency envelope takes.
32 * @min 0
33 * @max 0.5
34 */
35 pitchDecay: Time;
36 /**
37 * Portamento is ignored in this synth. use pitch decay instead.
38 */
39 readonly portamento = 0;
40 /**
41 * @param options the options available for the synth see defaults
42 */
43 constructor(options?: RecursivePartial<MembraneSynthOptions>);
44 static getDefaults(): MembraneSynthOptions;
45 setNote(note: Frequency | FrequencyClass, time?: Time): this;
46 dispose(): this;
47}