removing unused variables

This commit is contained in:
Yotam Mann 2019-10-31 15:43:16 -04:00
parent 7549764c38
commit b9619d8c68
50 changed files with 39 additions and 55 deletions

View file

@ -24,7 +24,6 @@ export class DCMeter extends MeterBase<DCMeterOptions> {
constructor(options?: Partial<DCMeterOptions>); constructor(options?: Partial<DCMeterOptions>);
constructor() { constructor() {
super(optionsFromArguments(DCMeter.getDefaults(), arguments)); super(optionsFromArguments(DCMeter.getDefaults(), arguments));
const options = optionsFromArguments(DCMeter.getDefaults(), arguments);
this._analyser.type = "waveform"; this._analyser.type = "waveform";
this._analyser.size = 256; this._analyser.size = 256;

View file

@ -1,4 +1,4 @@
import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode"; import { ToneAudioNode } from "../../core/context/ToneAudioNode";
import { dbToGain } from "../../core/type/Conversions"; import { dbToGain } from "../../core/type/Conversions";
import { NormalRange, PowerOfTwo } from "../../core/type/Units"; import { NormalRange, PowerOfTwo } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";

View file

@ -29,7 +29,6 @@ export class MeterBase<Options extends MeterBaseOptions> extends ToneAudioNode<O
constructor(options?: Partial<MeterBaseOptions>); constructor(options?: Partial<MeterBaseOptions>);
constructor() { constructor() {
super(optionsFromArguments(MeterBase.getDefaults(), arguments)); super(optionsFromArguments(MeterBase.getDefaults(), arguments));
const options = optionsFromArguments(MeterBase.getDefaults(), arguments);
this.input = this.output = this._analyser = new Analyser({ this.input = this.output = this._analyser = new Analyser({
context: this.context, context: this.context,

View file

@ -1,5 +1,5 @@
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";
import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode"; import { OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { Merge } from "./Merge"; import { Merge } from "./Merge";
@ -34,7 +34,6 @@ export class Mono extends ToneAudioNode<MonoOptions> {
constructor() { constructor() {
super(optionsFromArguments(Mono.getDefaults(), arguments)); super(optionsFromArguments(Mono.getDefaults(), arguments));
const options = optionsFromArguments(Mono.getDefaults(), arguments);
this.input = new Gain({ context: this.context }); this.input = new Gain({ context: this.context });

View file

@ -1,6 +1,6 @@
import { Param } from "../../core/context/Param"; import { Param } from "../../core/context/Param";
import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode"; import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode";
import { AudioRange, NormalRange } from "../../core/type/Units"; import { AudioRange } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";

View file

@ -1,6 +1,6 @@
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";
import { Param } from "../../core/context/Param"; import { Param } from "../../core/context/Param";
import { InputNode, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode"; import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode";
import { Decibels } from "../../core/type/Units"; import { Decibels } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";

View file

@ -1,7 +1,7 @@
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";
import { Param } from "../../core/context/Param"; import { Param } from "../../core/context/Param";
import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode"; import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode";
import { Cents, Decibels, Frequency, GainFactor, Positive } from "../../core/type/Units"; import { Decibels, Frequency } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly, writable } from "../../core/util/Interface"; import { readOnly, writable } from "../../core/util/Interface";
import { Signal } from "../../signal/Signal"; import { Signal } from "../../signal/Signal";

View file

@ -1,6 +1,6 @@
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";
import { connectSeries, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode"; import { connectSeries, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode";
import { Cents, Decibels, Frequency, GainFactor, Positive } from "../../core/type/Units"; import { Cents, Frequency, GainFactor, Positive } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly, writable } from "../../core/util/Interface"; import { readOnly, writable } from "../../core/util/Interface";
import { isNumber } from "../../core/util/TypeCheck"; import { isNumber } from "../../core/util/TypeCheck";

View file

@ -4,7 +4,6 @@ import { Frequency, NormalRange, Time } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { RecursivePartial } from "../../core/util/Interface"; import { RecursivePartial } from "../../core/util/Interface";
import { FeedbackCombFilter } from "./FeedbackCombFilter"; import { FeedbackCombFilter } from "./FeedbackCombFilter";
import { Filter } from "./Filter";
import { OnePoleFilter } from "./OnePoleFilter"; import { OnePoleFilter } from "./OnePoleFilter";
interface LowpassCombFilterOptions extends ToneAudioNodeOptions { interface LowpassCombFilterOptions extends ToneAudioNodeOptions {

View file

@ -1,5 +1,5 @@
import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode"; import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode";
import { Frequency, NormalRange } from "../../core/type/Units"; import { Frequency } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";

View file

@ -1,5 +1,5 @@
import { ToneWithContext, ToneWithContextOptions } from "../context/ToneWithContext"; import { ToneWithContext, ToneWithContextOptions } from "../context/ToneWithContext";
import { BPM, Frequency, Hertz, Seconds, Ticks, Time } from "../type/Units"; import { Frequency, Hertz, Seconds, Ticks, Time } from "../type/Units";
import { optionsFromArguments } from "../util/Defaults"; import { optionsFromArguments } from "../util/Defaults";
import { Emitter } from "../util/Emitter"; import { Emitter } from "../util/Emitter";
import { noOp, readOnly } from "../util/Interface"; import { noOp, readOnly } from "../util/Interface";

View file

@ -1,6 +1,6 @@
import { Signal, SignalOptions } from "../../signal/Signal"; import { Signal, SignalOptions } from "../../signal/Signal";
import { InputNode } from "../context/ToneAudioNode"; import { InputNode } from "../context/ToneAudioNode";
import { BPM, Hertz, Seconds, Ticks, Time, UnitMap, UnitName } from "../type/Units"; import { Seconds, Ticks, Time, UnitMap, UnitName } from "../type/Units";
import { optionsFromArguments } from "../util/Defaults"; import { optionsFromArguments } from "../util/Defaults";
import { TickParam } from "./TickParam"; import { TickParam } from "./TickParam";

View file

@ -1,5 +1,5 @@
import { ToneWithContext, ToneWithContextOptions } from "../context/ToneWithContext"; import { ToneWithContext, ToneWithContextOptions } from "../context/ToneWithContext";
import { BPM, Frequency, Hertz, Seconds, Ticks, Time, UnitMap } from "../type/Units"; import { Seconds, Ticks, Time } from "../type/Units";
import { optionsFromArguments } from "../util/Defaults"; import { optionsFromArguments } from "../util/Defaults";
import { readOnly } from "../util/Interface"; import { readOnly } from "../util/Interface";
import { PlaybackState, StateTimeline, StateTimelineEvent } from "../util/StateTimeline"; import { PlaybackState, StateTimeline, StateTimelineEvent } from "../util/StateTimeline";

View file

@ -1,4 +1,4 @@
import { Time, Unit, UnitMap, UnitName } from "../type/Units"; import { Time, UnitMap, UnitName } from "../type/Units";
/** /**
* Abstract base class for [[Param]] and [[Signal]] * Abstract base class for [[Param]] and [[Signal]]

View file

@ -3,7 +3,7 @@ import { Seconds } from "../type/Units";
import { isAudioContext } from "../util/AdvancedTypeCheck"; import { isAudioContext } from "../util/AdvancedTypeCheck";
import { optionsFromArguments } from "../util/Defaults"; import { optionsFromArguments } from "../util/Defaults";
import { Emitter } from "../util/Emitter"; import { Emitter } from "../util/Emitter";
import { noOp, Omit } from "../util/Interface"; import { Omit } from "../util/Interface";
import { Timeline } from "../util/Timeline"; import { Timeline } from "../util/Timeline";
import { isDefined, isString } from "../util/TypeCheck"; import { isDefined, isString } from "../util/TypeCheck";
import { AnyAudioContext, createAudioContext, createAudioWorkletNode } from "./AudioContext"; import { AnyAudioContext, createAudioContext, createAudioWorkletNode } from "./AudioContext";

View file

@ -1,6 +1,6 @@
import { AbstractParam } from "../context/AbstractParam"; import { AbstractParam } from "../context/AbstractParam";
import { dbToGain, gainToDb } from "../type/Conversions"; import { dbToGain, gainToDb } from "../type/Conversions";
import { AudioRange, Decibels, Frequency, NormalRange, Positive, Time, Unit, UnitMap, UnitName } from "../type/Units"; import { AudioRange, Decibels, Frequency, NormalRange, Positive, Time, UnitMap, UnitName } from "../type/Units";
import { isAudioParam } from "../util/AdvancedTypeCheck"; import { isAudioParam } from "../util/AdvancedTypeCheck";
import { optionsFromArguments } from "../util/Defaults"; import { optionsFromArguments } from "../util/Defaults";
import { Timeline } from "../util/Timeline"; import { Timeline } from "../util/Timeline";

View file

@ -1,6 +1,6 @@
import { getContext } from "../Global"; import { getContext } from "../Global";
import { Tone } from "../Tone"; import { Tone } from "../Tone";
import { Samples, Seconds, Time } from "../type/Units"; import { Samples, Seconds } from "../type/Units";
import { isAudioBuffer } from "../util/AdvancedTypeCheck"; import { isAudioBuffer } from "../util/AdvancedTypeCheck";
import { optionsFromArguments } from "../util/Defaults"; import { optionsFromArguments } from "../util/Defaults";
import { noOp } from "../util/Interface"; import { noOp } from "../util/Interface";

View file

@ -2,7 +2,7 @@ import { getContext } from "../Global";
import { intervalToFrequencyRatio, mtof } from "./Conversions"; import { intervalToFrequencyRatio, mtof } from "./Conversions";
import { ftom, getA4, setA4 } from "./Conversions"; import { ftom, getA4, setA4 } from "./Conversions";
import { TimeClass } from "./Time"; import { TimeClass } from "./Time";
import { TimeBaseClass, TimeBaseUnit, TimeExpression, TimeValue } from "./TimeBase"; import { TimeBaseUnit, TimeExpression, TimeValue } from "./TimeBase";
import { Frequency, Hertz, Interval, MidiNote, Note, Seconds, Ticks } from "./Units"; import { Frequency, Hertz, Interval, MidiNote, Note, Seconds, Ticks } from "./Units";
export type FrequencyUnit = TimeBaseUnit | "midi"; export type FrequencyUnit = TimeBaseUnit | "midi";

View file

@ -229,8 +229,6 @@ export class Timeline<GenericEvent extends TimelineEvent> extends Tone {
} }
} }
private readonly _epsilon = 1e-6;
/** /**
* Does a binary search on the timeline array and returns the * Does a binary search on the timeline array and returns the
* nearest event index whose time is after or equal to the given time. * nearest event index whose time is after or equal to the given time.

View file

@ -1,5 +1,4 @@
import { Effect, EffectOptions } from "../effect/Effect"; import { Frequency, Positive } from "../core/type/Units";
import { Frequency, NormalRange, Positive, Time } from "../core/type/Units";
import { Filter, FilterOptions } from "../component/filter/Filter"; import { Filter, FilterOptions } from "../component/filter/Filter";
import { SourceOptions } from "../source/Source"; import { SourceOptions } from "../source/Source";
import { optionsFromArguments } from "../core/util/Defaults"; import { optionsFromArguments } from "../core/util/Defaults";

View file

@ -34,7 +34,6 @@ export class AutoPanner extends LFOEffect<AutoPannerOptions> {
constructor() { constructor() {
super(optionsFromArguments(AutoPanner.getDefaults(), arguments, ["frequency"])); super(optionsFromArguments(AutoPanner.getDefaults(), arguments, ["frequency"]));
const options = optionsFromArguments(AutoPanner.getDefaults(), arguments, ["frequency"]);
this._panner = new Panner({ context: this.context }); this._panner = new Panner({ context: this.context });
// connections // connections

View file

@ -1,6 +1,6 @@
import { CrossFade } from "../component/channel/CrossFade"; import { CrossFade } from "../component/channel/CrossFade";
import { Gain } from "../core/context/Gain"; import { Gain } from "../core/context/Gain";
import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode"; import { ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode";
import { NormalRange } from "../core/type/Units"; import { NormalRange } from "../core/type/Units";
import { readOnly } from "../core/util/Interface"; import { readOnly } from "../core/util/Interface";
import { Signal } from "../signal/Signal"; import { Signal } from "../signal/Signal";

View file

@ -1,5 +1,5 @@
import { Effect, EffectOptions } from "../effect/Effect"; import { Effect, EffectOptions } from "../effect/Effect";
import { Frequency, NormalRange, Positive, Time } from "../core/type/Units"; import { Frequency, NormalRange, Time } from "../core/type/Units";
import { LFO } from "../source/oscillator/LFO"; import { LFO } from "../source/oscillator/LFO";
import { ToneOscillatorType } from "../source/oscillator/OscillatorInterface"; import { ToneOscillatorType } from "../source/oscillator/OscillatorInterface";
import { Signal } from "../signal/Signal"; import { Signal } from "../signal/Signal";

View file

@ -160,7 +160,6 @@ export class Sequence<ValueType = any> extends ToneEvent<ValueType> {
}, },
set: (target: any[], property: PropertyKey, value: any): boolean => { set: (target: any[], property: PropertyKey, value: any): boolean => {
if (isString(property) && isFinite(parseInt(property, 10))) { if (isString(property) && isFinite(parseInt(property, 10))) {
const index = parseInt(property, 10);
if (isArray(value)) { if (isArray(value)) {
target[property] = this._createSequence(value); target[property] = this._createSequence(value);
} else { } else {

View file

@ -31,7 +31,6 @@ export class AMSynth extends ModulationSynth<AMSynthOptions> {
constructor(options?: RecursivePartial<AMSynthOptions>); constructor(options?: RecursivePartial<AMSynthOptions>);
constructor() { constructor() {
super(optionsFromArguments(AMSynth.getDefaults(), arguments)); super(optionsFromArguments(AMSynth.getDefaults(), arguments));
const options = optionsFromArguments(AMSynth.getDefaults(), arguments);
this._modulationScale = new AudioToGain({ this._modulationScale = new AudioToGain({
context: this.context, context: this.context,

View file

@ -2,7 +2,7 @@ import { Envelope, EnvelopeOptions } from "../component/envelope/Envelope";
import { Filter } from "../component/filter/Filter"; import { Filter } from "../component/filter/Filter";
import { Gain } from "../core/context/Gain"; import { Gain } from "../core/context/Gain";
import { ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode"; import { ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode";
import { Cents, Frequency, NormalRange, Positive, Seconds, Time } from "../core/type/Units"; import { Frequency, NormalRange, Positive, Seconds } from "../core/type/Units";
import { deepMerge, omitFromObject, optionsFromArguments } from "../core/util/Defaults"; import { deepMerge, omitFromObject, optionsFromArguments } from "../core/util/Defaults";
import { noOp, RecursivePartial } from "../core/util/Interface"; import { noOp, RecursivePartial } from "../core/util/Interface";
import { Multiply } from "../signal/Multiply"; import { Multiply } from "../signal/Multiply";

View file

@ -1,6 +1,5 @@
import { Signal } from "../signal/Signal"; import { Signal } from "../signal/Signal";
import { Multiply } from "../signal/Multiply"; import { Multiply } from "../signal/Multiply";
import { AudioToGain } from "../signal/AudioToGain";
import { Gain } from "../core/context/Gain"; import { Gain } from "../core/context/Gain";
import { Positive, Seconds } from "../core/type/Units"; import { Positive, Seconds } from "../core/type/Units";
import { Envelope, EnvelopeOptions } from "../component/envelope/Envelope"; import { Envelope, EnvelopeOptions } from "../component/envelope/Envelope";

View file

@ -10,7 +10,7 @@ import { Synth, SynthOptions } from "./Synth";
import { FrequencyEnvelope, FrequencyEnvelopeOptions } from "../component/envelope/FrequencyEnvelope"; import { FrequencyEnvelope, FrequencyEnvelopeOptions } from "../component/envelope/FrequencyEnvelope";
import { Time } from "../core/type/Units"; import { Time } from "../core/type/Units";
import { Signal } from "../signal/Signal"; import { Signal } from "../signal/Signal";
import { OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode"; import { ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode";
import { OmniOscillatorSynthOptions } from "../source/oscillator/OscillatorInterface"; import { OmniOscillatorSynthOptions } from "../source/oscillator/OscillatorInterface";
export interface MonoSynthOptions extends MonophonicOptions { export interface MonoSynthOptions extends MonophonicOptions {

View file

@ -1,7 +1,7 @@
import { AmplitudeEnvelope } from "../component/envelope/AmplitudeEnvelope"; import { AmplitudeEnvelope } from "../component/envelope/AmplitudeEnvelope";
import { Envelope, EnvelopeOptions } from "../component/envelope/Envelope"; import { Envelope, EnvelopeOptions } from "../component/envelope/Envelope";
import { ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode"; import { ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode";
import { Cents, Frequency, Seconds } from "../core/type/Units"; import { Seconds } from "../core/type/Units";
import { omitFromObject, optionsFromArguments } from "../core/util/Defaults"; import { omitFromObject, optionsFromArguments } from "../core/util/Defaults";
import { readOnly } from "../core/util/Interface"; import { readOnly } from "../core/util/Interface";
import { RecursivePartial } from "../core/util/Interface"; import { RecursivePartial } from "../core/util/Interface";

View file

@ -1,5 +1,4 @@
import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode"; import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode";
import { optionsFromArguments } from "../core/util/Defaults";
import { Multiply } from "./Multiply"; import { Multiply } from "./Multiply";
import { SignalOperator } from "./SignalOperator"; import { SignalOperator } from "./SignalOperator";

View file

@ -2,7 +2,7 @@ import { AbstractParam } from "../core/context/AbstractParam";
import { Param } from "../core/context/Param"; import { Param } from "../core/context/Param";
import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode"; import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode";
import { connect } from "../core/context/ToneAudioNode"; import { connect } from "../core/context/ToneAudioNode";
import { Time, Unit, UnitMap, UnitName } from "../core/type/Units"; import { Time, UnitMap, UnitName } from "../core/type/Units";
import { isAudioParam } from "../core/util/AdvancedTypeCheck"; import { isAudioParam } from "../core/util/AdvancedTypeCheck";
import { optionsFromArguments } from "../core/util/Defaults"; import { optionsFromArguments } from "../core/util/Defaults";
import { ToneConstantSource } from "./ToneConstantSource"; import { ToneConstantSource } from "./ToneConstantSource";

View file

@ -1,6 +1,6 @@
import { connect } from "../core/Connect"; import { connect } from "../core/Connect";
import { Param } from "../core/context/Param"; import { Param } from "../core/context/Param";
import { Seconds, Time, Unit, UnitMap, UnitName } from "../core/type/Units"; import { Seconds, Time, UnitMap, UnitName } from "../core/type/Units";
import { optionsFromArguments } from "../core/util/Defaults"; import { optionsFromArguments } from "../core/util/Defaults";
import { OneShotSource, OneShotSourceOptions } from "../source/OneShotSource"; import { OneShotSource, OneShotSourceOptions } from "../source/OneShotSource";

View file

@ -1,7 +1,7 @@
import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode"; import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode";
import { optionsFromArguments } from "../core/util/Defaults"; import { optionsFromArguments } from "../core/util/Defaults";
import { isArray, isFunction, isUndef } from "../core/util/TypeCheck"; import { isArray, isFunction } from "../core/util/TypeCheck";
import { Signal, SignalOptions } from "./Signal"; import { Signal } from "./Signal";
import { SignalOperator } from "./SignalOperator"; import { SignalOperator } from "./SignalOperator";
export type WaveShaperMappingFn = (value: number, index?: number) => number; export type WaveShaperMappingFn = (value: number, index?: number) => number;

View file

@ -3,7 +3,6 @@ import { ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNo
import { GainFactor, Seconds, Time } from "../core/type/Units"; import { GainFactor, Seconds, Time } from "../core/type/Units";
import { noOp } from "../core/util/Interface"; import { noOp } from "../core/util/Interface";
import { BasicPlaybackState } from "../core/util/StateTimeline"; import { BasicPlaybackState } from "../core/util/StateTimeline";
import { OfflineContext } from "../core/context/OfflineContext";
export type OneShotSourceCurve = "linear" | "exponential"; export type OneShotSourceCurve = "linear" | "exponential";

View file

@ -103,7 +103,6 @@ describe("Source", () => {
const source = new Oscillator(); const source = new Oscillator();
expect(source.state).to.equal("stopped"); expect(source.state).to.equal("stopped");
source.start(0); source.start(0);
const currentTime = source.context.currentTime;
setTimeout(() => { setTimeout(() => {
expect(source.state).to.equal("started"); expect(source.state).to.equal("started");
source.dispose(); source.dispose();

View file

@ -4,7 +4,7 @@ import { Volume } from "../component";
import { optionsFromArguments } from "../core/util/Defaults"; import { optionsFromArguments } from "../core/util/Defaults";
import { Param } from "../core/context/Param"; import { Param } from "../core/context/Param";
import { readOnly } from "../core/util/Interface"; import { readOnly } from "../core/util/Interface";
import { isDefined, isNumber, isUndef } from "../core/util/TypeCheck"; import { isDefined, isNumber } from "../core/util/TypeCheck";
export interface UserMediaOptions extends ToneAudioNodeOptions { export interface UserMediaOptions extends ToneAudioNodeOptions {
volume: Decibels; volume: Decibels;

View file

@ -6,7 +6,7 @@ import { defaultArg, optionsFromArguments } from "../../core/util/Defaults";
import { noOp } from "../../core/util/Interface"; import { noOp } from "../../core/util/Interface";
import { isDefined } from "../../core/util/TypeCheck"; import { isDefined } from "../../core/util/TypeCheck";
import { OneShotSource, OneShotSourceCurve, OneShotSourceOptions } from "../OneShotSource"; import { OneShotSource, OneShotSourceCurve, OneShotSourceOptions } from "../OneShotSource";
import { EQ, GTE, LT } from "../../core/util/Math"; import { GTE, LT } from "../../core/util/Math";
export type ToneBufferSourceCurve = OneShotSourceCurve; export type ToneBufferSourceCurve = OneShotSourceCurve;

View file

@ -1,7 +1,6 @@
import { expect } from "chai"; import { expect } from "chai";
import { BasicTests } from "test/helper/Basic"; import { BasicTests } from "test/helper/Basic";
import { CompareToFile } from "test/helper/CompareToFile"; import { CompareToFile } from "test/helper/CompareToFile";
import { Offline } from "test/helper/Offline";
import { OscillatorTests } from "test/helper/OscillatorTests"; import { OscillatorTests } from "test/helper/OscillatorTests";
import { SourceTests } from "test/helper/SourceTests"; import { SourceTests } from "test/helper/SourceTests";
import { AMOscillator } from "./AMOscillator"; import { AMOscillator } from "./AMOscillator";

View file

@ -1,5 +1,5 @@
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";
import { Cents, Degrees, Frequency, Positive, Seconds, Time } from "../../core/type/Units"; import { Degrees, Frequency, Seconds, Time } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";
import { AudioToGain } from "../../signal/AudioToGain"; import { AudioToGain } from "../../signal/AudioToGain";

View file

@ -1,7 +1,7 @@
import { expect } from "chai"; import { expect } from "chai";
import { BasicTests } from "test/helper/Basic"; import { BasicTests } from "test/helper/Basic";
import { CompareToFile } from "test/helper/CompareToFile"; import { CompareToFile } from "test/helper/CompareToFile";
import { connectFrom, connectTo } from "test/helper/Connect"; import { connectFrom } from "test/helper/Connect";
import { OscillatorTests } from "test/helper/OscillatorTests"; import { OscillatorTests } from "test/helper/OscillatorTests";
import { SourceTests } from "test/helper/SourceTests"; import { SourceTests } from "test/helper/SourceTests";
import { FMOscillator } from "./FMOscillator"; import { FMOscillator } from "./FMOscillator";

View file

@ -1,5 +1,5 @@
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";
import { AudioRange, Cents, Degrees, Frequency, Positive, Time } from "../../core/type/Units"; import { Degrees, Frequency, Time } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";
import { Multiply } from "../../signal/Multiply"; import { Multiply } from "../../signal/Multiply";

View file

@ -1,7 +1,6 @@
import { expect } from "chai"; import { expect } from "chai";
import { BasicTests } from "test/helper/Basic"; import { BasicTests } from "test/helper/Basic";
import { CompareToFile } from "test/helper/CompareToFile"; import { CompareToFile } from "test/helper/CompareToFile";
// import Offline from "test/helper/Offline";
import { OscillatorTests } from "test/helper/OscillatorTests"; import { OscillatorTests } from "test/helper/OscillatorTests";
import { SourceTests } from "test/helper/SourceTests"; import { SourceTests } from "test/helper/SourceTests";
import { FatOscillator } from "./FatOscillator"; import { FatOscillator } from "./FatOscillator";

View file

@ -1,4 +1,4 @@
import { Cents, Degrees, Frequency, Positive, Time } from "../../core/type/Units"; import { Cents, Degrees, Frequency, Time } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { noOp, readOnly } from "../../core/util/Interface"; import { noOp, readOnly } from "../../core/util/Interface";
import { Signal } from "../../signal/Signal"; import { Signal } from "../../signal/Signal";

View file

@ -1,7 +1,7 @@
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";
import { Param } from "../../core/context/Param"; import { Param } from "../../core/context/Param";
import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode"; import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode";
import { AudioRange, Cents, Degrees, Frequency, NormalRange, Time, UnitName } from "../../core/type/Units"; import { Degrees, Frequency, NormalRange, Time, UnitName } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";
import { BasicPlaybackState } from "../../core/util/StateTimeline"; import { BasicPlaybackState } from "../../core/util/StateTimeline";
@ -10,7 +10,6 @@ import { Scale } from "../../signal/Scale";
import { connectSignal, Signal } from "../../signal/Signal"; import { connectSignal, Signal } from "../../signal/Signal";
import { Zero } from "../../signal/Zero"; import { Zero } from "../../signal/Zero";
import { Oscillator, ToneOscillatorType } from "./Oscillator"; import { Oscillator, ToneOscillatorType } from "./Oscillator";
import { ToneOscillatorInterface } from "./OscillatorInterface";
export interface LFOOptions extends ToneAudioNodeOptions { export interface LFOOptions extends ToneAudioNodeOptions {
type: ToneOscillatorType; type: ToneOscillatorType;

View file

@ -1,4 +1,4 @@
import { AudioRange, Cents, Degrees, Frequency, Positive, Time } from "../../core/type/Units"; import { Cents, Degrees, Frequency, Time } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";
import { isNumber, isString } from "../../core/util/TypeCheck"; import { isNumber, isString } from "../../core/util/TypeCheck";

View file

@ -1,4 +1,4 @@
import { AudioRange, Cents, Degrees, Frequency, Radians, Time } from "../../core/type/Units"; import { AudioRange, Degrees, Frequency, Radians, Time } from "../../core/type/Units";
import { deepEquals, optionsFromArguments } from "../../core/util/Defaults"; import { deepEquals, optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";
import { isDefined } from "../../core/util/TypeCheck"; import { isDefined } from "../../core/util/TypeCheck";

View file

@ -1,4 +1,4 @@
import { Cents, Degrees, Frequency, Time } from "../../core/type/Units"; import { Degrees, Frequency, Time } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";
import { Multiply } from "../../signal/Multiply"; import { Multiply } from "../../signal/Multiply";

View file

@ -1,5 +1,5 @@
import { Gain } from "../../core/context/Gain"; import { Gain } from "../../core/context/Gain";
import { AudioRange, Cents, Degrees, Frequency, Time } from "../../core/type/Units"; import { AudioRange, Degrees, Frequency, Time } from "../../core/type/Units";
import { optionsFromArguments } from "../../core/util/Defaults"; import { optionsFromArguments } from "../../core/util/Defaults";
import { readOnly } from "../../core/util/Interface"; import { readOnly } from "../../core/util/Interface";
import { Signal } from "../../signal/Signal"; import { Signal } from "../../signal/Signal";

View file

@ -151,7 +151,7 @@ describe("ToneOscillatorNode", () => {
}); });
it("can play for a specific duration", () => { it("can play for a specific duration", () => {
return Offline((context) => { return Offline(() => {
const osc = new ToneOscillatorNode().toDestination(); const osc = new ToneOscillatorNode().toDestination();
osc.start(0).stop(0.1); osc.start(0).stop(0.1);
}, 0.4).then(buffer => { }, 0.4).then(buffer => {

View file

@ -1,7 +1,8 @@
{ {
"compilerOptions": { "compilerOptions": {
"sourceMap": true, "sourceMap": true,
"declaration": true "declaration": true,
"noUnusedLocals": true,
}, },
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"include": [ "include": [