diff --git a/Tone/instrument/Synth.ts b/Tone/instrument/Synth.ts index 05e44c5d..8c2b7fc7 100644 --- a/Tone/instrument/Synth.ts +++ b/Tone/instrument/Synth.ts @@ -7,20 +7,12 @@ import { readOnly } from "../core/util/Interface"; import { RecursivePartial } from "../core/util/Interface"; import { Signal } from "../signal/Signal"; import { OmniOscillator } from "../source/oscillator/OmniOscillator"; -import { OmniOscillatorConstructorOptions } from "../source/oscillator/OscillatorInterface"; +import { OmniOscillatorConstructorOptions, OmniOscillatorSynthOptions } from "../source/oscillator/OscillatorInterface"; import { Source, SourceOptions } from "../source/Source"; import { Monophonic, MonophonicOptions } from "./Monophonic"; -/** - * The settable oscillator options. Does not include optiosn like - * "context" and "frequency" since those are controlled by the synth - */ -type LimitedOscillatorOptions = Omit< - Omit, - "frequency" | "detune">; - export interface SynthOptions extends MonophonicOptions { - oscillator: LimitedOscillatorOptions; + oscillator: OmniOscillatorSynthOptions; envelope: Omit; } diff --git a/Tone/source/oscillator/OscillatorInterface.ts b/Tone/source/oscillator/OscillatorInterface.ts index 238291e1..12655565 100644 --- a/Tone/source/oscillator/OscillatorInterface.ts +++ b/Tone/source/oscillator/OscillatorInterface.ts @@ -1,5 +1,6 @@ // tslint:disable: max-line-length import { AudioRange, Cents, Degrees, Frequency, Positive } from "../../core/type/Units"; +import { Omit } from "../../core/util/Interface"; import { Signal } from "../../signal/Signal"; import { SourceOptions } from "../Source"; @@ -351,3 +352,15 @@ export type OmniOscillatorOptions = OmniFMCustomOscillatorOptions & OmniFMTypeOscillatorOptions & OmniFMPartialsOscillatorOptions & OmniAMCustomOscillatorOptions & OmniAMTypeOscillatorOptions & OmniAMPartialsOscillatorOptions & ToneOscillatorConstructorOptions; + +type OmitSourceOptions = Omit; + +/** + * The settable options for the omni oscillator inside of the source which excludes certain attributes that are defined by the parent class + */ +export type OmniOscillatorSynthOptions = + OmitSourceOptions | OmitSourceOptions | + OmitSourceOptions | OmitSourceOptions | OmitSourceOptions | + OmitSourceOptions | OmitSourceOptions | OmitSourceOptions | + OmitSourceOptions | OmitSourceOptions | OmitSourceOptions | + OmitSourceOptions;