tone 14.8.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +313 -0
- package/LICENSE.md +21 -0
- package/README.md +255 -0
- package/Tone/classes.ts +7 -0
- package/Tone/component/analysis/Analyser.test.ts +78 -0
- package/Tone/component/analysis/Analyser.ts +168 -0
- package/Tone/component/analysis/DCMeter.test.ts +34 -0
- package/Tone/component/analysis/DCMeter.ts +38 -0
- package/Tone/component/analysis/FFT.test.ts +83 -0
- package/Tone/component/analysis/FFT.ts +92 -0
- package/Tone/component/analysis/Follower.test.ts +111 -0
- package/Tone/component/analysis/Follower.ts +85 -0
- package/Tone/component/analysis/Meter.test.ts +91 -0
- package/Tone/component/analysis/Meter.ts +123 -0
- package/Tone/component/analysis/MeterBase.ts +45 -0
- package/Tone/component/analysis/Waveform.test.ts +49 -0
- package/Tone/component/analysis/Waveform.ts +57 -0
- package/Tone/component/channel/Channel.test.ts +77 -0
- package/Tone/component/channel/Channel.ts +178 -0
- package/Tone/component/channel/CrossFade.test.ts +57 -0
- package/Tone/component/channel/CrossFade.ts +143 -0
- package/Tone/component/channel/Merge.test.ts +59 -0
- package/Tone/component/channel/Merge.ts +62 -0
- package/Tone/component/channel/MidSideMerge.test.ts +28 -0
- package/Tone/component/channel/MidSideMerge.ts +105 -0
- package/Tone/component/channel/MidSideSplit.test.ts +79 -0
- package/Tone/component/channel/MidSideSplit.ts +90 -0
- package/Tone/component/channel/Mono.test.ts +43 -0
- package/Tone/component/channel/Mono.ts +55 -0
- package/Tone/component/channel/MultibandSplit.test.ts +66 -0
- package/Tone/component/channel/MultibandSplit.ts +166 -0
- package/Tone/component/channel/PanVol.test.ts +58 -0
- package/Tone/component/channel/PanVol.ts +110 -0
- package/Tone/component/channel/Panner.test.ts +86 -0
- package/Tone/component/channel/Panner.ts +89 -0
- package/Tone/component/channel/Panner3D.test.ts +77 -0
- package/Tone/component/channel/Panner3D.ts +234 -0
- package/Tone/component/channel/Recorder.test.ts +119 -0
- package/Tone/component/channel/Recorder.ts +162 -0
- package/Tone/component/channel/Solo.test.ts +138 -0
- package/Tone/component/channel/Solo.ts +148 -0
- package/Tone/component/channel/Split.test.ts +62 -0
- package/Tone/component/channel/Split.ts +51 -0
- package/Tone/component/channel/Volume.test.ts +129 -0
- package/Tone/component/channel/Volume.ts +109 -0
- package/Tone/component/dynamics/Compressor.test.ts +85 -0
- package/Tone/component/dynamics/Compressor.ts +163 -0
- package/Tone/component/dynamics/Gate.test.ts +72 -0
- package/Tone/component/dynamics/Gate.ts +110 -0
- package/Tone/component/dynamics/Limiter.test.ts +43 -0
- package/Tone/component/dynamics/Limiter.ts +78 -0
- package/Tone/component/dynamics/MidSideCompressor.test.ts +59 -0
- package/Tone/component/dynamics/MidSideCompressor.ts +87 -0
- package/Tone/component/dynamics/MultibandCompressor.test.ts +54 -0
- package/Tone/component/dynamics/MultibandCompressor.ts +130 -0
- package/Tone/component/envelope/AmplitudeEnvelope.test.ts +92 -0
- package/Tone/component/envelope/AmplitudeEnvelope.ts +65 -0
- package/Tone/component/envelope/Envelope.test.ts +834 -0
- package/Tone/component/envelope/Envelope.ts +623 -0
- package/Tone/component/envelope/FrequencyEnvelope.test.ts +92 -0
- package/Tone/component/envelope/FrequencyEnvelope.ts +134 -0
- package/Tone/component/filter/BiquadFilter.test.ts +94 -0
- package/Tone/component/filter/BiquadFilter.ts +158 -0
- package/Tone/component/filter/Convolver.test.ts +106 -0
- package/Tone/component/filter/Convolver.ts +134 -0
- package/Tone/component/filter/EQ3.test.ts +60 -0
- package/Tone/component/filter/EQ3.ts +163 -0
- package/Tone/component/filter/FeedbackCombFilter.test.ts +80 -0
- package/Tone/component/filter/FeedbackCombFilter.ts +105 -0
- package/Tone/component/filter/FeedbackCombFilter.worklet.ts +39 -0
- package/Tone/component/filter/Filter.test.ts +114 -0
- package/Tone/component/filter/Filter.ts +202 -0
- package/Tone/component/filter/LowpassCombFilter.test.ts +75 -0
- package/Tone/component/filter/LowpassCombFilter.ts +100 -0
- package/Tone/component/filter/OnePoleFilter.test.ts +90 -0
- package/Tone/component/filter/OnePoleFilter.ts +146 -0
- package/Tone/component/filter/PhaseShiftAllpass.test.ts +71 -0
- package/Tone/component/filter/PhaseShiftAllpass.ts +81 -0
- package/Tone/component/index.ts +39 -0
- package/Tone/core/Global.ts +73 -0
- package/Tone/core/Tone.ts +107 -0
- package/Tone/core/clock/Clock.test.ts +663 -0
- package/Tone/core/clock/Clock.ts +317 -0
- package/Tone/core/clock/TickParam.test.ts +15 -0
- package/Tone/core/clock/TickParam.ts +271 -0
- package/Tone/core/clock/TickSignal.test.ts +455 -0
- package/Tone/core/clock/TickSignal.ts +94 -0
- package/Tone/core/clock/TickSource.test.ts +655 -0
- package/Tone/core/clock/TickSource.ts +338 -0
- package/Tone/core/clock/Ticker.test.ts +86 -0
- package/Tone/core/clock/Ticker.ts +149 -0
- package/Tone/core/clock/Transport.test.ts +972 -0
- package/Tone/core/clock/Transport.ts +731 -0
- package/Tone/core/clock/TransportEvent.test.ts +45 -0
- package/Tone/core/clock/TransportEvent.ts +105 -0
- package/Tone/core/clock/TransportRepeatEvent.test.ts +43 -0
- package/Tone/core/clock/TransportRepeatEvent.ts +150 -0
- package/Tone/core/context/AbstractParam.ts +260 -0
- package/Tone/core/context/AudioContext.ts +60 -0
- package/Tone/core/context/BaseContext.ts +162 -0
- package/Tone/core/context/Context.test.ts +358 -0
- package/Tone/core/context/Context.ts +628 -0
- package/Tone/core/context/ContextInitialization.ts +42 -0
- package/Tone/core/context/Delay.test.ts +105 -0
- package/Tone/core/context/Delay.ts +103 -0
- package/Tone/core/context/Destination.test.ts +76 -0
- package/Tone/core/context/Destination.ts +128 -0
- package/Tone/core/context/DummyContext.test.ts +47 -0
- package/Tone/core/context/DummyContext.ts +201 -0
- package/Tone/core/context/Gain.test.ts +75 -0
- package/Tone/core/context/Gain.ts +90 -0
- package/Tone/core/context/Listener.test.ts +22 -0
- package/Tone/core/context/Listener.ts +117 -0
- package/Tone/core/context/Offline.test.ts +79 -0
- package/Tone/core/context/Offline.ts +65 -0
- package/Tone/core/context/OfflineContext.test.ts +64 -0
- package/Tone/core/context/OfflineContext.ts +118 -0
- package/Tone/core/context/Param.test.ts +607 -0
- package/Tone/core/context/Param.ts +541 -0
- package/Tone/core/context/ToneAudioBuffer.test.ts +360 -0
- package/Tone/core/context/ToneAudioBuffer.ts +412 -0
- package/Tone/core/context/ToneAudioBuffers.test.ts +159 -0
- package/Tone/core/context/ToneAudioBuffers.ts +167 -0
- package/Tone/core/context/ToneAudioNode.test.ts +345 -0
- package/Tone/core/context/ToneAudioNode.ts +396 -0
- package/Tone/core/context/ToneWithContext.ts +205 -0
- package/Tone/core/index.ts +38 -0
- package/Tone/core/type/Conversions.test.ts +34 -0
- package/Tone/core/type/Conversions.ts +78 -0
- package/Tone/core/type/Frequency.test.ts +220 -0
- package/Tone/core/type/Frequency.ts +249 -0
- package/Tone/core/type/Midi.test.ts +137 -0
- package/Tone/core/type/Midi.ts +82 -0
- package/Tone/core/type/NoteUnits.ts +36 -0
- package/Tone/core/type/Ticks.test.ts +190 -0
- package/Tone/core/type/Ticks.ts +69 -0
- package/Tone/core/type/Time.test.ts +181 -0
- package/Tone/core/type/Time.ts +156 -0
- package/Tone/core/type/TimeBase.ts +324 -0
- package/Tone/core/type/TransportTime.test.ts +184 -0
- package/Tone/core/type/TransportTime.ts +34 -0
- package/Tone/core/type/Units.ts +204 -0
- package/Tone/core/util/AdvancedTypeCheck.ts +40 -0
- package/Tone/core/util/Debug.test.ts +74 -0
- package/Tone/core/util/Debug.ts +63 -0
- package/Tone/core/util/Decorator.ts +51 -0
- package/Tone/core/util/Defaults.ts +123 -0
- package/Tone/core/util/Draw.test.ts +72 -0
- package/Tone/core/util/Draw.ts +125 -0
- package/Tone/core/util/Emitter.test.ts +109 -0
- package/Tone/core/util/Emitter.ts +125 -0
- package/Tone/core/util/Interface.ts +45 -0
- package/Tone/core/util/IntervalTimeline.test.ts +465 -0
- package/Tone/core/util/IntervalTimeline.ts +569 -0
- package/Tone/core/util/Math.ts +40 -0
- package/Tone/core/util/StateTimeline.test.ts +103 -0
- package/Tone/core/util/StateTimeline.ts +96 -0
- package/Tone/core/util/Timeline.test.ts +606 -0
- package/Tone/core/util/Timeline.ts +399 -0
- package/Tone/core/util/TimelineValue.test.ts +29 -0
- package/Tone/core/util/TimelineValue.ts +56 -0
- package/Tone/core/util/TypeCheck.ts +65 -0
- package/Tone/core/util/global.d.ts +7 -0
- package/Tone/core/worklet/DelayLine.worklet.ts +49 -0
- package/Tone/core/worklet/SingleIOProcessor.worklet.ts +73 -0
- package/Tone/core/worklet/ToneAudioWorklet.ts +76 -0
- package/Tone/core/worklet/ToneAudioWorkletProcessor.worklet.ts +35 -0
- package/Tone/core/worklet/WorkletGlobalScope.ts +26 -0
- package/Tone/effect/AutoFilter.test.ts +113 -0
- package/Tone/effect/AutoFilter.ts +102 -0
- package/Tone/effect/AutoPanner.test.ts +90 -0
- package/Tone/effect/AutoPanner.ts +63 -0
- package/Tone/effect/AutoWah.test.ts +61 -0
- package/Tone/effect/AutoWah.ts +208 -0
- package/Tone/effect/BitCrusher.test.ts +42 -0
- package/Tone/effect/BitCrusher.ts +129 -0
- package/Tone/effect/BitCrusher.worklet.ts +27 -0
- package/Tone/effect/Chebyshev.test.ts +49 -0
- package/Tone/effect/Chebyshev.ts +123 -0
- package/Tone/effect/Chorus.test.ts +87 -0
- package/Tone/effect/Chorus.ts +225 -0
- package/Tone/effect/Distortion.test.ts +41 -0
- package/Tone/effect/Distortion.ts +98 -0
- package/Tone/effect/Effect.ts +88 -0
- package/Tone/effect/FeedbackDelay.test.ts +75 -0
- package/Tone/effect/FeedbackDelay.ts +73 -0
- package/Tone/effect/FeedbackEffect.ts +68 -0
- package/Tone/effect/Freeverb.test.ts +45 -0
- package/Tone/effect/Freeverb.ts +137 -0
- package/Tone/effect/FrequencyShifter.test.ts +55 -0
- package/Tone/effect/FrequencyShifter.ts +155 -0
- package/Tone/effect/JCReverb.test.ts +41 -0
- package/Tone/effect/JCReverb.ts +130 -0
- package/Tone/effect/LFOEffect.ts +115 -0
- package/Tone/effect/MidSideEffect.ts +93 -0
- package/Tone/effect/Phaser.test.ts +44 -0
- package/Tone/effect/Phaser.ts +187 -0
- package/Tone/effect/PingPongDelay.test.ts +41 -0
- package/Tone/effect/PingPongDelay.ts +105 -0
- package/Tone/effect/PitchShift.test.ts +66 -0
- package/Tone/effect/PitchShift.ts +218 -0
- package/Tone/effect/Reverb.test.ts +75 -0
- package/Tone/effect/Reverb.ts +145 -0
- package/Tone/effect/StereoEffect.ts +99 -0
- package/Tone/effect/StereoFeedbackEffect.ts +91 -0
- package/Tone/effect/StereoWidener.test.ts +41 -0
- package/Tone/effect/StereoWidener.ts +112 -0
- package/Tone/effect/StereoXFeedbackEffect.ts +37 -0
- package/Tone/effect/Tremolo.test.ts +88 -0
- package/Tone/effect/Tremolo.ts +191 -0
- package/Tone/effect/Vibrato.test.ts +52 -0
- package/Tone/effect/Vibrato.ts +104 -0
- package/Tone/effect/index.ts +18 -0
- package/Tone/event/Loop.test.ts +334 -0
- package/Tone/event/Loop.ts +210 -0
- package/Tone/event/Part.test.ts +848 -0
- package/Tone/event/Part.ts +473 -0
- package/Tone/event/Pattern.test.ts +137 -0
- package/Tone/event/Pattern.ts +121 -0
- package/Tone/event/PatternGenerator.test.ts +95 -0
- package/Tone/event/PatternGenerator.ts +176 -0
- package/Tone/event/Sequence.test.ts +453 -0
- package/Tone/event/Sequence.ts +300 -0
- package/Tone/event/ToneEvent.test.ts +485 -0
- package/Tone/event/ToneEvent.ts +392 -0
- package/Tone/event/index.ts +5 -0
- package/Tone/fromContext.test.ts +29 -0
- package/Tone/fromContext.ts +77 -0
- package/Tone/index.test.ts +54 -0
- package/Tone/index.ts +116 -0
- package/Tone/instrument/AMSynth.test.ts +79 -0
- package/Tone/instrument/AMSynth.ts +51 -0
- package/Tone/instrument/DuoSynth.test.ts +95 -0
- package/Tone/instrument/DuoSynth.ts +216 -0
- package/Tone/instrument/FMSynth.test.ts +72 -0
- package/Tone/instrument/FMSynth.ts +65 -0
- package/Tone/instrument/Instrument.ts +180 -0
- package/Tone/instrument/MembraneSynth.test.ts +74 -0
- package/Tone/instrument/MembraneSynth.ts +96 -0
- package/Tone/instrument/MetalSynth.test.ts +66 -0
- package/Tone/instrument/MetalSynth.ts +272 -0
- package/Tone/instrument/ModulationSynth.ts +217 -0
- package/Tone/instrument/MonoSynth.test.ts +88 -0
- package/Tone/instrument/MonoSynth.ts +177 -0
- package/Tone/instrument/Monophonic.ts +135 -0
- package/Tone/instrument/NoiseSynth.test.ts +82 -0
- package/Tone/instrument/NoiseSynth.ts +127 -0
- package/Tone/instrument/PluckSynth.test.ts +62 -0
- package/Tone/instrument/PluckSynth.ts +127 -0
- package/Tone/instrument/PolySynth.test.ts +298 -0
- package/Tone/instrument/PolySynth.ts +393 -0
- package/Tone/instrument/Sampler.test.ts +275 -0
- package/Tone/instrument/Sampler.ts +329 -0
- package/Tone/instrument/Synth.test.ts +132 -0
- package/Tone/instrument/Synth.ts +141 -0
- package/Tone/instrument/index.ts +11 -0
- package/Tone/signal/Abs.test.ts +42 -0
- package/Tone/signal/Abs.ts +53 -0
- package/Tone/signal/Add.test.ts +60 -0
- package/Tone/signal/Add.ts +63 -0
- package/Tone/signal/AudioToGain.test.ts +53 -0
- package/Tone/signal/AudioToGain.ts +40 -0
- package/Tone/signal/GainToAudio.test.ts +41 -0
- package/Tone/signal/GainToAudio.ts +40 -0
- package/Tone/signal/GreaterThan.test.ts +81 -0
- package/Tone/signal/GreaterThan.ts +88 -0
- package/Tone/signal/GreaterThanZero.test.ts +49 -0
- package/Tone/signal/GreaterThanZero.ts +67 -0
- package/Tone/signal/Multiply.test.ts +46 -0
- package/Tone/signal/Multiply.ts +85 -0
- package/Tone/signal/Negate.test.ts +30 -0
- package/Tone/signal/Negate.ts +41 -0
- package/Tone/signal/Pow.test.ts +40 -0
- package/Tone/signal/Pow.ts +84 -0
- package/Tone/signal/Scale.test.ts +58 -0
- package/Tone/signal/Scale.ts +119 -0
- package/Tone/signal/ScaleExp.test.ts +49 -0
- package/Tone/signal/ScaleExp.ts +69 -0
- package/Tone/signal/Signal.test.ts +519 -0
- package/Tone/signal/Signal.ts +226 -0
- package/Tone/signal/SignalOperator.ts +21 -0
- package/Tone/signal/Subtract.test.ts +60 -0
- package/Tone/signal/Subtract.ts +74 -0
- package/Tone/signal/SyncedSignal.test.ts +245 -0
- package/Tone/signal/SyncedSignal.ts +172 -0
- package/Tone/signal/ToneConstantSource.test.ts +202 -0
- package/Tone/signal/ToneConstantSource.ts +90 -0
- package/Tone/signal/WaveShaper.test.ts +95 -0
- package/Tone/signal/WaveShaper.ts +136 -0
- package/Tone/signal/Zero.test.ts +25 -0
- package/Tone/signal/Zero.ts +45 -0
- package/Tone/signal/index.ts +16 -0
- package/Tone/source/Noise.test.ts +121 -0
- package/Tone/source/Noise.ts +287 -0
- package/Tone/source/OneShotSource.ts +260 -0
- package/Tone/source/Source.test.ts +408 -0
- package/Tone/source/Source.ts +339 -0
- package/Tone/source/UserMedia.test.ts +177 -0
- package/Tone/source/UserMedia.ts +260 -0
- package/Tone/source/buffer/GrainPlayer.test.ts +235 -0
- package/Tone/source/buffer/GrainPlayer.ts +322 -0
- package/Tone/source/buffer/Player.test.ts +651 -0
- package/Tone/source/buffer/Player.ts +440 -0
- package/Tone/source/buffer/Players.test.ts +288 -0
- package/Tone/source/buffer/Players.ts +235 -0
- package/Tone/source/buffer/ToneBufferSource.test.ts +578 -0
- package/Tone/source/buffer/ToneBufferSource.ts +253 -0
- package/Tone/source/index.ts +15 -0
- package/Tone/source/oscillator/AMOscillator.test.ts +69 -0
- package/Tone/source/oscillator/AMOscillator.ts +222 -0
- package/Tone/source/oscillator/FMOscillator.test.ts +85 -0
- package/Tone/source/oscillator/FMOscillator.ts +236 -0
- package/Tone/source/oscillator/FatOscillator.test.ts +91 -0
- package/Tone/source/oscillator/FatOscillator.ts +255 -0
- package/Tone/source/oscillator/LFO.test.ts +234 -0
- package/Tone/source/oscillator/LFO.ts +332 -0
- package/Tone/source/oscillator/OmniOscillator.test.ts +303 -0
- package/Tone/source/oscillator/OmniOscillator.ts +428 -0
- package/Tone/source/oscillator/Oscillator.test.ts +278 -0
- package/Tone/source/oscillator/Oscillator.ts +448 -0
- package/Tone/source/oscillator/OscillatorInterface.ts +462 -0
- package/Tone/source/oscillator/PWMOscillator.test.ts +49 -0
- package/Tone/source/oscillator/PWMOscillator.ts +190 -0
- package/Tone/source/oscillator/PulseOscillator.test.ts +126 -0
- package/Tone/source/oscillator/PulseOscillator.ts +225 -0
- package/Tone/source/oscillator/ToneOscillatorNode.test.ts +241 -0
- package/Tone/source/oscillator/ToneOscillatorNode.ts +131 -0
- package/Tone/version.ts +1 -0
- package/build/Tone.js +22 -0
- package/build/Tone.js.map +1 -0
- package/build/esm/classes.d.ts +7 -0
- package/build/esm/classes.js +8 -0
- package/build/esm/classes.js.map +1 -0
- package/build/esm/component/analysis/Analyser.d.ts +77 -0
- package/build/esm/component/analysis/Analyser.js +121 -0
- package/build/esm/component/analysis/Analyser.js.map +1 -0
- package/build/esm/component/analysis/DCMeter.d.ts +23 -0
- package/build/esm/component/analysis/DCMeter.js +31 -0
- package/build/esm/component/analysis/DCMeter.js.map +1 -0
- package/build/esm/component/analysis/FFT.d.ts +50 -0
- package/build/esm/component/analysis/FFT.js +65 -0
- package/build/esm/component/analysis/FFT.js.map +1 -0
- package/build/esm/component/analysis/Follower.d.ts +44 -0
- package/build/esm/component/analysis/Follower.js +51 -0
- package/build/esm/component/analysis/Follower.js.map +1 -0
- package/build/esm/component/analysis/Meter.d.ts +62 -0
- package/build/esm/component/analysis/Meter.js +90 -0
- package/build/esm/component/analysis/Meter.js.map +1 -0
- package/build/esm/component/analysis/MeterBase.d.ts +23 -0
- package/build/esm/component/analysis/MeterBase.js +23 -0
- package/build/esm/component/analysis/MeterBase.js.map +1 -0
- package/build/esm/component/analysis/Waveform.d.ts +32 -0
- package/build/esm/component/analysis/Waveform.js +38 -0
- package/build/esm/component/analysis/Waveform.js.map +1 -0
- package/build/esm/component/channel/Channel.d.ts +91 -0
- package/build/esm/component/channel/Channel.js +124 -0
- package/build/esm/component/channel/Channel.js.map +1 -0
- package/build/esm/component/channel/CrossFade.d.ts +80 -0
- package/build/esm/component/channel/CrossFade.js +106 -0
- package/build/esm/component/channel/CrossFade.js.map +1 -0
- package/build/esm/component/channel/Merge.d.ts +39 -0
- package/build/esm/component/channel/Merge.js +32 -0
- package/build/esm/component/channel/Merge.js.map +1 -0
- package/build/esm/component/channel/MidSideMerge.d.ts +52 -0
- package/build/esm/component/channel/MidSideMerge.js +53 -0
- package/build/esm/component/channel/MidSideMerge.js.map +1 -0
- package/build/esm/component/channel/MidSideSplit.d.ts +42 -0
- package/build/esm/component/channel/MidSideSplit.js +51 -0
- package/build/esm/component/channel/MidSideSplit.js.map +1 -0
- package/build/esm/component/channel/Mono.d.ts +26 -0
- package/build/esm/component/channel/Mono.js +30 -0
- package/build/esm/component/channel/Mono.js.map +1 -0
- package/build/esm/component/channel/MultibandSplit.d.ts +80 -0
- package/build/esm/component/channel/MultibandSplit.js +121 -0
- package/build/esm/component/channel/MultibandSplit.js.map +1 -0
- package/build/esm/component/channel/PanVol.d.ts +53 -0
- package/build/esm/component/channel/PanVol.js +61 -0
- package/build/esm/component/channel/PanVol.js.map +1 -0
- package/build/esm/component/channel/Panner.d.ts +49 -0
- package/build/esm/component/channel/Panner.js +55 -0
- package/build/esm/component/channel/Panner.js.map +1 -0
- package/build/esm/component/channel/Panner3D.d.ts +98 -0
- package/build/esm/component/channel/Panner3D.js +177 -0
- package/build/esm/component/channel/Panner3D.js.map +1 -0
- package/build/esm/component/channel/Recorder.d.ts +77 -0
- package/build/esm/component/channel/Recorder.js +131 -0
- package/build/esm/component/channel/Recorder.js.map +1 -0
- package/build/esm/component/channel/Solo.d.ts +68 -0
- package/build/esm/component/channel/Solo.js +121 -0
- package/build/esm/component/channel/Solo.js.map +1 -0
- package/build/esm/component/channel/Split.d.ts +29 -0
- package/build/esm/component/channel/Split.js +30 -0
- package/build/esm/component/channel/Split.js.map +1 -0
- package/build/esm/component/channel/Volume.d.ts +60 -0
- package/build/esm/component/channel/Volume.js +66 -0
- package/build/esm/component/channel/Volume.js.map +1 -0
- package/build/esm/component/dynamics/Compressor.d.ts +73 -0
- package/build/esm/component/dynamics/Compressor.js +99 -0
- package/build/esm/component/dynamics/Compressor.js.map +1 -0
- package/build/esm/component/dynamics/Gate.d.ts +53 -0
- package/build/esm/component/dynamics/Gate.js +72 -0
- package/build/esm/component/dynamics/Gate.js.map +1 -0
- package/build/esm/component/dynamics/Limiter.d.ts +39 -0
- package/build/esm/component/dynamics/Limiter.js +51 -0
- package/build/esm/component/dynamics/Limiter.js.map +1 -0
- package/build/esm/component/dynamics/MidSideCompressor.d.ts +36 -0
- package/build/esm/component/dynamics/MidSideCompressor.js +52 -0
- package/build/esm/component/dynamics/MidSideCompressor.js.map +1 -0
- package/build/esm/component/dynamics/MultibandCompressor.d.ts +57 -0
- package/build/esm/component/dynamics/MultibandCompressor.js +79 -0
- package/build/esm/component/dynamics/MultibandCompressor.js.map +1 -0
- package/build/esm/component/envelope/AmplitudeEnvelope.d.ts +46 -0
- package/build/esm/component/envelope/AmplitudeEnvelope.js +49 -0
- package/build/esm/component/envelope/AmplitudeEnvelope.js.map +1 -0
- package/build/esm/component/envelope/Envelope.d.ts +302 -0
- package/build/esm/component/envelope/Envelope.js +470 -0
- package/build/esm/component/envelope/Envelope.js.map +1 -0
- package/build/esm/component/envelope/FrequencyEnvelope.d.ts +71 -0
- package/build/esm/component/envelope/FrequencyEnvelope.js +91 -0
- package/build/esm/component/envelope/FrequencyEnvelope.js.map +1 -0
- package/build/esm/component/filter/BiquadFilter.d.ts +64 -0
- package/build/esm/component/filter/BiquadFilter.js +101 -0
- package/build/esm/component/filter/BiquadFilter.js.map +1 -0
- package/build/esm/component/filter/Convolver.d.ts +59 -0
- package/build/esm/component/filter/Convolver.js +104 -0
- package/build/esm/component/filter/Convolver.js.map +1 -0
- package/build/esm/component/filter/EQ3.d.ts +77 -0
- package/build/esm/component/filter/EQ3.js +81 -0
- package/build/esm/component/filter/EQ3.js.map +1 -0
- package/build/esm/component/filter/FeedbackCombFilter.d.ts +45 -0
- package/build/esm/component/filter/FeedbackCombFilter.js +72 -0
- package/build/esm/component/filter/FeedbackCombFilter.js.map +1 -0
- package/build/esm/component/filter/FeedbackCombFilter.worklet.d.ts +3 -0
- package/build/esm/component/filter/FeedbackCombFilter.worklet.js +37 -0
- package/build/esm/component/filter/FeedbackCombFilter.worklet.js.map +1 -0
- package/build/esm/component/filter/Filter.d.ts +79 -0
- package/build/esm/component/filter/Filter.js +150 -0
- package/build/esm/component/filter/Filter.js.map +1 -0
- package/build/esm/component/filter/LowpassCombFilter.d.ts +50 -0
- package/build/esm/component/filter/LowpassCombFilter.js +53 -0
- package/build/esm/component/filter/LowpassCombFilter.js.map +1 -0
- package/build/esm/component/filter/OnePoleFilter.d.ts +64 -0
- package/build/esm/component/filter/OnePoleFilter.js +104 -0
- package/build/esm/component/filter/OnePoleFilter.js.map +1 -0
- package/build/esm/component/filter/PhaseShiftAllpass.d.ts +40 -0
- package/build/esm/component/filter/PhaseShiftAllpass.js +54 -0
- package/build/esm/component/filter/PhaseShiftAllpass.js.map +1 -0
- package/build/esm/component/index.d.ts +35 -0
- package/build/esm/component/index.js +36 -0
- package/build/esm/component/index.js.map +1 -0
- package/build/esm/core/Global.d.ts +26 -0
- package/build/esm/core/Global.js +69 -0
- package/build/esm/core/Global.js.map +1 -0
- package/build/esm/core/Tone.d.ts +60 -0
- package/build/esm/core/Tone.js +87 -0
- package/build/esm/core/Tone.js.map +1 -0
- package/build/esm/core/clock/Clock.d.ts +156 -0
- package/build/esm/core/clock/Clock.js +251 -0
- package/build/esm/core/clock/Clock.js.map +1 -0
- package/build/esm/core/clock/TickParam.d.ts +97 -0
- package/build/esm/core/clock/TickParam.js +237 -0
- package/build/esm/core/clock/TickParam.js.map +1 -0
- package/build/esm/core/clock/TickSignal.d.ts +43 -0
- package/build/esm/core/clock/TickSignal.js +64 -0
- package/build/esm/core/clock/TickSignal.js.map +1 -0
- package/build/esm/core/clock/TickSource.d.ts +115 -0
- package/build/esm/core/clock/TickSource.js +284 -0
- package/build/esm/core/clock/TickSource.js.map +1 -0
- package/build/esm/core/clock/Ticker.d.ts +59 -0
- package/build/esm/core/clock/Ticker.js +110 -0
- package/build/esm/core/clock/Ticker.js.map +1 -0
- package/build/esm/core/clock/Transport.d.ts +331 -0
- package/build/esm/core/clock/Transport.js +591 -0
- package/build/esm/core/clock/Transport.js.map +1 -0
- package/build/esm/core/clock/TransportEvent.d.ts +62 -0
- package/build/esm/core/clock/TransportEvent.js +66 -0
- package/build/esm/core/clock/TransportEvent.js.map +1 -0
- package/build/esm/core/clock/TransportRepeatEvent.d.ts +70 -0
- package/build/esm/core/clock/TransportRepeatEvent.js +110 -0
- package/build/esm/core/clock/TransportRepeatEvent.js.map +1 -0
- package/build/esm/core/context/AbstractParam.d.ts +239 -0
- package/build/esm/core/context/AbstractParam.js +6 -0
- package/build/esm/core/context/AbstractParam.js.map +1 -0
- package/build/esm/core/context/AudioContext.d.ts +36 -0
- package/build/esm/core/context/AudioContext.js +38 -0
- package/build/esm/core/context/AudioContext.js.map +1 -0
- package/build/esm/core/context/BaseContext.d.ts +56 -0
- package/build/esm/core/context/BaseContext.js +16 -0
- package/build/esm/core/context/BaseContext.js.map +1 -0
- package/build/esm/core/context/Context.d.ts +255 -0
- package/build/esm/core/context/Context.js +474 -0
- package/build/esm/core/context/Context.js.map +1 -0
- package/build/esm/core/context/ContextInitialization.d.ts +15 -0
- package/build/esm/core/context/ContextInitialization.js +35 -0
- package/build/esm/core/context/ContextInitialization.js.map +1 -0
- package/build/esm/core/context/Delay.d.ts +58 -0
- package/build/esm/core/context/Delay.js +58 -0
- package/build/esm/core/context/Delay.js.map +1 -0
- package/build/esm/core/context/Destination.d.ts +73 -0
- package/build/esm/core/context/Destination.js +105 -0
- package/build/esm/core/context/Destination.js.map +1 -0
- package/build/esm/core/context/DummyContext.d.ts +54 -0
- package/build/esm/core/context/DummyContext.js +138 -0
- package/build/esm/core/context/DummyContext.js.map +1 -0
- package/build/esm/core/context/Gain.d.ts +53 -0
- package/build/esm/core/context/Gain.js +58 -0
- package/build/esm/core/context/Gain.js.map +1 -0
- package/build/esm/core/context/Listener.d.ts +38 -0
- package/build/esm/core/context/Listener.js +87 -0
- package/build/esm/core/context/Listener.js.map +1 -0
- package/build/esm/core/context/Offline.d.ts +37 -0
- package/build/esm/core/context/Offline.js +56 -0
- package/build/esm/core/context/Offline.js.map +1 -0
- package/build/esm/core/context/OfflineContext.d.ts +58 -0
- package/build/esm/core/context/OfflineContext.js +87 -0
- package/build/esm/core/context/OfflineContext.js.map +1 -0
- package/build/esm/core/context/Param.d.ts +132 -0
- package/build/esm/core/context/Param.js +446 -0
- package/build/esm/core/context/Param.js.map +1 -0
- package/build/esm/core/context/ToneAudioBuffer.d.ts +162 -0
- package/build/esm/core/context/ToneAudioBuffer.js +364 -0
- package/build/esm/core/context/ToneAudioBuffer.js.map +1 -0
- package/build/esm/core/context/ToneAudioBuffers.d.ts +89 -0
- package/build/esm/core/context/ToneAudioBuffers.js +119 -0
- package/build/esm/core/context/ToneAudioBuffers.js.map +1 -0
- package/build/esm/core/context/ToneAudioNode.d.ts +173 -0
- package/build/esm/core/context/ToneAudioNode.js +342 -0
- package/build/esm/core/context/ToneAudioNode.js.map +1 -0
- package/build/esm/core/context/ToneWithContext.d.ts +108 -0
- package/build/esm/core/context/ToneWithContext.js +170 -0
- package/build/esm/core/context/ToneWithContext.js.map +1 -0
- package/build/esm/core/index.d.ts +28 -0
- package/build/esm/core/index.js +33 -0
- package/build/esm/core/index.js.map +1 -0
- package/build/esm/core/type/Conversions.d.ts +44 -0
- package/build/esm/core/type/Conversions.js +68 -0
- package/build/esm/core/type/Conversions.js.map +1 -0
- package/build/esm/core/type/Frequency.d.ts +101 -0
- package/build/esm/core/type/Frequency.js +225 -0
- package/build/esm/core/type/Frequency.js.map +1 -0
- package/build/esm/core/type/Midi.d.ts +53 -0
- package/build/esm/core/type/Midi.js +73 -0
- package/build/esm/core/type/Midi.js.map +1 -0
- package/build/esm/core/type/NoteUnits.d.ts +12 -0
- package/build/esm/core/type/NoteUnits.js +3 -0
- package/build/esm/core/type/NoteUnits.js.map +1 -0
- package/build/esm/core/type/Ticks.d.ts +44 -0
- package/build/esm/core/type/Ticks.js +61 -0
- package/build/esm/core/type/Ticks.js.map +1 -0
- package/build/esm/core/type/Time.d.ts +69 -0
- package/build/esm/core/type/Time.js +147 -0
- package/build/esm/core/type/Time.js.map +1 -0
- package/build/esm/core/type/TimeBase.d.ts +120 -0
- package/build/esm/core/type/TimeBase.js +251 -0
- package/build/esm/core/type/TimeBase.js.map +1 -0
- package/build/esm/core/type/TransportTime.d.ts +25 -0
- package/build/esm/core/type/TransportTime.js +32 -0
- package/build/esm/core/type/TransportTime.js.map +1 -0
- package/build/esm/core/type/Units.d.ts +176 -0
- package/build/esm/core/type/Units.js +2 -0
- package/build/esm/core/type/Units.js.map +1 -0
- package/build/esm/core/util/AdvancedTypeCheck.d.ts +21 -0
- package/build/esm/core/util/AdvancedTypeCheck.js +32 -0
- package/build/esm/core/util/AdvancedTypeCheck.js.map +1 -0
- package/build/esm/core/util/Debug.d.ts +34 -0
- package/build/esm/core/util/Debug.js +50 -0
- package/build/esm/core/util/Debug.js.map +1 -0
- package/build/esm/core/util/Decorator.d.ts +9 -0
- package/build/esm/core/util/Decorator.js +41 -0
- package/build/esm/core/util/Decorator.js.map +1 -0
- package/build/esm/core/util/Defaults.d.ts +32 -0
- package/build/esm/core/util/Defaults.js +99 -0
- package/build/esm/core/util/Defaults.js.map +1 -0
- package/build/esm/core/util/Draw.d.ts +67 -0
- package/build/esm/core/util/Draw.js +110 -0
- package/build/esm/core/util/Draw.js.map +1 -0
- package/build/esm/core/util/Emitter.d.ts +52 -0
- package/build/esm/core/util/Emitter.js +113 -0
- package/build/esm/core/util/Emitter.js.map +1 -0
- package/build/esm/core/util/Interface.d.ts +16 -0
- package/build/esm/core/util/Interface.js +32 -0
- package/build/esm/core/util/Interface.js.map +1 -0
- package/build/esm/core/util/IntervalTimeline.d.ts +106 -0
- package/build/esm/core/util/IntervalTimeline.js +539 -0
- package/build/esm/core/util/IntervalTimeline.js.map +1 -0
- package/build/esm/core/util/Math.d.ts +20 -0
- package/build/esm/core/util/Math.js +36 -0
- package/build/esm/core/util/Math.js.map +1 -0
- package/build/esm/core/util/StateTimeline.d.ts +47 -0
- package/build/esm/core/util/StateTimeline.js +78 -0
- package/build/esm/core/util/StateTimeline.js.map +1 -0
- package/build/esm/core/util/Timeline.d.ts +156 -0
- package/build/esm/core/util/Timeline.js +351 -0
- package/build/esm/core/util/Timeline.js.map +1 -0
- package/build/esm/core/util/TimelineValue.d.ts +28 -0
- package/build/esm/core/util/TimelineValue.js +41 -0
- package/build/esm/core/util/TimelineValue.js.map +1 -0
- package/build/esm/core/util/TypeCheck.d.ts +38 -0
- package/build/esm/core/util/TypeCheck.js +56 -0
- package/build/esm/core/util/TypeCheck.js.map +1 -0
- package/build/esm/core/worklet/DelayLine.worklet.d.ts +1 -0
- package/build/esm/core/worklet/DelayLine.worklet.js +48 -0
- package/build/esm/core/worklet/DelayLine.worklet.js.map +1 -0
- package/build/esm/core/worklet/SingleIOProcessor.worklet.d.ts +2 -0
- package/build/esm/core/worklet/SingleIOProcessor.worklet.js +72 -0
- package/build/esm/core/worklet/SingleIOProcessor.worklet.js.map +1 -0
- package/build/esm/core/worklet/ToneAudioWorklet.d.ts +35 -0
- package/build/esm/core/worklet/ToneAudioWorklet.js +40 -0
- package/build/esm/core/worklet/ToneAudioWorklet.js.map +1 -0
- package/build/esm/core/worklet/ToneAudioWorkletProcessor.worklet.d.ts +1 -0
- package/build/esm/core/worklet/ToneAudioWorkletProcessor.worklet.js +34 -0
- package/build/esm/core/worklet/ToneAudioWorkletProcessor.worklet.js.map +1 -0
- package/build/esm/core/worklet/WorkletGlobalScope.d.ts +12 -0
- package/build/esm/core/worklet/WorkletGlobalScope.js +24 -0
- package/build/esm/core/worklet/WorkletGlobalScope.js.map +1 -0
- package/build/esm/effect/AutoFilter.d.ts +51 -0
- package/build/esm/effect/AutoFilter.js +68 -0
- package/build/esm/effect/AutoFilter.js.map +1 -0
- package/build/esm/effect/AutoPanner.d.ts +31 -0
- package/build/esm/effect/AutoPanner.js +41 -0
- package/build/esm/effect/AutoPanner.js.map +1 -0
- package/build/esm/effect/AutoWah.d.ts +99 -0
- package/build/esm/effect/AutoWah.js +131 -0
- package/build/esm/effect/AutoWah.js.map +1 -0
- package/build/esm/effect/BitCrusher.d.ts +40 -0
- package/build/esm/effect/BitCrusher.js +85 -0
- package/build/esm/effect/BitCrusher.js.map +1 -0
- package/build/esm/effect/BitCrusher.worklet.d.ts +3 -0
- package/build/esm/effect/BitCrusher.worklet.js +25 -0
- package/build/esm/effect/BitCrusher.worklet.js.map +1 -0
- package/build/esm/effect/Chebyshev.d.ts +62 -0
- package/build/esm/effect/Chebyshev.js +95 -0
- package/build/esm/effect/Chebyshev.js.map +1 -0
- package/build/esm/effect/Chorus.d.ts +104 -0
- package/build/esm/effect/Chorus.js +157 -0
- package/build/esm/effect/Chorus.js.map +1 -0
- package/build/esm/effect/Distortion.d.ts +43 -0
- package/build/esm/effect/Distortion.js +69 -0
- package/build/esm/effect/Distortion.js.map +1 -0
- package/build/esm/effect/Effect.d.ts +49 -0
- package/build/esm/effect/Effect.js +70 -0
- package/build/esm/effect/Effect.js.map +1 -0
- package/build/esm/effect/FeedbackDelay.d.ts +37 -0
- package/build/esm/effect/FeedbackDelay.js +47 -0
- package/build/esm/effect/FeedbackDelay.js.map +1 -0
- package/build/esm/effect/FeedbackEffect.d.ts +34 -0
- package/build/esm/effect/FeedbackEffect.js +34 -0
- package/build/esm/effect/FeedbackEffect.js.map +1 -0
- package/build/esm/effect/Freeverb.d.ts +51 -0
- package/build/esm/effect/Freeverb.js +104 -0
- package/build/esm/effect/Freeverb.js.map +1 -0
- package/build/esm/effect/FrequencyShifter.d.ts +68 -0
- package/build/esm/effect/FrequencyShifter.js +88 -0
- package/build/esm/effect/FrequencyShifter.js.map +1 -0
- package/build/esm/effect/JCReverb.d.ts +46 -0
- package/build/esm/effect/JCReverb.js +97 -0
- package/build/esm/effect/JCReverb.js.map +1 -0
- package/build/esm/effect/LFOEffect.d.ts +58 -0
- package/build/esm/effect/LFOEffect.js +77 -0
- package/build/esm/effect/LFOEffect.js.map +1 -0
- package/build/esm/effect/MidSideEffect.d.ts +50 -0
- package/build/esm/effect/MidSideEffect.js +51 -0
- package/build/esm/effect/MidSideEffect.js.map +1 -0
- package/build/esm/effect/Phaser.d.ts +80 -0
- package/build/esm/effect/Phaser.js +119 -0
- package/build/esm/effect/Phaser.js.map +1 -0
- package/build/esm/effect/PingPongDelay.d.ts +48 -0
- package/build/esm/effect/PingPongDelay.js +66 -0
- package/build/esm/effect/PingPongDelay.js.map +1 -0
- package/build/esm/effect/PitchShift.d.ts +89 -0
- package/build/esm/effect/PitchShift.js +140 -0
- package/build/esm/effect/PitchShift.js.map +1 -0
- package/build/esm/effect/Reverb.d.ts +62 -0
- package/build/esm/effect/Reverb.js +111 -0
- package/build/esm/effect/Reverb.js.map +1 -0
- package/build/esm/effect/StereoEffect.d.ts +44 -0
- package/build/esm/effect/StereoEffect.js +61 -0
- package/build/esm/effect/StereoEffect.js.map +1 -0
- package/build/esm/effect/StereoFeedbackEffect.d.ts +39 -0
- package/build/esm/effect/StereoFeedbackEffect.js +49 -0
- package/build/esm/effect/StereoFeedbackEffect.js.map +1 -0
- package/build/esm/effect/StereoWidener.d.ts +50 -0
- package/build/esm/effect/StereoWidener.js +65 -0
- package/build/esm/effect/StereoWidener.js.map +1 -0
- package/build/esm/effect/StereoXFeedbackEffect.d.ts +21 -0
- package/build/esm/effect/StereoXFeedbackEffect.js +28 -0
- package/build/esm/effect/StereoXFeedbackEffect.js.map +1 -0
- package/build/esm/effect/Tremolo.d.ts +86 -0
- package/build/esm/effect/Tremolo.js +131 -0
- package/build/esm/effect/Tremolo.js.map +1 -0
- package/build/esm/effect/Vibrato.d.ts +48 -0
- package/build/esm/effect/Vibrato.js +61 -0
- package/build/esm/effect/Vibrato.js.map +1 -0
- package/build/esm/effect/index.d.ts +18 -0
- package/build/esm/effect/index.js +19 -0
- package/build/esm/effect/index.js.map +1 -0
- package/build/esm/event/Loop.d.ts +107 -0
- package/build/esm/event/Loop.js +164 -0
- package/build/esm/event/Loop.js.map +1 -0
- package/build/esm/event/Part.d.ts +193 -0
- package/build/esm/event/Part.js +401 -0
- package/build/esm/event/Part.js.map +1 -0
- package/build/esm/event/Pattern.d.ts +67 -0
- package/build/esm/event/Pattern.js +67 -0
- package/build/esm/event/Pattern.js.map +1 -0
- package/build/esm/event/PatternGenerator.d.ts +12 -0
- package/build/esm/event/PatternGenerator.js +165 -0
- package/build/esm/event/PatternGenerator.js.map +1 -0
- package/build/esm/event/Sequence.d.ts +127 -0
- package/build/esm/event/Sequence.js +247 -0
- package/build/esm/event/Sequence.js.map +1 -0
- package/build/esm/event/ToneEvent.d.ts +188 -0
- package/build/esm/event/ToneEvent.js +299 -0
- package/build/esm/event/ToneEvent.js.map +1 -0
- package/build/esm/event/index.d.ts +5 -0
- package/build/esm/event/index.js +6 -0
- package/build/esm/event/index.js.map +1 -0
- package/build/esm/fromContext.d.ts +26 -0
- package/build/esm/fromContext.js +41 -0
- package/build/esm/fromContext.js.map +1 -0
- package/build/esm/index.d.ts +86 -0
- package/build/esm/index.js +102 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/instrument/AMSynth.d.ts +25 -0
- package/build/esm/instrument/AMSynth.js +37 -0
- package/build/esm/instrument/AMSynth.js.map +1 -0
- package/build/esm/instrument/DuoSynth.d.ts +72 -0
- package/build/esm/instrument/DuoSynth.js +140 -0
- package/build/esm/instrument/DuoSynth.js.map +1 -0
- package/build/esm/instrument/FMSynth.d.ts +31 -0
- package/build/esm/instrument/FMSynth.js +45 -0
- package/build/esm/instrument/FMSynth.js.map +1 -0
- package/build/esm/instrument/Instrument.d.ts +100 -0
- package/build/esm/instrument/Instrument.js +127 -0
- package/build/esm/instrument/Instrument.js.map +1 -0
- package/build/esm/instrument/MembraneSynth.d.ts +47 -0
- package/build/esm/instrument/MembraneSynth.js +69 -0
- package/build/esm/instrument/MembraneSynth.js.map +1 -0
- package/build/esm/instrument/MetalSynth.d.ts +109 -0
- package/build/esm/instrument/MetalSynth.js +198 -0
- package/build/esm/instrument/MetalSynth.js.map +1 -0
- package/build/esm/instrument/ModulationSynth.d.ts +81 -0
- package/build/esm/instrument/ModulationSynth.js +122 -0
- package/build/esm/instrument/ModulationSynth.js.map +1 -0
- package/build/esm/instrument/MonoSynth.d.ts +76 -0
- package/build/esm/instrument/MonoSynth.js +113 -0
- package/build/esm/instrument/MonoSynth.js.map +1 -0
- package/build/esm/instrument/Monophonic.d.ts +82 -0
- package/build/esm/instrument/Monophonic.js +83 -0
- package/build/esm/instrument/Monophonic.js.map +1 -0
- package/build/esm/instrument/NoiseSynth.d.ts +51 -0
- package/build/esm/instrument/NoiseSynth.js +93 -0
- package/build/esm/instrument/NoiseSynth.js.map +1 -0
- package/build/esm/instrument/PluckSynth.d.ts +57 -0
- package/build/esm/instrument/PluckSynth.js +80 -0
- package/build/esm/instrument/PluckSynth.js.map +1 -0
- package/build/esm/instrument/PolySynth.d.ts +176 -0
- package/build/esm/instrument/PolySynth.js +302 -0
- package/build/esm/instrument/PolySynth.js.map +1 -0
- package/build/esm/instrument/Sampler.d.ts +126 -0
- package/build/esm/instrument/Sampler.js +259 -0
- package/build/esm/instrument/Sampler.js.map +1 -0
- package/build/esm/instrument/Synth.d.ts +65 -0
- package/build/esm/instrument/Synth.js +91 -0
- package/build/esm/instrument/Synth.js.map +1 -0
- package/build/esm/instrument/index.d.ts +11 -0
- package/build/esm/instrument/index.js +12 -0
- package/build/esm/instrument/index.js.map +1 -0
- package/build/esm/signal/Abs.d.ts +34 -0
- package/build/esm/signal/Abs.js +51 -0
- package/build/esm/signal/Abs.js.map +1 -0
- package/build/esm/signal/Add.d.ts +40 -0
- package/build/esm/signal/Add.js +49 -0
- package/build/esm/signal/Add.js.map +1 -0
- package/build/esm/signal/AudioToGain.d.ts +27 -0
- package/build/esm/signal/AudioToGain.js +37 -0
- package/build/esm/signal/AudioToGain.js.map +1 -0
- package/build/esm/signal/GainToAudio.d.ts +27 -0
- package/build/esm/signal/GainToAudio.js +37 -0
- package/build/esm/signal/GainToAudio.js.map +1 -0
- package/build/esm/signal/GreaterThan.d.ts +47 -0
- package/build/esm/signal/GreaterThan.js +46 -0
- package/build/esm/signal/GreaterThan.js.map +1 -0
- package/build/esm/signal/GreaterThanZero.d.ts +29 -0
- package/build/esm/signal/GreaterThanZero.js +45 -0
- package/build/esm/signal/GreaterThanZero.js.map +1 -0
- package/build/esm/signal/Multiply.d.ts +52 -0
- package/build/esm/signal/Multiply.js +51 -0
- package/build/esm/signal/Multiply.js.map +1 -0
- package/build/esm/signal/Negate.d.ts +29 -0
- package/build/esm/signal/Negate.js +39 -0
- package/build/esm/signal/Negate.js.map +1 -0
- package/build/esm/signal/Pow.d.ts +42 -0
- package/build/esm/signal/Pow.js +58 -0
- package/build/esm/signal/Pow.js.map +1 -0
- package/build/esm/signal/Scale.d.ts +62 -0
- package/build/esm/signal/Scale.js +73 -0
- package/build/esm/signal/Scale.js.map +1 -0
- package/build/esm/signal/ScaleExp.d.ts +37 -0
- package/build/esm/signal/ScaleExp.js +46 -0
- package/build/esm/signal/ScaleExp.js.map +1 -0
- package/build/esm/signal/Signal.d.ts +92 -0
- package/build/esm/signal/Signal.js +183 -0
- package/build/esm/signal/Signal.js.map +1 -0
- package/build/esm/signal/SignalOperator.d.ts +9 -0
- package/build/esm/signal/SignalOperator.js +16 -0
- package/build/esm/signal/SignalOperator.js.map +1 -0
- package/build/esm/signal/Subtract.d.ts +48 -0
- package/build/esm/signal/Subtract.js +58 -0
- package/build/esm/signal/Subtract.js.map +1 -0
- package/build/esm/signal/SyncedSignal.d.ts +53 -0
- package/build/esm/signal/SyncedSignal.js +124 -0
- package/build/esm/signal/SyncedSignal.js.map +1 -0
- package/build/esm/signal/ToneConstantSource.d.ts +39 -0
- package/build/esm/signal/ToneConstantSource.js +61 -0
- package/build/esm/signal/ToneConstantSource.js.map +1 -0
- package/build/esm/signal/WaveShaper.d.ts +81 -0
- package/build/esm/signal/WaveShaper.js +99 -0
- package/build/esm/signal/WaveShaper.js.map +1 -0
- package/build/esm/signal/Zero.d.ts +29 -0
- package/build/esm/signal/Zero.js +38 -0
- package/build/esm/signal/Zero.js.map +1 -0
- package/build/esm/signal/index.d.ts +16 -0
- package/build/esm/signal/index.js +17 -0
- package/build/esm/signal/index.js.map +1 -0
- package/build/esm/source/Noise.d.ts +96 -0
- package/build/esm/source/Noise.js +225 -0
- package/build/esm/source/Noise.js.map +1 -0
- package/build/esm/source/OneShotSource.d.ts +102 -0
- package/build/esm/source/OneShotSource.js +183 -0
- package/build/esm/source/OneShotSource.js.map +1 -0
- package/build/esm/source/Source.d.ts +155 -0
- package/build/esm/source/Source.js +281 -0
- package/build/esm/source/Source.js.map +1 -0
- package/build/esm/source/UserMedia.d.ts +123 -0
- package/build/esm/source/UserMedia.js +214 -0
- package/build/esm/source/UserMedia.js.map +1 -0
- package/build/esm/source/buffer/GrainPlayer.d.ts +135 -0
- package/build/esm/source/buffer/GrainPlayer.js +235 -0
- package/build/esm/source/buffer/GrainPlayer.js.map +1 -0
- package/build/esm/source/buffer/Player.d.ts +190 -0
- package/build/esm/source/buffer/Player.js +352 -0
- package/build/esm/source/buffer/Player.js.map +1 -0
- package/build/esm/source/buffer/Players.d.ts +121 -0
- package/build/esm/source/buffer/Players.js +162 -0
- package/build/esm/source/buffer/Players.js.map +1 -0
- package/build/esm/source/buffer/ToneBufferSource.d.ts +97 -0
- package/build/esm/source/buffer/ToneBufferSource.js +196 -0
- package/build/esm/source/buffer/ToneBufferSource.js.map +1 -0
- package/build/esm/source/index.d.ts +15 -0
- package/build/esm/source/index.js +16 -0
- package/build/esm/source/index.js.map +1 -0
- package/build/esm/source/oscillator/AMOscillator.d.ts +101 -0
- package/build/esm/source/oscillator/AMOscillator.js +157 -0
- package/build/esm/source/oscillator/AMOscillator.js.map +1 -0
- package/build/esm/source/oscillator/FMOscillator.d.ts +101 -0
- package/build/esm/source/oscillator/FMOscillator.js +172 -0
- package/build/esm/source/oscillator/FMOscillator.js.map +1 -0
- package/build/esm/source/oscillator/FatOscillator.d.ts +99 -0
- package/build/esm/source/oscillator/FatOscillator.js +195 -0
- package/build/esm/source/oscillator/FatOscillator.js.map +1 -0
- package/build/esm/source/oscillator/LFO.d.ts +167 -0
- package/build/esm/source/oscillator/LFO.js +233 -0
- package/build/esm/source/oscillator/LFO.js.map +1 -0
- package/build/esm/source/oscillator/OmniOscillator.d.ts +162 -0
- package/build/esm/source/oscillator/OmniOscillator.js +348 -0
- package/build/esm/source/oscillator/OmniOscillator.js.map +1 -0
- package/build/esm/source/oscillator/Oscillator.d.ts +125 -0
- package/build/esm/source/oscillator/Oscillator.js +379 -0
- package/build/esm/source/oscillator/Oscillator.js.map +1 -0
- package/build/esm/source/oscillator/OscillatorInterface.d.ts +298 -0
- package/build/esm/source/oscillator/OscillatorInterface.js +22 -0
- package/build/esm/source/oscillator/OscillatorInterface.js.map +1 -0
- package/build/esm/source/oscillator/PWMOscillator.d.ts +94 -0
- package/build/esm/source/oscillator/PWMOscillator.js +136 -0
- package/build/esm/source/oscillator/PWMOscillator.js.map +1 -0
- package/build/esm/source/oscillator/PulseOscillator.d.ts +119 -0
- package/build/esm/source/oscillator/PulseOscillator.js +175 -0
- package/build/esm/source/oscillator/PulseOscillator.js.map +1 -0
- package/build/esm/source/oscillator/ToneOscillatorNode.d.ts +57 -0
- package/build/esm/source/oscillator/ToneOscillatorNode.js +90 -0
- package/build/esm/source/oscillator/ToneOscillatorNode.js.map +1 -0
- package/build/esm/version.d.ts +1 -0
- package/build/esm/version.js +2 -0
- package/build/esm/version.js.map +1 -0
- package/docs/tone.json +1 -0
- package/package.json +116 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import { dbToGain, gainToDb } from "../type/Conversions";
|
|
2
|
+
import { isAudioParam } from "../util/AdvancedTypeCheck";
|
|
3
|
+
import { optionsFromArguments } from "../util/Defaults";
|
|
4
|
+
import { Timeline } from "../util/Timeline";
|
|
5
|
+
import { isDefined } from "../util/TypeCheck";
|
|
6
|
+
import { ToneWithContext } from "./ToneWithContext";
|
|
7
|
+
import { EQ } from "../util/Math";
|
|
8
|
+
import { assert, assertRange } from "../util/Debug";
|
|
9
|
+
/**
|
|
10
|
+
* Param wraps the native Web Audio's AudioParam to provide
|
|
11
|
+
* additional unit conversion functionality. It also
|
|
12
|
+
* serves as a base-class for classes which have a single,
|
|
13
|
+
* automatable parameter.
|
|
14
|
+
* @category Core
|
|
15
|
+
*/
|
|
16
|
+
export class Param extends ToneWithContext {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(optionsFromArguments(Param.getDefaults(), arguments, ["param", "units", "convert"]));
|
|
19
|
+
this.name = "Param";
|
|
20
|
+
this.overridden = false;
|
|
21
|
+
/**
|
|
22
|
+
* The minimum output value
|
|
23
|
+
*/
|
|
24
|
+
this._minOutput = 1e-7;
|
|
25
|
+
const options = optionsFromArguments(Param.getDefaults(), arguments, ["param", "units", "convert"]);
|
|
26
|
+
assert(isDefined(options.param) &&
|
|
27
|
+
(isAudioParam(options.param) || options.param instanceof Param), "param must be an AudioParam");
|
|
28
|
+
while (!isAudioParam(options.param)) {
|
|
29
|
+
options.param = options.param._param;
|
|
30
|
+
}
|
|
31
|
+
this._swappable = isDefined(options.swappable) ? options.swappable : false;
|
|
32
|
+
if (this._swappable) {
|
|
33
|
+
this.input = this.context.createGain();
|
|
34
|
+
// initialize
|
|
35
|
+
this._param = options.param;
|
|
36
|
+
this.input.connect(this._param);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this._param = this.input = options.param;
|
|
40
|
+
}
|
|
41
|
+
this._events = new Timeline(1000);
|
|
42
|
+
this._initialValue = this._param.defaultValue;
|
|
43
|
+
this.units = options.units;
|
|
44
|
+
this.convert = options.convert;
|
|
45
|
+
this._minValue = options.minValue;
|
|
46
|
+
this._maxValue = options.maxValue;
|
|
47
|
+
// if the value is defined, set it immediately
|
|
48
|
+
if (isDefined(options.value) && options.value !== this._toType(this._initialValue)) {
|
|
49
|
+
this.setValueAtTime(options.value, 0);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static getDefaults() {
|
|
53
|
+
return Object.assign(ToneWithContext.getDefaults(), {
|
|
54
|
+
convert: true,
|
|
55
|
+
units: "number",
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
get value() {
|
|
59
|
+
const now = this.now();
|
|
60
|
+
return this.getValueAtTime(now);
|
|
61
|
+
}
|
|
62
|
+
set value(value) {
|
|
63
|
+
this.cancelScheduledValues(this.now());
|
|
64
|
+
this.setValueAtTime(value, this.now());
|
|
65
|
+
}
|
|
66
|
+
get minValue() {
|
|
67
|
+
// if it's not the default minValue, return it
|
|
68
|
+
if (isDefined(this._minValue)) {
|
|
69
|
+
return this._minValue;
|
|
70
|
+
}
|
|
71
|
+
else if (this.units === "time" || this.units === "frequency" ||
|
|
72
|
+
this.units === "normalRange" || this.units === "positive" ||
|
|
73
|
+
this.units === "transportTime" || this.units === "ticks" ||
|
|
74
|
+
this.units === "bpm" || this.units === "hertz" || this.units === "samples") {
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
else if (this.units === "audioRange") {
|
|
78
|
+
return -1;
|
|
79
|
+
}
|
|
80
|
+
else if (this.units === "decibels") {
|
|
81
|
+
return -Infinity;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
return this._param.minValue;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
get maxValue() {
|
|
88
|
+
if (isDefined(this._maxValue)) {
|
|
89
|
+
return this._maxValue;
|
|
90
|
+
}
|
|
91
|
+
else if (this.units === "normalRange" ||
|
|
92
|
+
this.units === "audioRange") {
|
|
93
|
+
return 1;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return this._param.maxValue;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Type guard based on the unit name
|
|
101
|
+
*/
|
|
102
|
+
_is(arg, type) {
|
|
103
|
+
return this.units === type;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Make sure the value is always in the defined range
|
|
107
|
+
*/
|
|
108
|
+
_assertRange(value) {
|
|
109
|
+
if (isDefined(this.maxValue) && isDefined(this.minValue)) {
|
|
110
|
+
assertRange(value, this._fromType(this.minValue), this._fromType(this.maxValue));
|
|
111
|
+
}
|
|
112
|
+
return value;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Convert the given value from the type specified by Param.units
|
|
116
|
+
* into the destination value (such as Gain or Frequency).
|
|
117
|
+
*/
|
|
118
|
+
_fromType(val) {
|
|
119
|
+
if (this.convert && !this.overridden) {
|
|
120
|
+
if (this._is(val, "time")) {
|
|
121
|
+
return this.toSeconds(val);
|
|
122
|
+
}
|
|
123
|
+
else if (this._is(val, "decibels")) {
|
|
124
|
+
return dbToGain(val);
|
|
125
|
+
}
|
|
126
|
+
else if (this._is(val, "frequency")) {
|
|
127
|
+
return this.toFrequency(val);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return val;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else if (this.overridden) {
|
|
134
|
+
// if it's overridden, should only schedule 0s
|
|
135
|
+
return 0;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
return val;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Convert the parameters value into the units specified by Param.units.
|
|
143
|
+
*/
|
|
144
|
+
_toType(val) {
|
|
145
|
+
if (this.convert && this.units === "decibels") {
|
|
146
|
+
return gainToDb(val);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return val;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//-------------------------------------
|
|
153
|
+
// ABSTRACT PARAM INTERFACE
|
|
154
|
+
// all docs are generated from ParamInterface.ts
|
|
155
|
+
//-------------------------------------
|
|
156
|
+
setValueAtTime(value, time) {
|
|
157
|
+
const computedTime = this.toSeconds(time);
|
|
158
|
+
const numericValue = this._fromType(value);
|
|
159
|
+
assert(isFinite(numericValue) && isFinite(computedTime), `Invalid argument(s) to setValueAtTime: ${JSON.stringify(value)}, ${JSON.stringify(time)}`);
|
|
160
|
+
this._assertRange(numericValue);
|
|
161
|
+
this.log(this.units, "setValueAtTime", value, computedTime);
|
|
162
|
+
this._events.add({
|
|
163
|
+
time: computedTime,
|
|
164
|
+
type: "setValueAtTime",
|
|
165
|
+
value: numericValue,
|
|
166
|
+
});
|
|
167
|
+
this._param.setValueAtTime(numericValue, computedTime);
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
getValueAtTime(time) {
|
|
171
|
+
const computedTime = Math.max(this.toSeconds(time), 0);
|
|
172
|
+
const after = this._events.getAfter(computedTime);
|
|
173
|
+
const before = this._events.get(computedTime);
|
|
174
|
+
let value = this._initialValue;
|
|
175
|
+
// if it was set by
|
|
176
|
+
if (before === null) {
|
|
177
|
+
value = this._initialValue;
|
|
178
|
+
}
|
|
179
|
+
else if (before.type === "setTargetAtTime" && (after === null || after.type === "setValueAtTime")) {
|
|
180
|
+
const previous = this._events.getBefore(before.time);
|
|
181
|
+
let previousVal;
|
|
182
|
+
if (previous === null) {
|
|
183
|
+
previousVal = this._initialValue;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
previousVal = previous.value;
|
|
187
|
+
}
|
|
188
|
+
if (before.type === "setTargetAtTime") {
|
|
189
|
+
value = this._exponentialApproach(before.time, previousVal, before.value, before.constant, computedTime);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else if (after === null) {
|
|
193
|
+
value = before.value;
|
|
194
|
+
}
|
|
195
|
+
else if (after.type === "linearRampToValueAtTime" || after.type === "exponentialRampToValueAtTime") {
|
|
196
|
+
let beforeValue = before.value;
|
|
197
|
+
if (before.type === "setTargetAtTime") {
|
|
198
|
+
const previous = this._events.getBefore(before.time);
|
|
199
|
+
if (previous === null) {
|
|
200
|
+
beforeValue = this._initialValue;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
beforeValue = previous.value;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (after.type === "linearRampToValueAtTime") {
|
|
207
|
+
value = this._linearInterpolate(before.time, beforeValue, after.time, after.value, computedTime);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
value = this._exponentialInterpolate(before.time, beforeValue, after.time, after.value, computedTime);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
value = before.value;
|
|
215
|
+
}
|
|
216
|
+
return this._toType(value);
|
|
217
|
+
}
|
|
218
|
+
setRampPoint(time) {
|
|
219
|
+
time = this.toSeconds(time);
|
|
220
|
+
let currentVal = this.getValueAtTime(time);
|
|
221
|
+
this.cancelAndHoldAtTime(time);
|
|
222
|
+
if (this._fromType(currentVal) === 0) {
|
|
223
|
+
currentVal = this._toType(this._minOutput);
|
|
224
|
+
}
|
|
225
|
+
this.setValueAtTime(currentVal, time);
|
|
226
|
+
return this;
|
|
227
|
+
}
|
|
228
|
+
linearRampToValueAtTime(value, endTime) {
|
|
229
|
+
const numericValue = this._fromType(value);
|
|
230
|
+
const computedTime = this.toSeconds(endTime);
|
|
231
|
+
assert(isFinite(numericValue) && isFinite(computedTime), `Invalid argument(s) to linearRampToValueAtTime: ${JSON.stringify(value)}, ${JSON.stringify(endTime)}`);
|
|
232
|
+
this._assertRange(numericValue);
|
|
233
|
+
this._events.add({
|
|
234
|
+
time: computedTime,
|
|
235
|
+
type: "linearRampToValueAtTime",
|
|
236
|
+
value: numericValue,
|
|
237
|
+
});
|
|
238
|
+
this.log(this.units, "linearRampToValueAtTime", value, computedTime);
|
|
239
|
+
this._param.linearRampToValueAtTime(numericValue, computedTime);
|
|
240
|
+
return this;
|
|
241
|
+
}
|
|
242
|
+
exponentialRampToValueAtTime(value, endTime) {
|
|
243
|
+
let numericValue = this._fromType(value);
|
|
244
|
+
// the value can't be 0
|
|
245
|
+
numericValue = EQ(numericValue, 0) ? this._minOutput : numericValue;
|
|
246
|
+
this._assertRange(numericValue);
|
|
247
|
+
const computedTime = this.toSeconds(endTime);
|
|
248
|
+
assert(isFinite(numericValue) && isFinite(computedTime), `Invalid argument(s) to exponentialRampToValueAtTime: ${JSON.stringify(value)}, ${JSON.stringify(endTime)}`);
|
|
249
|
+
// store the event
|
|
250
|
+
this._events.add({
|
|
251
|
+
time: computedTime,
|
|
252
|
+
type: "exponentialRampToValueAtTime",
|
|
253
|
+
value: numericValue,
|
|
254
|
+
});
|
|
255
|
+
this.log(this.units, "exponentialRampToValueAtTime", value, computedTime);
|
|
256
|
+
this._param.exponentialRampToValueAtTime(numericValue, computedTime);
|
|
257
|
+
return this;
|
|
258
|
+
}
|
|
259
|
+
exponentialRampTo(value, rampTime, startTime) {
|
|
260
|
+
startTime = this.toSeconds(startTime);
|
|
261
|
+
this.setRampPoint(startTime);
|
|
262
|
+
this.exponentialRampToValueAtTime(value, startTime + this.toSeconds(rampTime));
|
|
263
|
+
return this;
|
|
264
|
+
}
|
|
265
|
+
linearRampTo(value, rampTime, startTime) {
|
|
266
|
+
startTime = this.toSeconds(startTime);
|
|
267
|
+
this.setRampPoint(startTime);
|
|
268
|
+
this.linearRampToValueAtTime(value, startTime + this.toSeconds(rampTime));
|
|
269
|
+
return this;
|
|
270
|
+
}
|
|
271
|
+
targetRampTo(value, rampTime, startTime) {
|
|
272
|
+
startTime = this.toSeconds(startTime);
|
|
273
|
+
this.setRampPoint(startTime);
|
|
274
|
+
this.exponentialApproachValueAtTime(value, startTime, rampTime);
|
|
275
|
+
return this;
|
|
276
|
+
}
|
|
277
|
+
exponentialApproachValueAtTime(value, time, rampTime) {
|
|
278
|
+
time = this.toSeconds(time);
|
|
279
|
+
rampTime = this.toSeconds(rampTime);
|
|
280
|
+
const timeConstant = Math.log(rampTime + 1) / Math.log(200);
|
|
281
|
+
this.setTargetAtTime(value, time, timeConstant);
|
|
282
|
+
// at 90% start a linear ramp to the final value
|
|
283
|
+
this.cancelAndHoldAtTime(time + rampTime * 0.9);
|
|
284
|
+
this.linearRampToValueAtTime(value, time + rampTime);
|
|
285
|
+
return this;
|
|
286
|
+
}
|
|
287
|
+
setTargetAtTime(value, startTime, timeConstant) {
|
|
288
|
+
const numericValue = this._fromType(value);
|
|
289
|
+
// The value will never be able to approach without timeConstant > 0.
|
|
290
|
+
assert(isFinite(timeConstant) && timeConstant > 0, "timeConstant must be a number greater than 0");
|
|
291
|
+
const computedTime = this.toSeconds(startTime);
|
|
292
|
+
this._assertRange(numericValue);
|
|
293
|
+
assert(isFinite(numericValue) && isFinite(computedTime), `Invalid argument(s) to setTargetAtTime: ${JSON.stringify(value)}, ${JSON.stringify(startTime)}`);
|
|
294
|
+
this._events.add({
|
|
295
|
+
constant: timeConstant,
|
|
296
|
+
time: computedTime,
|
|
297
|
+
type: "setTargetAtTime",
|
|
298
|
+
value: numericValue,
|
|
299
|
+
});
|
|
300
|
+
this.log(this.units, "setTargetAtTime", value, computedTime, timeConstant);
|
|
301
|
+
this._param.setTargetAtTime(numericValue, computedTime, timeConstant);
|
|
302
|
+
return this;
|
|
303
|
+
}
|
|
304
|
+
setValueCurveAtTime(values, startTime, duration, scaling = 1) {
|
|
305
|
+
duration = this.toSeconds(duration);
|
|
306
|
+
startTime = this.toSeconds(startTime);
|
|
307
|
+
const startingValue = this._fromType(values[0]) * scaling;
|
|
308
|
+
this.setValueAtTime(this._toType(startingValue), startTime);
|
|
309
|
+
const segTime = duration / (values.length - 1);
|
|
310
|
+
for (let i = 1; i < values.length; i++) {
|
|
311
|
+
const numericValue = this._fromType(values[i]) * scaling;
|
|
312
|
+
this.linearRampToValueAtTime(this._toType(numericValue), startTime + i * segTime);
|
|
313
|
+
}
|
|
314
|
+
return this;
|
|
315
|
+
}
|
|
316
|
+
cancelScheduledValues(time) {
|
|
317
|
+
const computedTime = this.toSeconds(time);
|
|
318
|
+
assert(isFinite(computedTime), `Invalid argument to cancelScheduledValues: ${JSON.stringify(time)}`);
|
|
319
|
+
this._events.cancel(computedTime);
|
|
320
|
+
this._param.cancelScheduledValues(computedTime);
|
|
321
|
+
this.log(this.units, "cancelScheduledValues", computedTime);
|
|
322
|
+
return this;
|
|
323
|
+
}
|
|
324
|
+
cancelAndHoldAtTime(time) {
|
|
325
|
+
const computedTime = this.toSeconds(time);
|
|
326
|
+
const valueAtTime = this._fromType(this.getValueAtTime(computedTime));
|
|
327
|
+
// remove the schedule events
|
|
328
|
+
assert(isFinite(computedTime), `Invalid argument to cancelAndHoldAtTime: ${JSON.stringify(time)}`);
|
|
329
|
+
this.log(this.units, "cancelAndHoldAtTime", computedTime, "value=" + valueAtTime);
|
|
330
|
+
// if there is an event at the given computedTime
|
|
331
|
+
// and that even is not a "set"
|
|
332
|
+
const before = this._events.get(computedTime);
|
|
333
|
+
const after = this._events.getAfter(computedTime);
|
|
334
|
+
if (before && EQ(before.time, computedTime)) {
|
|
335
|
+
// remove everything after
|
|
336
|
+
if (after) {
|
|
337
|
+
this._param.cancelScheduledValues(after.time);
|
|
338
|
+
this._events.cancel(after.time);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
this._param.cancelAndHoldAtTime(computedTime);
|
|
342
|
+
this._events.cancel(computedTime + this.sampleTime);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
else if (after) {
|
|
346
|
+
this._param.cancelScheduledValues(after.time);
|
|
347
|
+
// cancel the next event(s)
|
|
348
|
+
this._events.cancel(after.time);
|
|
349
|
+
if (after.type === "linearRampToValueAtTime") {
|
|
350
|
+
this.linearRampToValueAtTime(this._toType(valueAtTime), computedTime);
|
|
351
|
+
}
|
|
352
|
+
else if (after.type === "exponentialRampToValueAtTime") {
|
|
353
|
+
this.exponentialRampToValueAtTime(this._toType(valueAtTime), computedTime);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// set the value at the given time
|
|
357
|
+
this._events.add({
|
|
358
|
+
time: computedTime,
|
|
359
|
+
type: "setValueAtTime",
|
|
360
|
+
value: valueAtTime,
|
|
361
|
+
});
|
|
362
|
+
this._param.setValueAtTime(valueAtTime, computedTime);
|
|
363
|
+
return this;
|
|
364
|
+
}
|
|
365
|
+
rampTo(value, rampTime = 0.1, startTime) {
|
|
366
|
+
if (this.units === "frequency" || this.units === "bpm" || this.units === "decibels") {
|
|
367
|
+
this.exponentialRampTo(value, rampTime, startTime);
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
this.linearRampTo(value, rampTime, startTime);
|
|
371
|
+
}
|
|
372
|
+
return this;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Apply all of the previously scheduled events to the passed in Param or AudioParam.
|
|
376
|
+
* The applied values will start at the context's current time and schedule
|
|
377
|
+
* all of the events which are scheduled on this Param onto the passed in param.
|
|
378
|
+
*/
|
|
379
|
+
apply(param) {
|
|
380
|
+
const now = this.context.currentTime;
|
|
381
|
+
// set the param's value at the current time and schedule everything else
|
|
382
|
+
param.setValueAtTime(this.getValueAtTime(now), now);
|
|
383
|
+
// if the previous event was a curve, then set the rest of it
|
|
384
|
+
const previousEvent = this._events.get(now);
|
|
385
|
+
if (previousEvent && previousEvent.type === "setTargetAtTime") {
|
|
386
|
+
// approx it until the next event with linear ramps
|
|
387
|
+
const nextEvent = this._events.getAfter(previousEvent.time);
|
|
388
|
+
// or for 2 seconds if there is no event
|
|
389
|
+
const endTime = nextEvent ? nextEvent.time : now + 2;
|
|
390
|
+
const subdivisions = (endTime - now) / 10;
|
|
391
|
+
for (let i = now; i < endTime; i += subdivisions) {
|
|
392
|
+
param.linearRampToValueAtTime(this.getValueAtTime(i), i);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
this._events.forEachAfter(this.context.currentTime, event => {
|
|
396
|
+
if (event.type === "cancelScheduledValues") {
|
|
397
|
+
param.cancelScheduledValues(event.time);
|
|
398
|
+
}
|
|
399
|
+
else if (event.type === "setTargetAtTime") {
|
|
400
|
+
param.setTargetAtTime(event.value, event.time, event.constant);
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
param[event.type](event.value, event.time);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
return this;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Replace the Param's internal AudioParam. Will apply scheduled curves
|
|
410
|
+
* onto the parameter and replace the connections.
|
|
411
|
+
*/
|
|
412
|
+
setParam(param) {
|
|
413
|
+
assert(this._swappable, "The Param must be assigned as 'swappable' in the constructor");
|
|
414
|
+
const input = this.input;
|
|
415
|
+
input.disconnect(this._param);
|
|
416
|
+
this.apply(param);
|
|
417
|
+
this._param = param;
|
|
418
|
+
input.connect(this._param);
|
|
419
|
+
return this;
|
|
420
|
+
}
|
|
421
|
+
dispose() {
|
|
422
|
+
super.dispose();
|
|
423
|
+
this._events.dispose();
|
|
424
|
+
return this;
|
|
425
|
+
}
|
|
426
|
+
get defaultValue() {
|
|
427
|
+
return this._toType(this._param.defaultValue);
|
|
428
|
+
}
|
|
429
|
+
//-------------------------------------
|
|
430
|
+
// AUTOMATION CURVE CALCULATIONS
|
|
431
|
+
// MIT License, copyright (c) 2014 Jordan Santell
|
|
432
|
+
//-------------------------------------
|
|
433
|
+
// Calculates the the value along the curve produced by setTargetAtTime
|
|
434
|
+
_exponentialApproach(t0, v0, v1, timeConstant, t) {
|
|
435
|
+
return v1 + (v0 - v1) * Math.exp(-(t - t0) / timeConstant);
|
|
436
|
+
}
|
|
437
|
+
// Calculates the the value along the curve produced by linearRampToValueAtTime
|
|
438
|
+
_linearInterpolate(t0, v0, t1, v1, t) {
|
|
439
|
+
return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));
|
|
440
|
+
}
|
|
441
|
+
// Calculates the the value along the curve produced by exponentialRampToValueAtTime
|
|
442
|
+
_exponentialInterpolate(t0, v0, t1, v1, t) {
|
|
443
|
+
return v0 * Math.pow(v1 / v0, (t - t0) / (t1 - t0));
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
//# sourceMappingURL=Param.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Param.js","sourceRoot":"","sources":["../../../../Tone/core/context/Param.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAA0B,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAkCpD;;;;;;GAMG;AACH,MAAM,OAAO,KACZ,SAAQ,eAAuC;IAkD/C;QACC,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;QAhDnF,SAAI,GAAW,OAAO,CAAC;QAMhC,eAAU,GAAG,KAAK,CAAC;QAiBnB;;WAEG;QACK,eAAU,GAAG,IAAI,CAAC;QAwBzB,MAAM,OAAO,GA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AU,EAAE,YAAoB,EAAE,CAAS;QACjG,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC;IAC5D,CAAC;IAED,+EAA+E;IACrE,kBAAkB,CAAC,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,CAAS;QACrF,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,oFAAoF;IAC1E,uBAAuB,CAAC,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,CAAS;QAC1F,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC;CACD"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { Tone } from "../Tone";
|
|
2
|
+
import { Samples, Seconds } from "../type/Units";
|
|
3
|
+
interface ToneAudioBufferOptions {
|
|
4
|
+
url?: string | AudioBuffer | ToneAudioBuffer;
|
|
5
|
+
reverse: boolean;
|
|
6
|
+
onload: (buffer?: ToneAudioBuffer) => void;
|
|
7
|
+
onerror: (error: Error) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* AudioBuffer loading and storage. ToneAudioBuffer is used internally by all
|
|
11
|
+
* classes that make requests for audio files such as Tone.Player,
|
|
12
|
+
* Tone.Sampler and Tone.Convolver.
|
|
13
|
+
* @example
|
|
14
|
+
* const buffer = new Tone.ToneAudioBuffer("https://tonejs.github.io/audio/casio/A1.mp3", () => {
|
|
15
|
+
* console.log("loaded");
|
|
16
|
+
* });
|
|
17
|
+
* @category Core
|
|
18
|
+
*/
|
|
19
|
+
export declare class ToneAudioBuffer extends Tone {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
/**
|
|
22
|
+
* stores the loaded AudioBuffer
|
|
23
|
+
*/
|
|
24
|
+
private _buffer?;
|
|
25
|
+
/**
|
|
26
|
+
* indicates if the buffer should be reversed or not
|
|
27
|
+
*/
|
|
28
|
+
private _reversed;
|
|
29
|
+
/**
|
|
30
|
+
* Callback when the buffer is loaded.
|
|
31
|
+
*/
|
|
32
|
+
onload: (buffer: ToneAudioBuffer) => void;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param url The url to load, or the audio buffer to set.
|
|
36
|
+
* @param onload A callback which is invoked after the buffer is loaded.
|
|
37
|
+
* It's recommended to use `ToneAudioBuffer.on('load', callback)` instead
|
|
38
|
+
* since it will give you a callback when _all_ buffers are loaded.
|
|
39
|
+
* @param onerror The callback to invoke if there is an error
|
|
40
|
+
*/
|
|
41
|
+
constructor(url?: string | ToneAudioBuffer | AudioBuffer, onload?: (buffer: ToneAudioBuffer) => void, onerror?: (error: Error) => void);
|
|
42
|
+
constructor(options?: Partial<ToneAudioBufferOptions>);
|
|
43
|
+
static getDefaults(): ToneAudioBufferOptions;
|
|
44
|
+
/**
|
|
45
|
+
* The sample rate of the AudioBuffer
|
|
46
|
+
*/
|
|
47
|
+
get sampleRate(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Pass in an AudioBuffer or ToneAudioBuffer to set the value of this buffer.
|
|
50
|
+
*/
|
|
51
|
+
set(buffer: AudioBuffer | ToneAudioBuffer): this;
|
|
52
|
+
/**
|
|
53
|
+
* The audio buffer stored in the object.
|
|
54
|
+
*/
|
|
55
|
+
get(): AudioBuffer | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Makes an fetch request for the selected url then decodes the file as an audio buffer.
|
|
58
|
+
* Invokes the callback once the audio buffer loads.
|
|
59
|
+
* @param url The url of the buffer to load. filetype support depends on the browser.
|
|
60
|
+
* @returns A Promise which resolves with this ToneAudioBuffer
|
|
61
|
+
*/
|
|
62
|
+
load(url: string): Promise<this>;
|
|
63
|
+
/**
|
|
64
|
+
* clean up
|
|
65
|
+
*/
|
|
66
|
+
dispose(): this;
|
|
67
|
+
/**
|
|
68
|
+
* Set the audio buffer from the array.
|
|
69
|
+
* To create a multichannel AudioBuffer, pass in a multidimensional array.
|
|
70
|
+
* @param array The array to fill the audio buffer
|
|
71
|
+
*/
|
|
72
|
+
fromArray(array: Float32Array | Float32Array[]): this;
|
|
73
|
+
/**
|
|
74
|
+
* Sums multiple channels into 1 channel
|
|
75
|
+
* @param chanNum Optionally only copy a single channel from the array.
|
|
76
|
+
*/
|
|
77
|
+
toMono(chanNum?: number): this;
|
|
78
|
+
/**
|
|
79
|
+
* Get the buffer as an array. Single channel buffers will return a 1-dimensional
|
|
80
|
+
* Float32Array, and multichannel buffers will return multidimensional arrays.
|
|
81
|
+
* @param channel Optionally only copy a single channel from the array.
|
|
82
|
+
*/
|
|
83
|
+
toArray(channel?: number): Float32Array | Float32Array[];
|
|
84
|
+
/**
|
|
85
|
+
* Returns the Float32Array representing the PCM audio data for the specific channel.
|
|
86
|
+
* @param channel The channel number to return
|
|
87
|
+
* @return The audio as a TypedArray
|
|
88
|
+
*/
|
|
89
|
+
getChannelData(channel: number): Float32Array;
|
|
90
|
+
/**
|
|
91
|
+
* Cut a subsection of the array and return a buffer of the
|
|
92
|
+
* subsection. Does not modify the original buffer
|
|
93
|
+
* @param start The time to start the slice
|
|
94
|
+
* @param end The end time to slice. If none is given will default to the end of the buffer
|
|
95
|
+
*/
|
|
96
|
+
slice(start: Seconds, end?: Seconds): ToneAudioBuffer;
|
|
97
|
+
/**
|
|
98
|
+
* Reverse the buffer.
|
|
99
|
+
*/
|
|
100
|
+
private _reverse;
|
|
101
|
+
/**
|
|
102
|
+
* If the buffer is loaded or not
|
|
103
|
+
*/
|
|
104
|
+
get loaded(): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* The duration of the buffer in seconds.
|
|
107
|
+
*/
|
|
108
|
+
get duration(): Seconds;
|
|
109
|
+
/**
|
|
110
|
+
* The length of the buffer in samples
|
|
111
|
+
*/
|
|
112
|
+
get length(): Samples;
|
|
113
|
+
/**
|
|
114
|
+
* The number of discrete audio channels. Returns 0 if no buffer is loaded.
|
|
115
|
+
*/
|
|
116
|
+
get numberOfChannels(): number;
|
|
117
|
+
/**
|
|
118
|
+
* Reverse the buffer.
|
|
119
|
+
*/
|
|
120
|
+
get reverse(): boolean;
|
|
121
|
+
set reverse(rev: boolean);
|
|
122
|
+
/**
|
|
123
|
+
* A path which is prefixed before every url.
|
|
124
|
+
*/
|
|
125
|
+
static baseUrl: string;
|
|
126
|
+
/**
|
|
127
|
+
* Create a ToneAudioBuffer from the array. To create a multichannel AudioBuffer,
|
|
128
|
+
* pass in a multidimensional array.
|
|
129
|
+
* @param array The array to fill the audio buffer
|
|
130
|
+
* @return A ToneAudioBuffer created from the array
|
|
131
|
+
*/
|
|
132
|
+
static fromArray(array: Float32Array | Float32Array[]): ToneAudioBuffer;
|
|
133
|
+
/**
|
|
134
|
+
* Creates a ToneAudioBuffer from a URL, returns a promise which resolves to a ToneAudioBuffer
|
|
135
|
+
* @param url The url to load.
|
|
136
|
+
* @return A promise which resolves to a ToneAudioBuffer
|
|
137
|
+
*/
|
|
138
|
+
static fromUrl(url: string): Promise<ToneAudioBuffer>;
|
|
139
|
+
/**
|
|
140
|
+
* All of the downloads
|
|
141
|
+
*/
|
|
142
|
+
static downloads: Array<Promise<void>>;
|
|
143
|
+
/**
|
|
144
|
+
* Loads a url using fetch and returns the AudioBuffer.
|
|
145
|
+
*/
|
|
146
|
+
static load(url: string): Promise<AudioBuffer>;
|
|
147
|
+
/**
|
|
148
|
+
* Checks a url's extension to see if the current browser can play that file type.
|
|
149
|
+
* @param url The url/extension to test
|
|
150
|
+
* @return If the file extension can be played
|
|
151
|
+
* @static
|
|
152
|
+
* @example
|
|
153
|
+
* Tone.ToneAudioBuffer.supportsType("wav"); // returns true
|
|
154
|
+
* Tone.ToneAudioBuffer.supportsType("path/to/file.wav"); // returns true
|
|
155
|
+
*/
|
|
156
|
+
static supportsType(url: string): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Returns a Promise which resolves when all of the buffers have loaded
|
|
159
|
+
*/
|
|
160
|
+
static loaded(): Promise<void>;
|
|
161
|
+
}
|
|
162
|
+
export {};
|