diff --git a/Tone/instrument/ModulationSynth.ts b/Tone/instrument/ModulationSynth.ts index 3c3bd03c..b67dd834 100644 --- a/Tone/instrument/ModulationSynth.ts +++ b/Tone/instrument/ModulationSynth.ts @@ -140,7 +140,7 @@ export abstract class ModulationSynth ex { type: "sine" } - ), + ) as OmniOscillatorSynthOptions, envelope: Object.assign( omitFromObject( Envelope.getDefaults(), @@ -162,7 +162,7 @@ export abstract class ModulationSynth ex { type: "square" } - ), + ) as OmniOscillatorSynthOptions, modulationEnvelope: Object.assign( omitFromObject( Envelope.getDefaults(), diff --git a/Tone/instrument/MonoSynth.ts b/Tone/instrument/MonoSynth.ts index ff627cc6..a9efe911 100644 --- a/Tone/instrument/MonoSynth.ts +++ b/Tone/instrument/MonoSynth.ts @@ -131,7 +131,7 @@ export class MonoSynth extends Monophonic { { type: "sawtooth", }, - ), + ) as OmniOscillatorSynthOptions, }); } diff --git a/Tone/instrument/Synth.ts b/Tone/instrument/Synth.ts index adff154c..27ff67ef 100644 --- a/Tone/instrument/Synth.ts +++ b/Tone/instrument/Synth.ts @@ -7,7 +7,7 @@ import { readOnly } from "../core/util/Interface"; import { RecursivePartial } from "../core/util/Interface"; import { Signal } from "../signal/Signal"; import { OmniOscillator } from "../source/oscillator/OmniOscillator"; -import { OmniOscillatorSynthOptions } from "../source/oscillator/OscillatorInterface"; +import { OmniOscillatorOptions, OmniOscillatorSynthOptions } from "../source/oscillator/OscillatorInterface"; import { Source } from "../source/Source"; import { Monophonic, MonophonicOptions } from "./Monophonic"; @@ -94,7 +94,7 @@ export class Synth extends Monophon { type: "triangle", }, - ), + ) as OmniOscillatorOptions, }); } diff --git a/Tone/source/oscillator/OmniOscillator.ts b/Tone/source/oscillator/OmniOscillator.ts index d6c5afd3..a21f6f9f 100644 --- a/Tone/source/oscillator/OmniOscillator.ts +++ b/Tone/source/oscillator/OmniOscillator.ts @@ -10,7 +10,7 @@ import { FMOscillator } from "./FMOscillator"; import { Oscillator } from "./Oscillator"; import { generateWaveform, - OmniOscillatorConstructorOptions, OmniOscillatorOptions, + OmniOscillatorOptions, OmniOscillatorType, ToneOscillatorInterface, ToneOscillatorType } from "./OscillatorInterface"; import { PulseOscillator } from "./PulseOscillator"; @@ -69,7 +69,7 @@ const OmniOscillatorSourceMap: { * @category Source */ export class OmniOscillator - extends Source + extends Source implements Omit { readonly name: string = "OmniOscillator"; @@ -92,7 +92,7 @@ export class OmniOscillator * @param type The type of the oscillator. */ constructor(frequency?: Frequency, type?: OmniOscillatorType); - constructor(options?: Partial); + constructor(options?: Partial); constructor() { super(optionsFromArguments(OmniOscillator.getDefaults(), arguments, ["frequency", "type"])); @@ -212,7 +212,7 @@ export class OmniOscillator } } - set(props: Partial): this { + set(props: Partial): this { // make sure the type is set first if (Reflect.has(props, "type") && props.type) { this.type = props.type; diff --git a/Tone/source/oscillator/OscillatorInterface.ts b/Tone/source/oscillator/OscillatorInterface.ts index 61367154..f3996d80 100644 --- a/Tone/source/oscillator/OscillatorInterface.ts +++ b/Tone/source/oscillator/OscillatorInterface.ts @@ -442,22 +442,13 @@ export type OmniOscillatorType = "amsine" | "amsquare" | "amsawtooth" | "amtriangle" | "amcustom" | AMTypeWithPartials | TypeWithPartials | OscillatorType | "pulse" | "pwm"; -export type OmniOscillatorConstructorOptions = +export type OmniOscillatorOptions = PulseOscillatorOptions | PWMOscillatorOptions | OmniFatCustomOscillatorOptions | OmniFatTypeOscillatorOptions | OmniFatPartialsOscillatorOptions | OmniFMCustomOscillatorOptions | OmniFMTypeOscillatorOptions | OmniFMPartialsOscillatorOptions | OmniAMCustomOscillatorOptions | OmniAMTypeOscillatorOptions | OmniAMPartialsOscillatorOptions | ToneOscillatorConstructorOptions; -// export type OmniOscillatorSourceOptions = OmniOscillatorConstructorOptions & SourceOptions; - -export type OmniOscillatorOptions = - PulseOscillatorOptions & PWMOscillatorOptions & - OmniFatCustomOscillatorOptions & OmniFatTypeOscillatorOptions & OmniFatPartialsOscillatorOptions & - OmniFMCustomOscillatorOptions & OmniFMTypeOscillatorOptions & OmniFMPartialsOscillatorOptions & - OmniAMCustomOscillatorOptions & OmniAMTypeOscillatorOptions & OmniAMPartialsOscillatorOptions & - ToneOscillatorConstructorOptions; - type OmitSourceOptions = Omit; /**