import { AmplitudeEnvelope } from "../component/envelope/AmplitudeEnvelope"; import { EnvelopeOptions } from "../component/envelope/Envelope"; import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode"; import { Cents, Frequency, Seconds } from "../core/type/Units"; import { RecursivePartial } from "../core/util/Interface"; import { Signal } from "../signal/Signal"; import { OmniOscillator } from "../source/oscillator/OmniOscillator"; import { OmniOscillatorSynthOptions } from "../source/oscillator/OscillatorInterface"; import { Monophonic, MonophonicOptions } from "./Monophonic"; export interface SynthOptions extends MonophonicOptions { oscillator: OmniOscillatorSynthOptions; envelope: Omit; } /** * Synth is composed simply of a {@link OmniOscillator} routed through an {@link AmplitudeEnvelope}. * ``` * +----------------+ +-------------------+ * | OmniOscillator +>--> AmplitudeEnvelope +>--> Output * +----------------+ +-------------------+ * ``` * @example * var synth = new Synth().toDestination(); * synth.triggerAttackRelease("C4", "8n"); * @category Instrument */ export declare class Synth extends Monophonic { readonly name: string; /** * The oscillator. */ readonly oscillator: OmniOscillator; /** * The frequency signal */ readonly frequency: Signal; /** * The detune signal */ readonly detune: Signal; /** * The envelope */ readonly envelope: AmplitudeEnvelope; /** * @param options the options available for the synth. */ constructor(options?: RecursivePartial); static getDefaults(): SynthOptions; /** * start the attack portion of the envelope * @param time the time the attack should start * @param velocity the velocity of the note (0-1) */ protected _triggerEnvelopeAttack(time: Seconds, velocity: number): void; /** * start the release portion of the envelope * @param time the time the release should start */ protected _triggerEnvelopeRelease(time: Seconds): void; /** * clean up */ dispose(): this; }