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.
Files changed (887) hide show
  1. package/CHANGELOG.md +313 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +255 -0
  4. package/Tone/classes.ts +7 -0
  5. package/Tone/component/analysis/Analyser.test.ts +78 -0
  6. package/Tone/component/analysis/Analyser.ts +168 -0
  7. package/Tone/component/analysis/DCMeter.test.ts +34 -0
  8. package/Tone/component/analysis/DCMeter.ts +38 -0
  9. package/Tone/component/analysis/FFT.test.ts +83 -0
  10. package/Tone/component/analysis/FFT.ts +92 -0
  11. package/Tone/component/analysis/Follower.test.ts +111 -0
  12. package/Tone/component/analysis/Follower.ts +85 -0
  13. package/Tone/component/analysis/Meter.test.ts +91 -0
  14. package/Tone/component/analysis/Meter.ts +123 -0
  15. package/Tone/component/analysis/MeterBase.ts +45 -0
  16. package/Tone/component/analysis/Waveform.test.ts +49 -0
  17. package/Tone/component/analysis/Waveform.ts +57 -0
  18. package/Tone/component/channel/Channel.test.ts +77 -0
  19. package/Tone/component/channel/Channel.ts +178 -0
  20. package/Tone/component/channel/CrossFade.test.ts +57 -0
  21. package/Tone/component/channel/CrossFade.ts +143 -0
  22. package/Tone/component/channel/Merge.test.ts +59 -0
  23. package/Tone/component/channel/Merge.ts +62 -0
  24. package/Tone/component/channel/MidSideMerge.test.ts +28 -0
  25. package/Tone/component/channel/MidSideMerge.ts +105 -0
  26. package/Tone/component/channel/MidSideSplit.test.ts +79 -0
  27. package/Tone/component/channel/MidSideSplit.ts +90 -0
  28. package/Tone/component/channel/Mono.test.ts +43 -0
  29. package/Tone/component/channel/Mono.ts +55 -0
  30. package/Tone/component/channel/MultibandSplit.test.ts +66 -0
  31. package/Tone/component/channel/MultibandSplit.ts +166 -0
  32. package/Tone/component/channel/PanVol.test.ts +58 -0
  33. package/Tone/component/channel/PanVol.ts +110 -0
  34. package/Tone/component/channel/Panner.test.ts +86 -0
  35. package/Tone/component/channel/Panner.ts +89 -0
  36. package/Tone/component/channel/Panner3D.test.ts +77 -0
  37. package/Tone/component/channel/Panner3D.ts +234 -0
  38. package/Tone/component/channel/Recorder.test.ts +119 -0
  39. package/Tone/component/channel/Recorder.ts +162 -0
  40. package/Tone/component/channel/Solo.test.ts +138 -0
  41. package/Tone/component/channel/Solo.ts +148 -0
  42. package/Tone/component/channel/Split.test.ts +62 -0
  43. package/Tone/component/channel/Split.ts +51 -0
  44. package/Tone/component/channel/Volume.test.ts +129 -0
  45. package/Tone/component/channel/Volume.ts +109 -0
  46. package/Tone/component/dynamics/Compressor.test.ts +85 -0
  47. package/Tone/component/dynamics/Compressor.ts +163 -0
  48. package/Tone/component/dynamics/Gate.test.ts +72 -0
  49. package/Tone/component/dynamics/Gate.ts +110 -0
  50. package/Tone/component/dynamics/Limiter.test.ts +43 -0
  51. package/Tone/component/dynamics/Limiter.ts +78 -0
  52. package/Tone/component/dynamics/MidSideCompressor.test.ts +59 -0
  53. package/Tone/component/dynamics/MidSideCompressor.ts +87 -0
  54. package/Tone/component/dynamics/MultibandCompressor.test.ts +54 -0
  55. package/Tone/component/dynamics/MultibandCompressor.ts +130 -0
  56. package/Tone/component/envelope/AmplitudeEnvelope.test.ts +92 -0
  57. package/Tone/component/envelope/AmplitudeEnvelope.ts +65 -0
  58. package/Tone/component/envelope/Envelope.test.ts +834 -0
  59. package/Tone/component/envelope/Envelope.ts +623 -0
  60. package/Tone/component/envelope/FrequencyEnvelope.test.ts +92 -0
  61. package/Tone/component/envelope/FrequencyEnvelope.ts +134 -0
  62. package/Tone/component/filter/BiquadFilter.test.ts +94 -0
  63. package/Tone/component/filter/BiquadFilter.ts +158 -0
  64. package/Tone/component/filter/Convolver.test.ts +106 -0
  65. package/Tone/component/filter/Convolver.ts +134 -0
  66. package/Tone/component/filter/EQ3.test.ts +60 -0
  67. package/Tone/component/filter/EQ3.ts +163 -0
  68. package/Tone/component/filter/FeedbackCombFilter.test.ts +80 -0
  69. package/Tone/component/filter/FeedbackCombFilter.ts +105 -0
  70. package/Tone/component/filter/FeedbackCombFilter.worklet.ts +39 -0
  71. package/Tone/component/filter/Filter.test.ts +114 -0
  72. package/Tone/component/filter/Filter.ts +202 -0
  73. package/Tone/component/filter/LowpassCombFilter.test.ts +75 -0
  74. package/Tone/component/filter/LowpassCombFilter.ts +100 -0
  75. package/Tone/component/filter/OnePoleFilter.test.ts +90 -0
  76. package/Tone/component/filter/OnePoleFilter.ts +146 -0
  77. package/Tone/component/filter/PhaseShiftAllpass.test.ts +71 -0
  78. package/Tone/component/filter/PhaseShiftAllpass.ts +81 -0
  79. package/Tone/component/index.ts +39 -0
  80. package/Tone/core/Global.ts +73 -0
  81. package/Tone/core/Tone.ts +107 -0
  82. package/Tone/core/clock/Clock.test.ts +663 -0
  83. package/Tone/core/clock/Clock.ts +317 -0
  84. package/Tone/core/clock/TickParam.test.ts +15 -0
  85. package/Tone/core/clock/TickParam.ts +271 -0
  86. package/Tone/core/clock/TickSignal.test.ts +455 -0
  87. package/Tone/core/clock/TickSignal.ts +94 -0
  88. package/Tone/core/clock/TickSource.test.ts +655 -0
  89. package/Tone/core/clock/TickSource.ts +338 -0
  90. package/Tone/core/clock/Ticker.test.ts +86 -0
  91. package/Tone/core/clock/Ticker.ts +149 -0
  92. package/Tone/core/clock/Transport.test.ts +972 -0
  93. package/Tone/core/clock/Transport.ts +731 -0
  94. package/Tone/core/clock/TransportEvent.test.ts +45 -0
  95. package/Tone/core/clock/TransportEvent.ts +105 -0
  96. package/Tone/core/clock/TransportRepeatEvent.test.ts +43 -0
  97. package/Tone/core/clock/TransportRepeatEvent.ts +150 -0
  98. package/Tone/core/context/AbstractParam.ts +260 -0
  99. package/Tone/core/context/AudioContext.ts +60 -0
  100. package/Tone/core/context/BaseContext.ts +162 -0
  101. package/Tone/core/context/Context.test.ts +358 -0
  102. package/Tone/core/context/Context.ts +628 -0
  103. package/Tone/core/context/ContextInitialization.ts +42 -0
  104. package/Tone/core/context/Delay.test.ts +105 -0
  105. package/Tone/core/context/Delay.ts +103 -0
  106. package/Tone/core/context/Destination.test.ts +76 -0
  107. package/Tone/core/context/Destination.ts +128 -0
  108. package/Tone/core/context/DummyContext.test.ts +47 -0
  109. package/Tone/core/context/DummyContext.ts +201 -0
  110. package/Tone/core/context/Gain.test.ts +75 -0
  111. package/Tone/core/context/Gain.ts +90 -0
  112. package/Tone/core/context/Listener.test.ts +22 -0
  113. package/Tone/core/context/Listener.ts +117 -0
  114. package/Tone/core/context/Offline.test.ts +79 -0
  115. package/Tone/core/context/Offline.ts +65 -0
  116. package/Tone/core/context/OfflineContext.test.ts +64 -0
  117. package/Tone/core/context/OfflineContext.ts +118 -0
  118. package/Tone/core/context/Param.test.ts +607 -0
  119. package/Tone/core/context/Param.ts +541 -0
  120. package/Tone/core/context/ToneAudioBuffer.test.ts +360 -0
  121. package/Tone/core/context/ToneAudioBuffer.ts +412 -0
  122. package/Tone/core/context/ToneAudioBuffers.test.ts +159 -0
  123. package/Tone/core/context/ToneAudioBuffers.ts +167 -0
  124. package/Tone/core/context/ToneAudioNode.test.ts +345 -0
  125. package/Tone/core/context/ToneAudioNode.ts +396 -0
  126. package/Tone/core/context/ToneWithContext.ts +205 -0
  127. package/Tone/core/index.ts +38 -0
  128. package/Tone/core/type/Conversions.test.ts +34 -0
  129. package/Tone/core/type/Conversions.ts +78 -0
  130. package/Tone/core/type/Frequency.test.ts +220 -0
  131. package/Tone/core/type/Frequency.ts +249 -0
  132. package/Tone/core/type/Midi.test.ts +137 -0
  133. package/Tone/core/type/Midi.ts +82 -0
  134. package/Tone/core/type/NoteUnits.ts +36 -0
  135. package/Tone/core/type/Ticks.test.ts +190 -0
  136. package/Tone/core/type/Ticks.ts +69 -0
  137. package/Tone/core/type/Time.test.ts +181 -0
  138. package/Tone/core/type/Time.ts +156 -0
  139. package/Tone/core/type/TimeBase.ts +324 -0
  140. package/Tone/core/type/TransportTime.test.ts +184 -0
  141. package/Tone/core/type/TransportTime.ts +34 -0
  142. package/Tone/core/type/Units.ts +204 -0
  143. package/Tone/core/util/AdvancedTypeCheck.ts +40 -0
  144. package/Tone/core/util/Debug.test.ts +74 -0
  145. package/Tone/core/util/Debug.ts +63 -0
  146. package/Tone/core/util/Decorator.ts +51 -0
  147. package/Tone/core/util/Defaults.ts +123 -0
  148. package/Tone/core/util/Draw.test.ts +72 -0
  149. package/Tone/core/util/Draw.ts +125 -0
  150. package/Tone/core/util/Emitter.test.ts +109 -0
  151. package/Tone/core/util/Emitter.ts +125 -0
  152. package/Tone/core/util/Interface.ts +45 -0
  153. package/Tone/core/util/IntervalTimeline.test.ts +465 -0
  154. package/Tone/core/util/IntervalTimeline.ts +569 -0
  155. package/Tone/core/util/Math.ts +40 -0
  156. package/Tone/core/util/StateTimeline.test.ts +103 -0
  157. package/Tone/core/util/StateTimeline.ts +96 -0
  158. package/Tone/core/util/Timeline.test.ts +606 -0
  159. package/Tone/core/util/Timeline.ts +399 -0
  160. package/Tone/core/util/TimelineValue.test.ts +29 -0
  161. package/Tone/core/util/TimelineValue.ts +56 -0
  162. package/Tone/core/util/TypeCheck.ts +65 -0
  163. package/Tone/core/util/global.d.ts +7 -0
  164. package/Tone/core/worklet/DelayLine.worklet.ts +49 -0
  165. package/Tone/core/worklet/SingleIOProcessor.worklet.ts +73 -0
  166. package/Tone/core/worklet/ToneAudioWorklet.ts +76 -0
  167. package/Tone/core/worklet/ToneAudioWorkletProcessor.worklet.ts +35 -0
  168. package/Tone/core/worklet/WorkletGlobalScope.ts +26 -0
  169. package/Tone/effect/AutoFilter.test.ts +113 -0
  170. package/Tone/effect/AutoFilter.ts +102 -0
  171. package/Tone/effect/AutoPanner.test.ts +90 -0
  172. package/Tone/effect/AutoPanner.ts +63 -0
  173. package/Tone/effect/AutoWah.test.ts +61 -0
  174. package/Tone/effect/AutoWah.ts +208 -0
  175. package/Tone/effect/BitCrusher.test.ts +42 -0
  176. package/Tone/effect/BitCrusher.ts +129 -0
  177. package/Tone/effect/BitCrusher.worklet.ts +27 -0
  178. package/Tone/effect/Chebyshev.test.ts +49 -0
  179. package/Tone/effect/Chebyshev.ts +123 -0
  180. package/Tone/effect/Chorus.test.ts +87 -0
  181. package/Tone/effect/Chorus.ts +225 -0
  182. package/Tone/effect/Distortion.test.ts +41 -0
  183. package/Tone/effect/Distortion.ts +98 -0
  184. package/Tone/effect/Effect.ts +88 -0
  185. package/Tone/effect/FeedbackDelay.test.ts +75 -0
  186. package/Tone/effect/FeedbackDelay.ts +73 -0
  187. package/Tone/effect/FeedbackEffect.ts +68 -0
  188. package/Tone/effect/Freeverb.test.ts +45 -0
  189. package/Tone/effect/Freeverb.ts +137 -0
  190. package/Tone/effect/FrequencyShifter.test.ts +55 -0
  191. package/Tone/effect/FrequencyShifter.ts +155 -0
  192. package/Tone/effect/JCReverb.test.ts +41 -0
  193. package/Tone/effect/JCReverb.ts +130 -0
  194. package/Tone/effect/LFOEffect.ts +115 -0
  195. package/Tone/effect/MidSideEffect.ts +93 -0
  196. package/Tone/effect/Phaser.test.ts +44 -0
  197. package/Tone/effect/Phaser.ts +187 -0
  198. package/Tone/effect/PingPongDelay.test.ts +41 -0
  199. package/Tone/effect/PingPongDelay.ts +105 -0
  200. package/Tone/effect/PitchShift.test.ts +66 -0
  201. package/Tone/effect/PitchShift.ts +218 -0
  202. package/Tone/effect/Reverb.test.ts +75 -0
  203. package/Tone/effect/Reverb.ts +145 -0
  204. package/Tone/effect/StereoEffect.ts +99 -0
  205. package/Tone/effect/StereoFeedbackEffect.ts +91 -0
  206. package/Tone/effect/StereoWidener.test.ts +41 -0
  207. package/Tone/effect/StereoWidener.ts +112 -0
  208. package/Tone/effect/StereoXFeedbackEffect.ts +37 -0
  209. package/Tone/effect/Tremolo.test.ts +88 -0
  210. package/Tone/effect/Tremolo.ts +191 -0
  211. package/Tone/effect/Vibrato.test.ts +52 -0
  212. package/Tone/effect/Vibrato.ts +104 -0
  213. package/Tone/effect/index.ts +18 -0
  214. package/Tone/event/Loop.test.ts +334 -0
  215. package/Tone/event/Loop.ts +210 -0
  216. package/Tone/event/Part.test.ts +848 -0
  217. package/Tone/event/Part.ts +473 -0
  218. package/Tone/event/Pattern.test.ts +137 -0
  219. package/Tone/event/Pattern.ts +121 -0
  220. package/Tone/event/PatternGenerator.test.ts +95 -0
  221. package/Tone/event/PatternGenerator.ts +176 -0
  222. package/Tone/event/Sequence.test.ts +453 -0
  223. package/Tone/event/Sequence.ts +300 -0
  224. package/Tone/event/ToneEvent.test.ts +485 -0
  225. package/Tone/event/ToneEvent.ts +392 -0
  226. package/Tone/event/index.ts +5 -0
  227. package/Tone/fromContext.test.ts +29 -0
  228. package/Tone/fromContext.ts +77 -0
  229. package/Tone/index.test.ts +54 -0
  230. package/Tone/index.ts +116 -0
  231. package/Tone/instrument/AMSynth.test.ts +79 -0
  232. package/Tone/instrument/AMSynth.ts +51 -0
  233. package/Tone/instrument/DuoSynth.test.ts +95 -0
  234. package/Tone/instrument/DuoSynth.ts +216 -0
  235. package/Tone/instrument/FMSynth.test.ts +72 -0
  236. package/Tone/instrument/FMSynth.ts +65 -0
  237. package/Tone/instrument/Instrument.ts +180 -0
  238. package/Tone/instrument/MembraneSynth.test.ts +74 -0
  239. package/Tone/instrument/MembraneSynth.ts +96 -0
  240. package/Tone/instrument/MetalSynth.test.ts +66 -0
  241. package/Tone/instrument/MetalSynth.ts +272 -0
  242. package/Tone/instrument/ModulationSynth.ts +217 -0
  243. package/Tone/instrument/MonoSynth.test.ts +88 -0
  244. package/Tone/instrument/MonoSynth.ts +177 -0
  245. package/Tone/instrument/Monophonic.ts +135 -0
  246. package/Tone/instrument/NoiseSynth.test.ts +82 -0
  247. package/Tone/instrument/NoiseSynth.ts +127 -0
  248. package/Tone/instrument/PluckSynth.test.ts +62 -0
  249. package/Tone/instrument/PluckSynth.ts +127 -0
  250. package/Tone/instrument/PolySynth.test.ts +298 -0
  251. package/Tone/instrument/PolySynth.ts +393 -0
  252. package/Tone/instrument/Sampler.test.ts +275 -0
  253. package/Tone/instrument/Sampler.ts +329 -0
  254. package/Tone/instrument/Synth.test.ts +132 -0
  255. package/Tone/instrument/Synth.ts +141 -0
  256. package/Tone/instrument/index.ts +11 -0
  257. package/Tone/signal/Abs.test.ts +42 -0
  258. package/Tone/signal/Abs.ts +53 -0
  259. package/Tone/signal/Add.test.ts +60 -0
  260. package/Tone/signal/Add.ts +63 -0
  261. package/Tone/signal/AudioToGain.test.ts +53 -0
  262. package/Tone/signal/AudioToGain.ts +40 -0
  263. package/Tone/signal/GainToAudio.test.ts +41 -0
  264. package/Tone/signal/GainToAudio.ts +40 -0
  265. package/Tone/signal/GreaterThan.test.ts +81 -0
  266. package/Tone/signal/GreaterThan.ts +88 -0
  267. package/Tone/signal/GreaterThanZero.test.ts +49 -0
  268. package/Tone/signal/GreaterThanZero.ts +67 -0
  269. package/Tone/signal/Multiply.test.ts +46 -0
  270. package/Tone/signal/Multiply.ts +85 -0
  271. package/Tone/signal/Negate.test.ts +30 -0
  272. package/Tone/signal/Negate.ts +41 -0
  273. package/Tone/signal/Pow.test.ts +40 -0
  274. package/Tone/signal/Pow.ts +84 -0
  275. package/Tone/signal/Scale.test.ts +58 -0
  276. package/Tone/signal/Scale.ts +119 -0
  277. package/Tone/signal/ScaleExp.test.ts +49 -0
  278. package/Tone/signal/ScaleExp.ts +69 -0
  279. package/Tone/signal/Signal.test.ts +519 -0
  280. package/Tone/signal/Signal.ts +226 -0
  281. package/Tone/signal/SignalOperator.ts +21 -0
  282. package/Tone/signal/Subtract.test.ts +60 -0
  283. package/Tone/signal/Subtract.ts +74 -0
  284. package/Tone/signal/SyncedSignal.test.ts +245 -0
  285. package/Tone/signal/SyncedSignal.ts +172 -0
  286. package/Tone/signal/ToneConstantSource.test.ts +202 -0
  287. package/Tone/signal/ToneConstantSource.ts +90 -0
  288. package/Tone/signal/WaveShaper.test.ts +95 -0
  289. package/Tone/signal/WaveShaper.ts +136 -0
  290. package/Tone/signal/Zero.test.ts +25 -0
  291. package/Tone/signal/Zero.ts +45 -0
  292. package/Tone/signal/index.ts +16 -0
  293. package/Tone/source/Noise.test.ts +121 -0
  294. package/Tone/source/Noise.ts +287 -0
  295. package/Tone/source/OneShotSource.ts +260 -0
  296. package/Tone/source/Source.test.ts +408 -0
  297. package/Tone/source/Source.ts +339 -0
  298. package/Tone/source/UserMedia.test.ts +177 -0
  299. package/Tone/source/UserMedia.ts +260 -0
  300. package/Tone/source/buffer/GrainPlayer.test.ts +235 -0
  301. package/Tone/source/buffer/GrainPlayer.ts +322 -0
  302. package/Tone/source/buffer/Player.test.ts +651 -0
  303. package/Tone/source/buffer/Player.ts +440 -0
  304. package/Tone/source/buffer/Players.test.ts +288 -0
  305. package/Tone/source/buffer/Players.ts +235 -0
  306. package/Tone/source/buffer/ToneBufferSource.test.ts +578 -0
  307. package/Tone/source/buffer/ToneBufferSource.ts +253 -0
  308. package/Tone/source/index.ts +15 -0
  309. package/Tone/source/oscillator/AMOscillator.test.ts +69 -0
  310. package/Tone/source/oscillator/AMOscillator.ts +222 -0
  311. package/Tone/source/oscillator/FMOscillator.test.ts +85 -0
  312. package/Tone/source/oscillator/FMOscillator.ts +236 -0
  313. package/Tone/source/oscillator/FatOscillator.test.ts +91 -0
  314. package/Tone/source/oscillator/FatOscillator.ts +255 -0
  315. package/Tone/source/oscillator/LFO.test.ts +234 -0
  316. package/Tone/source/oscillator/LFO.ts +332 -0
  317. package/Tone/source/oscillator/OmniOscillator.test.ts +303 -0
  318. package/Tone/source/oscillator/OmniOscillator.ts +428 -0
  319. package/Tone/source/oscillator/Oscillator.test.ts +278 -0
  320. package/Tone/source/oscillator/Oscillator.ts +448 -0
  321. package/Tone/source/oscillator/OscillatorInterface.ts +462 -0
  322. package/Tone/source/oscillator/PWMOscillator.test.ts +49 -0
  323. package/Tone/source/oscillator/PWMOscillator.ts +190 -0
  324. package/Tone/source/oscillator/PulseOscillator.test.ts +126 -0
  325. package/Tone/source/oscillator/PulseOscillator.ts +225 -0
  326. package/Tone/source/oscillator/ToneOscillatorNode.test.ts +241 -0
  327. package/Tone/source/oscillator/ToneOscillatorNode.ts +131 -0
  328. package/Tone/version.ts +1 -0
  329. package/build/Tone.js +22 -0
  330. package/build/Tone.js.map +1 -0
  331. package/build/esm/classes.d.ts +7 -0
  332. package/build/esm/classes.js +8 -0
  333. package/build/esm/classes.js.map +1 -0
  334. package/build/esm/component/analysis/Analyser.d.ts +77 -0
  335. package/build/esm/component/analysis/Analyser.js +121 -0
  336. package/build/esm/component/analysis/Analyser.js.map +1 -0
  337. package/build/esm/component/analysis/DCMeter.d.ts +23 -0
  338. package/build/esm/component/analysis/DCMeter.js +31 -0
  339. package/build/esm/component/analysis/DCMeter.js.map +1 -0
  340. package/build/esm/component/analysis/FFT.d.ts +50 -0
  341. package/build/esm/component/analysis/FFT.js +65 -0
  342. package/build/esm/component/analysis/FFT.js.map +1 -0
  343. package/build/esm/component/analysis/Follower.d.ts +44 -0
  344. package/build/esm/component/analysis/Follower.js +51 -0
  345. package/build/esm/component/analysis/Follower.js.map +1 -0
  346. package/build/esm/component/analysis/Meter.d.ts +62 -0
  347. package/build/esm/component/analysis/Meter.js +90 -0
  348. package/build/esm/component/analysis/Meter.js.map +1 -0
  349. package/build/esm/component/analysis/MeterBase.d.ts +23 -0
  350. package/build/esm/component/analysis/MeterBase.js +23 -0
  351. package/build/esm/component/analysis/MeterBase.js.map +1 -0
  352. package/build/esm/component/analysis/Waveform.d.ts +32 -0
  353. package/build/esm/component/analysis/Waveform.js +38 -0
  354. package/build/esm/component/analysis/Waveform.js.map +1 -0
  355. package/build/esm/component/channel/Channel.d.ts +91 -0
  356. package/build/esm/component/channel/Channel.js +124 -0
  357. package/build/esm/component/channel/Channel.js.map +1 -0
  358. package/build/esm/component/channel/CrossFade.d.ts +80 -0
  359. package/build/esm/component/channel/CrossFade.js +106 -0
  360. package/build/esm/component/channel/CrossFade.js.map +1 -0
  361. package/build/esm/component/channel/Merge.d.ts +39 -0
  362. package/build/esm/component/channel/Merge.js +32 -0
  363. package/build/esm/component/channel/Merge.js.map +1 -0
  364. package/build/esm/component/channel/MidSideMerge.d.ts +52 -0
  365. package/build/esm/component/channel/MidSideMerge.js +53 -0
  366. package/build/esm/component/channel/MidSideMerge.js.map +1 -0
  367. package/build/esm/component/channel/MidSideSplit.d.ts +42 -0
  368. package/build/esm/component/channel/MidSideSplit.js +51 -0
  369. package/build/esm/component/channel/MidSideSplit.js.map +1 -0
  370. package/build/esm/component/channel/Mono.d.ts +26 -0
  371. package/build/esm/component/channel/Mono.js +30 -0
  372. package/build/esm/component/channel/Mono.js.map +1 -0
  373. package/build/esm/component/channel/MultibandSplit.d.ts +80 -0
  374. package/build/esm/component/channel/MultibandSplit.js +121 -0
  375. package/build/esm/component/channel/MultibandSplit.js.map +1 -0
  376. package/build/esm/component/channel/PanVol.d.ts +53 -0
  377. package/build/esm/component/channel/PanVol.js +61 -0
  378. package/build/esm/component/channel/PanVol.js.map +1 -0
  379. package/build/esm/component/channel/Panner.d.ts +49 -0
  380. package/build/esm/component/channel/Panner.js +55 -0
  381. package/build/esm/component/channel/Panner.js.map +1 -0
  382. package/build/esm/component/channel/Panner3D.d.ts +98 -0
  383. package/build/esm/component/channel/Panner3D.js +177 -0
  384. package/build/esm/component/channel/Panner3D.js.map +1 -0
  385. package/build/esm/component/channel/Recorder.d.ts +77 -0
  386. package/build/esm/component/channel/Recorder.js +131 -0
  387. package/build/esm/component/channel/Recorder.js.map +1 -0
  388. package/build/esm/component/channel/Solo.d.ts +68 -0
  389. package/build/esm/component/channel/Solo.js +121 -0
  390. package/build/esm/component/channel/Solo.js.map +1 -0
  391. package/build/esm/component/channel/Split.d.ts +29 -0
  392. package/build/esm/component/channel/Split.js +30 -0
  393. package/build/esm/component/channel/Split.js.map +1 -0
  394. package/build/esm/component/channel/Volume.d.ts +60 -0
  395. package/build/esm/component/channel/Volume.js +66 -0
  396. package/build/esm/component/channel/Volume.js.map +1 -0
  397. package/build/esm/component/dynamics/Compressor.d.ts +73 -0
  398. package/build/esm/component/dynamics/Compressor.js +99 -0
  399. package/build/esm/component/dynamics/Compressor.js.map +1 -0
  400. package/build/esm/component/dynamics/Gate.d.ts +53 -0
  401. package/build/esm/component/dynamics/Gate.js +72 -0
  402. package/build/esm/component/dynamics/Gate.js.map +1 -0
  403. package/build/esm/component/dynamics/Limiter.d.ts +39 -0
  404. package/build/esm/component/dynamics/Limiter.js +51 -0
  405. package/build/esm/component/dynamics/Limiter.js.map +1 -0
  406. package/build/esm/component/dynamics/MidSideCompressor.d.ts +36 -0
  407. package/build/esm/component/dynamics/MidSideCompressor.js +52 -0
  408. package/build/esm/component/dynamics/MidSideCompressor.js.map +1 -0
  409. package/build/esm/component/dynamics/MultibandCompressor.d.ts +57 -0
  410. package/build/esm/component/dynamics/MultibandCompressor.js +79 -0
  411. package/build/esm/component/dynamics/MultibandCompressor.js.map +1 -0
  412. package/build/esm/component/envelope/AmplitudeEnvelope.d.ts +46 -0
  413. package/build/esm/component/envelope/AmplitudeEnvelope.js +49 -0
  414. package/build/esm/component/envelope/AmplitudeEnvelope.js.map +1 -0
  415. package/build/esm/component/envelope/Envelope.d.ts +302 -0
  416. package/build/esm/component/envelope/Envelope.js +470 -0
  417. package/build/esm/component/envelope/Envelope.js.map +1 -0
  418. package/build/esm/component/envelope/FrequencyEnvelope.d.ts +71 -0
  419. package/build/esm/component/envelope/FrequencyEnvelope.js +91 -0
  420. package/build/esm/component/envelope/FrequencyEnvelope.js.map +1 -0
  421. package/build/esm/component/filter/BiquadFilter.d.ts +64 -0
  422. package/build/esm/component/filter/BiquadFilter.js +101 -0
  423. package/build/esm/component/filter/BiquadFilter.js.map +1 -0
  424. package/build/esm/component/filter/Convolver.d.ts +59 -0
  425. package/build/esm/component/filter/Convolver.js +104 -0
  426. package/build/esm/component/filter/Convolver.js.map +1 -0
  427. package/build/esm/component/filter/EQ3.d.ts +77 -0
  428. package/build/esm/component/filter/EQ3.js +81 -0
  429. package/build/esm/component/filter/EQ3.js.map +1 -0
  430. package/build/esm/component/filter/FeedbackCombFilter.d.ts +45 -0
  431. package/build/esm/component/filter/FeedbackCombFilter.js +72 -0
  432. package/build/esm/component/filter/FeedbackCombFilter.js.map +1 -0
  433. package/build/esm/component/filter/FeedbackCombFilter.worklet.d.ts +3 -0
  434. package/build/esm/component/filter/FeedbackCombFilter.worklet.js +37 -0
  435. package/build/esm/component/filter/FeedbackCombFilter.worklet.js.map +1 -0
  436. package/build/esm/component/filter/Filter.d.ts +79 -0
  437. package/build/esm/component/filter/Filter.js +150 -0
  438. package/build/esm/component/filter/Filter.js.map +1 -0
  439. package/build/esm/component/filter/LowpassCombFilter.d.ts +50 -0
  440. package/build/esm/component/filter/LowpassCombFilter.js +53 -0
  441. package/build/esm/component/filter/LowpassCombFilter.js.map +1 -0
  442. package/build/esm/component/filter/OnePoleFilter.d.ts +64 -0
  443. package/build/esm/component/filter/OnePoleFilter.js +104 -0
  444. package/build/esm/component/filter/OnePoleFilter.js.map +1 -0
  445. package/build/esm/component/filter/PhaseShiftAllpass.d.ts +40 -0
  446. package/build/esm/component/filter/PhaseShiftAllpass.js +54 -0
  447. package/build/esm/component/filter/PhaseShiftAllpass.js.map +1 -0
  448. package/build/esm/component/index.d.ts +35 -0
  449. package/build/esm/component/index.js +36 -0
  450. package/build/esm/component/index.js.map +1 -0
  451. package/build/esm/core/Global.d.ts +26 -0
  452. package/build/esm/core/Global.js +69 -0
  453. package/build/esm/core/Global.js.map +1 -0
  454. package/build/esm/core/Tone.d.ts +60 -0
  455. package/build/esm/core/Tone.js +87 -0
  456. package/build/esm/core/Tone.js.map +1 -0
  457. package/build/esm/core/clock/Clock.d.ts +156 -0
  458. package/build/esm/core/clock/Clock.js +251 -0
  459. package/build/esm/core/clock/Clock.js.map +1 -0
  460. package/build/esm/core/clock/TickParam.d.ts +97 -0
  461. package/build/esm/core/clock/TickParam.js +237 -0
  462. package/build/esm/core/clock/TickParam.js.map +1 -0
  463. package/build/esm/core/clock/TickSignal.d.ts +43 -0
  464. package/build/esm/core/clock/TickSignal.js +64 -0
  465. package/build/esm/core/clock/TickSignal.js.map +1 -0
  466. package/build/esm/core/clock/TickSource.d.ts +115 -0
  467. package/build/esm/core/clock/TickSource.js +284 -0
  468. package/build/esm/core/clock/TickSource.js.map +1 -0
  469. package/build/esm/core/clock/Ticker.d.ts +59 -0
  470. package/build/esm/core/clock/Ticker.js +110 -0
  471. package/build/esm/core/clock/Ticker.js.map +1 -0
  472. package/build/esm/core/clock/Transport.d.ts +331 -0
  473. package/build/esm/core/clock/Transport.js +591 -0
  474. package/build/esm/core/clock/Transport.js.map +1 -0
  475. package/build/esm/core/clock/TransportEvent.d.ts +62 -0
  476. package/build/esm/core/clock/TransportEvent.js +66 -0
  477. package/build/esm/core/clock/TransportEvent.js.map +1 -0
  478. package/build/esm/core/clock/TransportRepeatEvent.d.ts +70 -0
  479. package/build/esm/core/clock/TransportRepeatEvent.js +110 -0
  480. package/build/esm/core/clock/TransportRepeatEvent.js.map +1 -0
  481. package/build/esm/core/context/AbstractParam.d.ts +239 -0
  482. package/build/esm/core/context/AbstractParam.js +6 -0
  483. package/build/esm/core/context/AbstractParam.js.map +1 -0
  484. package/build/esm/core/context/AudioContext.d.ts +36 -0
  485. package/build/esm/core/context/AudioContext.js +38 -0
  486. package/build/esm/core/context/AudioContext.js.map +1 -0
  487. package/build/esm/core/context/BaseContext.d.ts +56 -0
  488. package/build/esm/core/context/BaseContext.js +16 -0
  489. package/build/esm/core/context/BaseContext.js.map +1 -0
  490. package/build/esm/core/context/Context.d.ts +255 -0
  491. package/build/esm/core/context/Context.js +474 -0
  492. package/build/esm/core/context/Context.js.map +1 -0
  493. package/build/esm/core/context/ContextInitialization.d.ts +15 -0
  494. package/build/esm/core/context/ContextInitialization.js +35 -0
  495. package/build/esm/core/context/ContextInitialization.js.map +1 -0
  496. package/build/esm/core/context/Delay.d.ts +58 -0
  497. package/build/esm/core/context/Delay.js +58 -0
  498. package/build/esm/core/context/Delay.js.map +1 -0
  499. package/build/esm/core/context/Destination.d.ts +73 -0
  500. package/build/esm/core/context/Destination.js +105 -0
  501. package/build/esm/core/context/Destination.js.map +1 -0
  502. package/build/esm/core/context/DummyContext.d.ts +54 -0
  503. package/build/esm/core/context/DummyContext.js +138 -0
  504. package/build/esm/core/context/DummyContext.js.map +1 -0
  505. package/build/esm/core/context/Gain.d.ts +53 -0
  506. package/build/esm/core/context/Gain.js +58 -0
  507. package/build/esm/core/context/Gain.js.map +1 -0
  508. package/build/esm/core/context/Listener.d.ts +38 -0
  509. package/build/esm/core/context/Listener.js +87 -0
  510. package/build/esm/core/context/Listener.js.map +1 -0
  511. package/build/esm/core/context/Offline.d.ts +37 -0
  512. package/build/esm/core/context/Offline.js +56 -0
  513. package/build/esm/core/context/Offline.js.map +1 -0
  514. package/build/esm/core/context/OfflineContext.d.ts +58 -0
  515. package/build/esm/core/context/OfflineContext.js +87 -0
  516. package/build/esm/core/context/OfflineContext.js.map +1 -0
  517. package/build/esm/core/context/Param.d.ts +132 -0
  518. package/build/esm/core/context/Param.js +446 -0
  519. package/build/esm/core/context/Param.js.map +1 -0
  520. package/build/esm/core/context/ToneAudioBuffer.d.ts +162 -0
  521. package/build/esm/core/context/ToneAudioBuffer.js +364 -0
  522. package/build/esm/core/context/ToneAudioBuffer.js.map +1 -0
  523. package/build/esm/core/context/ToneAudioBuffers.d.ts +89 -0
  524. package/build/esm/core/context/ToneAudioBuffers.js +119 -0
  525. package/build/esm/core/context/ToneAudioBuffers.js.map +1 -0
  526. package/build/esm/core/context/ToneAudioNode.d.ts +173 -0
  527. package/build/esm/core/context/ToneAudioNode.js +342 -0
  528. package/build/esm/core/context/ToneAudioNode.js.map +1 -0
  529. package/build/esm/core/context/ToneWithContext.d.ts +108 -0
  530. package/build/esm/core/context/ToneWithContext.js +170 -0
  531. package/build/esm/core/context/ToneWithContext.js.map +1 -0
  532. package/build/esm/core/index.d.ts +28 -0
  533. package/build/esm/core/index.js +33 -0
  534. package/build/esm/core/index.js.map +1 -0
  535. package/build/esm/core/type/Conversions.d.ts +44 -0
  536. package/build/esm/core/type/Conversions.js +68 -0
  537. package/build/esm/core/type/Conversions.js.map +1 -0
  538. package/build/esm/core/type/Frequency.d.ts +101 -0
  539. package/build/esm/core/type/Frequency.js +225 -0
  540. package/build/esm/core/type/Frequency.js.map +1 -0
  541. package/build/esm/core/type/Midi.d.ts +53 -0
  542. package/build/esm/core/type/Midi.js +73 -0
  543. package/build/esm/core/type/Midi.js.map +1 -0
  544. package/build/esm/core/type/NoteUnits.d.ts +12 -0
  545. package/build/esm/core/type/NoteUnits.js +3 -0
  546. package/build/esm/core/type/NoteUnits.js.map +1 -0
  547. package/build/esm/core/type/Ticks.d.ts +44 -0
  548. package/build/esm/core/type/Ticks.js +61 -0
  549. package/build/esm/core/type/Ticks.js.map +1 -0
  550. package/build/esm/core/type/Time.d.ts +69 -0
  551. package/build/esm/core/type/Time.js +147 -0
  552. package/build/esm/core/type/Time.js.map +1 -0
  553. package/build/esm/core/type/TimeBase.d.ts +120 -0
  554. package/build/esm/core/type/TimeBase.js +251 -0
  555. package/build/esm/core/type/TimeBase.js.map +1 -0
  556. package/build/esm/core/type/TransportTime.d.ts +25 -0
  557. package/build/esm/core/type/TransportTime.js +32 -0
  558. package/build/esm/core/type/TransportTime.js.map +1 -0
  559. package/build/esm/core/type/Units.d.ts +176 -0
  560. package/build/esm/core/type/Units.js +2 -0
  561. package/build/esm/core/type/Units.js.map +1 -0
  562. package/build/esm/core/util/AdvancedTypeCheck.d.ts +21 -0
  563. package/build/esm/core/util/AdvancedTypeCheck.js +32 -0
  564. package/build/esm/core/util/AdvancedTypeCheck.js.map +1 -0
  565. package/build/esm/core/util/Debug.d.ts +34 -0
  566. package/build/esm/core/util/Debug.js +50 -0
  567. package/build/esm/core/util/Debug.js.map +1 -0
  568. package/build/esm/core/util/Decorator.d.ts +9 -0
  569. package/build/esm/core/util/Decorator.js +41 -0
  570. package/build/esm/core/util/Decorator.js.map +1 -0
  571. package/build/esm/core/util/Defaults.d.ts +32 -0
  572. package/build/esm/core/util/Defaults.js +99 -0
  573. package/build/esm/core/util/Defaults.js.map +1 -0
  574. package/build/esm/core/util/Draw.d.ts +67 -0
  575. package/build/esm/core/util/Draw.js +110 -0
  576. package/build/esm/core/util/Draw.js.map +1 -0
  577. package/build/esm/core/util/Emitter.d.ts +52 -0
  578. package/build/esm/core/util/Emitter.js +113 -0
  579. package/build/esm/core/util/Emitter.js.map +1 -0
  580. package/build/esm/core/util/Interface.d.ts +16 -0
  581. package/build/esm/core/util/Interface.js +32 -0
  582. package/build/esm/core/util/Interface.js.map +1 -0
  583. package/build/esm/core/util/IntervalTimeline.d.ts +106 -0
  584. package/build/esm/core/util/IntervalTimeline.js +539 -0
  585. package/build/esm/core/util/IntervalTimeline.js.map +1 -0
  586. package/build/esm/core/util/Math.d.ts +20 -0
  587. package/build/esm/core/util/Math.js +36 -0
  588. package/build/esm/core/util/Math.js.map +1 -0
  589. package/build/esm/core/util/StateTimeline.d.ts +47 -0
  590. package/build/esm/core/util/StateTimeline.js +78 -0
  591. package/build/esm/core/util/StateTimeline.js.map +1 -0
  592. package/build/esm/core/util/Timeline.d.ts +156 -0
  593. package/build/esm/core/util/Timeline.js +351 -0
  594. package/build/esm/core/util/Timeline.js.map +1 -0
  595. package/build/esm/core/util/TimelineValue.d.ts +28 -0
  596. package/build/esm/core/util/TimelineValue.js +41 -0
  597. package/build/esm/core/util/TimelineValue.js.map +1 -0
  598. package/build/esm/core/util/TypeCheck.d.ts +38 -0
  599. package/build/esm/core/util/TypeCheck.js +56 -0
  600. package/build/esm/core/util/TypeCheck.js.map +1 -0
  601. package/build/esm/core/worklet/DelayLine.worklet.d.ts +1 -0
  602. package/build/esm/core/worklet/DelayLine.worklet.js +48 -0
  603. package/build/esm/core/worklet/DelayLine.worklet.js.map +1 -0
  604. package/build/esm/core/worklet/SingleIOProcessor.worklet.d.ts +2 -0
  605. package/build/esm/core/worklet/SingleIOProcessor.worklet.js +72 -0
  606. package/build/esm/core/worklet/SingleIOProcessor.worklet.js.map +1 -0
  607. package/build/esm/core/worklet/ToneAudioWorklet.d.ts +35 -0
  608. package/build/esm/core/worklet/ToneAudioWorklet.js +40 -0
  609. package/build/esm/core/worklet/ToneAudioWorklet.js.map +1 -0
  610. package/build/esm/core/worklet/ToneAudioWorkletProcessor.worklet.d.ts +1 -0
  611. package/build/esm/core/worklet/ToneAudioWorkletProcessor.worklet.js +34 -0
  612. package/build/esm/core/worklet/ToneAudioWorkletProcessor.worklet.js.map +1 -0
  613. package/build/esm/core/worklet/WorkletGlobalScope.d.ts +12 -0
  614. package/build/esm/core/worklet/WorkletGlobalScope.js +24 -0
  615. package/build/esm/core/worklet/WorkletGlobalScope.js.map +1 -0
  616. package/build/esm/effect/AutoFilter.d.ts +51 -0
  617. package/build/esm/effect/AutoFilter.js +68 -0
  618. package/build/esm/effect/AutoFilter.js.map +1 -0
  619. package/build/esm/effect/AutoPanner.d.ts +31 -0
  620. package/build/esm/effect/AutoPanner.js +41 -0
  621. package/build/esm/effect/AutoPanner.js.map +1 -0
  622. package/build/esm/effect/AutoWah.d.ts +99 -0
  623. package/build/esm/effect/AutoWah.js +131 -0
  624. package/build/esm/effect/AutoWah.js.map +1 -0
  625. package/build/esm/effect/BitCrusher.d.ts +40 -0
  626. package/build/esm/effect/BitCrusher.js +85 -0
  627. package/build/esm/effect/BitCrusher.js.map +1 -0
  628. package/build/esm/effect/BitCrusher.worklet.d.ts +3 -0
  629. package/build/esm/effect/BitCrusher.worklet.js +25 -0
  630. package/build/esm/effect/BitCrusher.worklet.js.map +1 -0
  631. package/build/esm/effect/Chebyshev.d.ts +62 -0
  632. package/build/esm/effect/Chebyshev.js +95 -0
  633. package/build/esm/effect/Chebyshev.js.map +1 -0
  634. package/build/esm/effect/Chorus.d.ts +104 -0
  635. package/build/esm/effect/Chorus.js +157 -0
  636. package/build/esm/effect/Chorus.js.map +1 -0
  637. package/build/esm/effect/Distortion.d.ts +43 -0
  638. package/build/esm/effect/Distortion.js +69 -0
  639. package/build/esm/effect/Distortion.js.map +1 -0
  640. package/build/esm/effect/Effect.d.ts +49 -0
  641. package/build/esm/effect/Effect.js +70 -0
  642. package/build/esm/effect/Effect.js.map +1 -0
  643. package/build/esm/effect/FeedbackDelay.d.ts +37 -0
  644. package/build/esm/effect/FeedbackDelay.js +47 -0
  645. package/build/esm/effect/FeedbackDelay.js.map +1 -0
  646. package/build/esm/effect/FeedbackEffect.d.ts +34 -0
  647. package/build/esm/effect/FeedbackEffect.js +34 -0
  648. package/build/esm/effect/FeedbackEffect.js.map +1 -0
  649. package/build/esm/effect/Freeverb.d.ts +51 -0
  650. package/build/esm/effect/Freeverb.js +104 -0
  651. package/build/esm/effect/Freeverb.js.map +1 -0
  652. package/build/esm/effect/FrequencyShifter.d.ts +68 -0
  653. package/build/esm/effect/FrequencyShifter.js +88 -0
  654. package/build/esm/effect/FrequencyShifter.js.map +1 -0
  655. package/build/esm/effect/JCReverb.d.ts +46 -0
  656. package/build/esm/effect/JCReverb.js +97 -0
  657. package/build/esm/effect/JCReverb.js.map +1 -0
  658. package/build/esm/effect/LFOEffect.d.ts +58 -0
  659. package/build/esm/effect/LFOEffect.js +77 -0
  660. package/build/esm/effect/LFOEffect.js.map +1 -0
  661. package/build/esm/effect/MidSideEffect.d.ts +50 -0
  662. package/build/esm/effect/MidSideEffect.js +51 -0
  663. package/build/esm/effect/MidSideEffect.js.map +1 -0
  664. package/build/esm/effect/Phaser.d.ts +80 -0
  665. package/build/esm/effect/Phaser.js +119 -0
  666. package/build/esm/effect/Phaser.js.map +1 -0
  667. package/build/esm/effect/PingPongDelay.d.ts +48 -0
  668. package/build/esm/effect/PingPongDelay.js +66 -0
  669. package/build/esm/effect/PingPongDelay.js.map +1 -0
  670. package/build/esm/effect/PitchShift.d.ts +89 -0
  671. package/build/esm/effect/PitchShift.js +140 -0
  672. package/build/esm/effect/PitchShift.js.map +1 -0
  673. package/build/esm/effect/Reverb.d.ts +62 -0
  674. package/build/esm/effect/Reverb.js +111 -0
  675. package/build/esm/effect/Reverb.js.map +1 -0
  676. package/build/esm/effect/StereoEffect.d.ts +44 -0
  677. package/build/esm/effect/StereoEffect.js +61 -0
  678. package/build/esm/effect/StereoEffect.js.map +1 -0
  679. package/build/esm/effect/StereoFeedbackEffect.d.ts +39 -0
  680. package/build/esm/effect/StereoFeedbackEffect.js +49 -0
  681. package/build/esm/effect/StereoFeedbackEffect.js.map +1 -0
  682. package/build/esm/effect/StereoWidener.d.ts +50 -0
  683. package/build/esm/effect/StereoWidener.js +65 -0
  684. package/build/esm/effect/StereoWidener.js.map +1 -0
  685. package/build/esm/effect/StereoXFeedbackEffect.d.ts +21 -0
  686. package/build/esm/effect/StereoXFeedbackEffect.js +28 -0
  687. package/build/esm/effect/StereoXFeedbackEffect.js.map +1 -0
  688. package/build/esm/effect/Tremolo.d.ts +86 -0
  689. package/build/esm/effect/Tremolo.js +131 -0
  690. package/build/esm/effect/Tremolo.js.map +1 -0
  691. package/build/esm/effect/Vibrato.d.ts +48 -0
  692. package/build/esm/effect/Vibrato.js +61 -0
  693. package/build/esm/effect/Vibrato.js.map +1 -0
  694. package/build/esm/effect/index.d.ts +18 -0
  695. package/build/esm/effect/index.js +19 -0
  696. package/build/esm/effect/index.js.map +1 -0
  697. package/build/esm/event/Loop.d.ts +107 -0
  698. package/build/esm/event/Loop.js +164 -0
  699. package/build/esm/event/Loop.js.map +1 -0
  700. package/build/esm/event/Part.d.ts +193 -0
  701. package/build/esm/event/Part.js +401 -0
  702. package/build/esm/event/Part.js.map +1 -0
  703. package/build/esm/event/Pattern.d.ts +67 -0
  704. package/build/esm/event/Pattern.js +67 -0
  705. package/build/esm/event/Pattern.js.map +1 -0
  706. package/build/esm/event/PatternGenerator.d.ts +12 -0
  707. package/build/esm/event/PatternGenerator.js +165 -0
  708. package/build/esm/event/PatternGenerator.js.map +1 -0
  709. package/build/esm/event/Sequence.d.ts +127 -0
  710. package/build/esm/event/Sequence.js +247 -0
  711. package/build/esm/event/Sequence.js.map +1 -0
  712. package/build/esm/event/ToneEvent.d.ts +188 -0
  713. package/build/esm/event/ToneEvent.js +299 -0
  714. package/build/esm/event/ToneEvent.js.map +1 -0
  715. package/build/esm/event/index.d.ts +5 -0
  716. package/build/esm/event/index.js +6 -0
  717. package/build/esm/event/index.js.map +1 -0
  718. package/build/esm/fromContext.d.ts +26 -0
  719. package/build/esm/fromContext.js +41 -0
  720. package/build/esm/fromContext.js.map +1 -0
  721. package/build/esm/index.d.ts +86 -0
  722. package/build/esm/index.js +102 -0
  723. package/build/esm/index.js.map +1 -0
  724. package/build/esm/instrument/AMSynth.d.ts +25 -0
  725. package/build/esm/instrument/AMSynth.js +37 -0
  726. package/build/esm/instrument/AMSynth.js.map +1 -0
  727. package/build/esm/instrument/DuoSynth.d.ts +72 -0
  728. package/build/esm/instrument/DuoSynth.js +140 -0
  729. package/build/esm/instrument/DuoSynth.js.map +1 -0
  730. package/build/esm/instrument/FMSynth.d.ts +31 -0
  731. package/build/esm/instrument/FMSynth.js +45 -0
  732. package/build/esm/instrument/FMSynth.js.map +1 -0
  733. package/build/esm/instrument/Instrument.d.ts +100 -0
  734. package/build/esm/instrument/Instrument.js +127 -0
  735. package/build/esm/instrument/Instrument.js.map +1 -0
  736. package/build/esm/instrument/MembraneSynth.d.ts +47 -0
  737. package/build/esm/instrument/MembraneSynth.js +69 -0
  738. package/build/esm/instrument/MembraneSynth.js.map +1 -0
  739. package/build/esm/instrument/MetalSynth.d.ts +109 -0
  740. package/build/esm/instrument/MetalSynth.js +198 -0
  741. package/build/esm/instrument/MetalSynth.js.map +1 -0
  742. package/build/esm/instrument/ModulationSynth.d.ts +81 -0
  743. package/build/esm/instrument/ModulationSynth.js +122 -0
  744. package/build/esm/instrument/ModulationSynth.js.map +1 -0
  745. package/build/esm/instrument/MonoSynth.d.ts +76 -0
  746. package/build/esm/instrument/MonoSynth.js +113 -0
  747. package/build/esm/instrument/MonoSynth.js.map +1 -0
  748. package/build/esm/instrument/Monophonic.d.ts +82 -0
  749. package/build/esm/instrument/Monophonic.js +83 -0
  750. package/build/esm/instrument/Monophonic.js.map +1 -0
  751. package/build/esm/instrument/NoiseSynth.d.ts +51 -0
  752. package/build/esm/instrument/NoiseSynth.js +93 -0
  753. package/build/esm/instrument/NoiseSynth.js.map +1 -0
  754. package/build/esm/instrument/PluckSynth.d.ts +57 -0
  755. package/build/esm/instrument/PluckSynth.js +80 -0
  756. package/build/esm/instrument/PluckSynth.js.map +1 -0
  757. package/build/esm/instrument/PolySynth.d.ts +176 -0
  758. package/build/esm/instrument/PolySynth.js +302 -0
  759. package/build/esm/instrument/PolySynth.js.map +1 -0
  760. package/build/esm/instrument/Sampler.d.ts +126 -0
  761. package/build/esm/instrument/Sampler.js +259 -0
  762. package/build/esm/instrument/Sampler.js.map +1 -0
  763. package/build/esm/instrument/Synth.d.ts +65 -0
  764. package/build/esm/instrument/Synth.js +91 -0
  765. package/build/esm/instrument/Synth.js.map +1 -0
  766. package/build/esm/instrument/index.d.ts +11 -0
  767. package/build/esm/instrument/index.js +12 -0
  768. package/build/esm/instrument/index.js.map +1 -0
  769. package/build/esm/signal/Abs.d.ts +34 -0
  770. package/build/esm/signal/Abs.js +51 -0
  771. package/build/esm/signal/Abs.js.map +1 -0
  772. package/build/esm/signal/Add.d.ts +40 -0
  773. package/build/esm/signal/Add.js +49 -0
  774. package/build/esm/signal/Add.js.map +1 -0
  775. package/build/esm/signal/AudioToGain.d.ts +27 -0
  776. package/build/esm/signal/AudioToGain.js +37 -0
  777. package/build/esm/signal/AudioToGain.js.map +1 -0
  778. package/build/esm/signal/GainToAudio.d.ts +27 -0
  779. package/build/esm/signal/GainToAudio.js +37 -0
  780. package/build/esm/signal/GainToAudio.js.map +1 -0
  781. package/build/esm/signal/GreaterThan.d.ts +47 -0
  782. package/build/esm/signal/GreaterThan.js +46 -0
  783. package/build/esm/signal/GreaterThan.js.map +1 -0
  784. package/build/esm/signal/GreaterThanZero.d.ts +29 -0
  785. package/build/esm/signal/GreaterThanZero.js +45 -0
  786. package/build/esm/signal/GreaterThanZero.js.map +1 -0
  787. package/build/esm/signal/Multiply.d.ts +52 -0
  788. package/build/esm/signal/Multiply.js +51 -0
  789. package/build/esm/signal/Multiply.js.map +1 -0
  790. package/build/esm/signal/Negate.d.ts +29 -0
  791. package/build/esm/signal/Negate.js +39 -0
  792. package/build/esm/signal/Negate.js.map +1 -0
  793. package/build/esm/signal/Pow.d.ts +42 -0
  794. package/build/esm/signal/Pow.js +58 -0
  795. package/build/esm/signal/Pow.js.map +1 -0
  796. package/build/esm/signal/Scale.d.ts +62 -0
  797. package/build/esm/signal/Scale.js +73 -0
  798. package/build/esm/signal/Scale.js.map +1 -0
  799. package/build/esm/signal/ScaleExp.d.ts +37 -0
  800. package/build/esm/signal/ScaleExp.js +46 -0
  801. package/build/esm/signal/ScaleExp.js.map +1 -0
  802. package/build/esm/signal/Signal.d.ts +92 -0
  803. package/build/esm/signal/Signal.js +183 -0
  804. package/build/esm/signal/Signal.js.map +1 -0
  805. package/build/esm/signal/SignalOperator.d.ts +9 -0
  806. package/build/esm/signal/SignalOperator.js +16 -0
  807. package/build/esm/signal/SignalOperator.js.map +1 -0
  808. package/build/esm/signal/Subtract.d.ts +48 -0
  809. package/build/esm/signal/Subtract.js +58 -0
  810. package/build/esm/signal/Subtract.js.map +1 -0
  811. package/build/esm/signal/SyncedSignal.d.ts +53 -0
  812. package/build/esm/signal/SyncedSignal.js +124 -0
  813. package/build/esm/signal/SyncedSignal.js.map +1 -0
  814. package/build/esm/signal/ToneConstantSource.d.ts +39 -0
  815. package/build/esm/signal/ToneConstantSource.js +61 -0
  816. package/build/esm/signal/ToneConstantSource.js.map +1 -0
  817. package/build/esm/signal/WaveShaper.d.ts +81 -0
  818. package/build/esm/signal/WaveShaper.js +99 -0
  819. package/build/esm/signal/WaveShaper.js.map +1 -0
  820. package/build/esm/signal/Zero.d.ts +29 -0
  821. package/build/esm/signal/Zero.js +38 -0
  822. package/build/esm/signal/Zero.js.map +1 -0
  823. package/build/esm/signal/index.d.ts +16 -0
  824. package/build/esm/signal/index.js +17 -0
  825. package/build/esm/signal/index.js.map +1 -0
  826. package/build/esm/source/Noise.d.ts +96 -0
  827. package/build/esm/source/Noise.js +225 -0
  828. package/build/esm/source/Noise.js.map +1 -0
  829. package/build/esm/source/OneShotSource.d.ts +102 -0
  830. package/build/esm/source/OneShotSource.js +183 -0
  831. package/build/esm/source/OneShotSource.js.map +1 -0
  832. package/build/esm/source/Source.d.ts +155 -0
  833. package/build/esm/source/Source.js +281 -0
  834. package/build/esm/source/Source.js.map +1 -0
  835. package/build/esm/source/UserMedia.d.ts +123 -0
  836. package/build/esm/source/UserMedia.js +214 -0
  837. package/build/esm/source/UserMedia.js.map +1 -0
  838. package/build/esm/source/buffer/GrainPlayer.d.ts +135 -0
  839. package/build/esm/source/buffer/GrainPlayer.js +235 -0
  840. package/build/esm/source/buffer/GrainPlayer.js.map +1 -0
  841. package/build/esm/source/buffer/Player.d.ts +190 -0
  842. package/build/esm/source/buffer/Player.js +352 -0
  843. package/build/esm/source/buffer/Player.js.map +1 -0
  844. package/build/esm/source/buffer/Players.d.ts +121 -0
  845. package/build/esm/source/buffer/Players.js +162 -0
  846. package/build/esm/source/buffer/Players.js.map +1 -0
  847. package/build/esm/source/buffer/ToneBufferSource.d.ts +97 -0
  848. package/build/esm/source/buffer/ToneBufferSource.js +196 -0
  849. package/build/esm/source/buffer/ToneBufferSource.js.map +1 -0
  850. package/build/esm/source/index.d.ts +15 -0
  851. package/build/esm/source/index.js +16 -0
  852. package/build/esm/source/index.js.map +1 -0
  853. package/build/esm/source/oscillator/AMOscillator.d.ts +101 -0
  854. package/build/esm/source/oscillator/AMOscillator.js +157 -0
  855. package/build/esm/source/oscillator/AMOscillator.js.map +1 -0
  856. package/build/esm/source/oscillator/FMOscillator.d.ts +101 -0
  857. package/build/esm/source/oscillator/FMOscillator.js +172 -0
  858. package/build/esm/source/oscillator/FMOscillator.js.map +1 -0
  859. package/build/esm/source/oscillator/FatOscillator.d.ts +99 -0
  860. package/build/esm/source/oscillator/FatOscillator.js +195 -0
  861. package/build/esm/source/oscillator/FatOscillator.js.map +1 -0
  862. package/build/esm/source/oscillator/LFO.d.ts +167 -0
  863. package/build/esm/source/oscillator/LFO.js +233 -0
  864. package/build/esm/source/oscillator/LFO.js.map +1 -0
  865. package/build/esm/source/oscillator/OmniOscillator.d.ts +162 -0
  866. package/build/esm/source/oscillator/OmniOscillator.js +348 -0
  867. package/build/esm/source/oscillator/OmniOscillator.js.map +1 -0
  868. package/build/esm/source/oscillator/Oscillator.d.ts +125 -0
  869. package/build/esm/source/oscillator/Oscillator.js +379 -0
  870. package/build/esm/source/oscillator/Oscillator.js.map +1 -0
  871. package/build/esm/source/oscillator/OscillatorInterface.d.ts +298 -0
  872. package/build/esm/source/oscillator/OscillatorInterface.js +22 -0
  873. package/build/esm/source/oscillator/OscillatorInterface.js.map +1 -0
  874. package/build/esm/source/oscillator/PWMOscillator.d.ts +94 -0
  875. package/build/esm/source/oscillator/PWMOscillator.js +136 -0
  876. package/build/esm/source/oscillator/PWMOscillator.js.map +1 -0
  877. package/build/esm/source/oscillator/PulseOscillator.d.ts +119 -0
  878. package/build/esm/source/oscillator/PulseOscillator.js +175 -0
  879. package/build/esm/source/oscillator/PulseOscillator.js.map +1 -0
  880. package/build/esm/source/oscillator/ToneOscillatorNode.d.ts +57 -0
  881. package/build/esm/source/oscillator/ToneOscillatorNode.js +90 -0
  882. package/build/esm/source/oscillator/ToneOscillatorNode.js.map +1 -0
  883. package/build/esm/version.d.ts +1 -0
  884. package/build/esm/version.js +2 -0
  885. package/build/esm/version.js.map +1 -0
  886. package/docs/tone.json +1 -0
  887. package/package.json +116 -0
@@ -0,0 +1,591 @@
1
+ import { TimeClass } from "../../core/type/Time";
2
+ import { TimelineValue } from "../../core/util/TimelineValue";
3
+ import { onContextClose, onContextInit } from "../context/ContextInitialization";
4
+ import { Gain } from "../context/Gain";
5
+ import { ToneWithContext } from "../context/ToneWithContext";
6
+ import { TicksClass } from "../type/Ticks";
7
+ import { TransportTimeClass } from "../type/TransportTime";
8
+ import { optionsFromArguments } from "../util/Defaults";
9
+ import { Emitter } from "../util/Emitter";
10
+ import { readOnly, writable } from "../util/Interface";
11
+ import { IntervalTimeline } from "../util/IntervalTimeline";
12
+ import { Timeline } from "../util/Timeline";
13
+ import { isArray, isDefined } from "../util/TypeCheck";
14
+ import { Clock } from "./Clock";
15
+ import { TransportEvent } from "./TransportEvent";
16
+ import { TransportRepeatEvent } from "./TransportRepeatEvent";
17
+ /**
18
+ * Transport for timing musical events.
19
+ * Supports tempo curves and time changes. Unlike browser-based timing (setInterval, requestAnimationFrame)
20
+ * Transport timing events pass in the exact time of the scheduled event
21
+ * in the argument of the callback function. Pass that time value to the object
22
+ * you're scheduling. <br><br>
23
+ * A single transport is created for you when the library is initialized.
24
+ * <br><br>
25
+ * The transport emits the events: "start", "stop", "pause", and "loop" which are
26
+ * called with the time of that event as the argument.
27
+ *
28
+ * @example
29
+ * const osc = new Tone.Oscillator().toDestination();
30
+ * // repeated event every 8th note
31
+ * Tone.Transport.scheduleRepeat((time) => {
32
+ * // use the callback time to schedule events
33
+ * osc.start(time).stop(time + 0.1);
34
+ * }, "8n");
35
+ * // transport must be started before it starts invoking events
36
+ * Tone.Transport.start();
37
+ * @category Core
38
+ */
39
+ export class Transport extends ToneWithContext {
40
+ constructor() {
41
+ super(optionsFromArguments(Transport.getDefaults(), arguments));
42
+ this.name = "Transport";
43
+ //-------------------------------------
44
+ // LOOPING
45
+ //-------------------------------------
46
+ /**
47
+ * If the transport loops or not.
48
+ */
49
+ this._loop = new TimelineValue(false);
50
+ /**
51
+ * The loop start position in ticks
52
+ */
53
+ this._loopStart = 0;
54
+ /**
55
+ * The loop end position in ticks
56
+ */
57
+ this._loopEnd = 0;
58
+ //-------------------------------------
59
+ // TIMELINE EVENTS
60
+ //-------------------------------------
61
+ /**
62
+ * All the events in an object to keep track by ID
63
+ */
64
+ this._scheduledEvents = {};
65
+ /**
66
+ * The scheduled events.
67
+ */
68
+ this._timeline = new Timeline();
69
+ /**
70
+ * Repeated events
71
+ */
72
+ this._repeatedEvents = new IntervalTimeline();
73
+ /**
74
+ * All of the synced Signals
75
+ */
76
+ this._syncedSignals = [];
77
+ /**
78
+ * The swing amount
79
+ */
80
+ this._swingAmount = 0;
81
+ const options = optionsFromArguments(Transport.getDefaults(), arguments);
82
+ // CLOCK/TEMPO
83
+ this._ppq = options.ppq;
84
+ this._clock = new Clock({
85
+ callback: this._processTick.bind(this),
86
+ context: this.context,
87
+ frequency: 0,
88
+ units: "bpm",
89
+ });
90
+ this._bindClockEvents();
91
+ this.bpm = this._clock.frequency;
92
+ this._clock.frequency.multiplier = options.ppq;
93
+ this.bpm.setValueAtTime(options.bpm, 0);
94
+ readOnly(this, "bpm");
95
+ this._timeSignature = options.timeSignature;
96
+ // SWING
97
+ this._swingTicks = options.ppq / 2; // 8n
98
+ }
99
+ static getDefaults() {
100
+ return Object.assign(ToneWithContext.getDefaults(), {
101
+ bpm: 120,
102
+ loopEnd: "4m",
103
+ loopStart: 0,
104
+ ppq: 192,
105
+ swing: 0,
106
+ swingSubdivision: "8n",
107
+ timeSignature: 4,
108
+ });
109
+ }
110
+ //-------------------------------------
111
+ // TICKS
112
+ //-------------------------------------
113
+ /**
114
+ * called on every tick
115
+ * @param tickTime clock relative tick time
116
+ */
117
+ _processTick(tickTime, ticks) {
118
+ // do the loop test
119
+ if (this._loop.get(tickTime)) {
120
+ if (ticks >= this._loopEnd) {
121
+ this.emit("loopEnd", tickTime);
122
+ this._clock.setTicksAtTime(this._loopStart, tickTime);
123
+ ticks = this._loopStart;
124
+ this.emit("loopStart", tickTime, this._clock.getSecondsAtTime(tickTime));
125
+ this.emit("loop", tickTime);
126
+ }
127
+ }
128
+ // handle swing
129
+ if (this._swingAmount > 0 &&
130
+ ticks % this._ppq !== 0 && // not on a downbeat
131
+ ticks % (this._swingTicks * 2) !== 0) {
132
+ // add some swing
133
+ const progress = (ticks % (this._swingTicks * 2)) / (this._swingTicks * 2);
134
+ const amount = Math.sin((progress) * Math.PI) * this._swingAmount;
135
+ tickTime += new TicksClass(this.context, this._swingTicks * 2 / 3).toSeconds() * amount;
136
+ }
137
+ // invoke the timeline events scheduled on this tick
138
+ this._timeline.forEachAtTime(ticks, event => event.invoke(tickTime));
139
+ }
140
+ //-------------------------------------
141
+ // SCHEDULABLE EVENTS
142
+ //-------------------------------------
143
+ /**
144
+ * Schedule an event along the timeline.
145
+ * @param callback The callback to be invoked at the time.
146
+ * @param time The time to invoke the callback at.
147
+ * @return The id of the event which can be used for canceling the event.
148
+ * @example
149
+ * // schedule an event on the 16th measure
150
+ * Tone.Transport.schedule((time) => {
151
+ * // invoked on measure 16
152
+ * console.log("measure 16!");
153
+ * }, "16:0:0");
154
+ */
155
+ schedule(callback, time) {
156
+ const event = new TransportEvent(this, {
157
+ callback,
158
+ time: new TransportTimeClass(this.context, time).toTicks(),
159
+ });
160
+ return this._addEvent(event, this._timeline);
161
+ }
162
+ /**
163
+ * Schedule a repeated event along the timeline. The event will fire
164
+ * at the `interval` starting at the `startTime` and for the specified
165
+ * `duration`.
166
+ * @param callback The callback to invoke.
167
+ * @param interval The duration between successive callbacks. Must be a positive number.
168
+ * @param startTime When along the timeline the events should start being invoked.
169
+ * @param duration How long the event should repeat.
170
+ * @return The ID of the scheduled event. Use this to cancel the event.
171
+ * @example
172
+ * const osc = new Tone.Oscillator().toDestination().start();
173
+ * // a callback invoked every eighth note after the first measure
174
+ * Tone.Transport.scheduleRepeat((time) => {
175
+ * osc.start(time).stop(time + 0.1);
176
+ * }, "8n", "1m");
177
+ */
178
+ scheduleRepeat(callback, interval, startTime, duration = Infinity) {
179
+ const event = new TransportRepeatEvent(this, {
180
+ callback,
181
+ duration: new TimeClass(this.context, duration).toTicks(),
182
+ interval: new TimeClass(this.context, interval).toTicks(),
183
+ time: new TransportTimeClass(this.context, startTime).toTicks(),
184
+ });
185
+ // kick it off if the Transport is started
186
+ // @ts-ignore
187
+ return this._addEvent(event, this._repeatedEvents);
188
+ }
189
+ /**
190
+ * Schedule an event that will be removed after it is invoked.
191
+ * @param callback The callback to invoke once.
192
+ * @param time The time the callback should be invoked.
193
+ * @returns The ID of the scheduled event.
194
+ */
195
+ scheduleOnce(callback, time) {
196
+ const event = new TransportEvent(this, {
197
+ callback,
198
+ once: true,
199
+ time: new TransportTimeClass(this.context, time).toTicks(),
200
+ });
201
+ return this._addEvent(event, this._timeline);
202
+ }
203
+ /**
204
+ * Clear the passed in event id from the timeline
205
+ * @param eventId The id of the event.
206
+ */
207
+ clear(eventId) {
208
+ if (this._scheduledEvents.hasOwnProperty(eventId)) {
209
+ const item = this._scheduledEvents[eventId.toString()];
210
+ item.timeline.remove(item.event);
211
+ item.event.dispose();
212
+ delete this._scheduledEvents[eventId.toString()];
213
+ }
214
+ return this;
215
+ }
216
+ /**
217
+ * Add an event to the correct timeline. Keep track of the
218
+ * timeline it was added to.
219
+ * @returns the event id which was just added
220
+ */
221
+ _addEvent(event, timeline) {
222
+ this._scheduledEvents[event.id.toString()] = {
223
+ event,
224
+ timeline,
225
+ };
226
+ timeline.add(event);
227
+ return event.id;
228
+ }
229
+ /**
230
+ * Remove scheduled events from the timeline after
231
+ * the given time. Repeated events will be removed
232
+ * if their startTime is after the given time
233
+ * @param after Clear all events after this time.
234
+ */
235
+ cancel(after = 0) {
236
+ const computedAfter = this.toTicks(after);
237
+ this._timeline.forEachFrom(computedAfter, event => this.clear(event.id));
238
+ this._repeatedEvents.forEachFrom(computedAfter, event => this.clear(event.id));
239
+ return this;
240
+ }
241
+ //-------------------------------------
242
+ // START/STOP/PAUSE
243
+ //-------------------------------------
244
+ /**
245
+ * Bind start/stop/pause events from the clock and emit them.
246
+ */
247
+ _bindClockEvents() {
248
+ this._clock.on("start", (time, offset) => {
249
+ offset = new TicksClass(this.context, offset).toSeconds();
250
+ this.emit("start", time, offset);
251
+ });
252
+ this._clock.on("stop", (time) => {
253
+ this.emit("stop", time);
254
+ });
255
+ this._clock.on("pause", (time) => {
256
+ this.emit("pause", time);
257
+ });
258
+ }
259
+ /**
260
+ * Returns the playback state of the source, either "started", "stopped", or "paused"
261
+ */
262
+ get state() {
263
+ return this._clock.getStateAtTime(this.now());
264
+ }
265
+ /**
266
+ * Start the transport and all sources synced to the transport.
267
+ * @param time The time when the transport should start.
268
+ * @param offset The timeline offset to start the transport.
269
+ * @example
270
+ * // start the transport in one second starting at beginning of the 5th measure.
271
+ * Tone.Transport.start("+1", "4:0:0");
272
+ */
273
+ start(time, offset) {
274
+ let offsetTicks;
275
+ if (isDefined(offset)) {
276
+ offsetTicks = this.toTicks(offset);
277
+ }
278
+ // start the clock
279
+ this._clock.start(time, offsetTicks);
280
+ return this;
281
+ }
282
+ /**
283
+ * Stop the transport and all sources synced to the transport.
284
+ * @param time The time when the transport should stop.
285
+ * @example
286
+ * Tone.Transport.stop();
287
+ */
288
+ stop(time) {
289
+ this._clock.stop(time);
290
+ return this;
291
+ }
292
+ /**
293
+ * Pause the transport and all sources synced to the transport.
294
+ */
295
+ pause(time) {
296
+ this._clock.pause(time);
297
+ return this;
298
+ }
299
+ /**
300
+ * Toggle the current state of the transport. If it is
301
+ * started, it will stop it, otherwise it will start the Transport.
302
+ * @param time The time of the event
303
+ */
304
+ toggle(time) {
305
+ time = this.toSeconds(time);
306
+ if (this._clock.getStateAtTime(time) !== "started") {
307
+ this.start(time);
308
+ }
309
+ else {
310
+ this.stop(time);
311
+ }
312
+ return this;
313
+ }
314
+ //-------------------------------------
315
+ // SETTERS/GETTERS
316
+ //-------------------------------------
317
+ /**
318
+ * The time signature as just the numerator over 4.
319
+ * For example 4/4 would be just 4 and 6/8 would be 3.
320
+ * @example
321
+ * // common time
322
+ * Tone.Transport.timeSignature = 4;
323
+ * // 7/8
324
+ * Tone.Transport.timeSignature = [7, 8];
325
+ * // this will be reduced to a single number
326
+ * Tone.Transport.timeSignature; // returns 3.5
327
+ */
328
+ get timeSignature() {
329
+ return this._timeSignature;
330
+ }
331
+ set timeSignature(timeSig) {
332
+ if (isArray(timeSig)) {
333
+ timeSig = (timeSig[0] / timeSig[1]) * 4;
334
+ }
335
+ this._timeSignature = timeSig;
336
+ }
337
+ /**
338
+ * When the Transport.loop = true, this is the starting position of the loop.
339
+ */
340
+ get loopStart() {
341
+ return new TimeClass(this.context, this._loopStart, "i").toSeconds();
342
+ }
343
+ set loopStart(startPosition) {
344
+ this._loopStart = this.toTicks(startPosition);
345
+ }
346
+ /**
347
+ * When the Transport.loop = true, this is the ending position of the loop.
348
+ */
349
+ get loopEnd() {
350
+ return new TimeClass(this.context, this._loopEnd, "i").toSeconds();
351
+ }
352
+ set loopEnd(endPosition) {
353
+ this._loopEnd = this.toTicks(endPosition);
354
+ }
355
+ /**
356
+ * If the transport loops or not.
357
+ */
358
+ get loop() {
359
+ return this._loop.get(this.now());
360
+ }
361
+ set loop(loop) {
362
+ this._loop.set(loop, this.now());
363
+ }
364
+ /**
365
+ * Set the loop start and stop at the same time.
366
+ * @example
367
+ * // loop over the first measure
368
+ * Tone.Transport.setLoopPoints(0, "1m");
369
+ * Tone.Transport.loop = true;
370
+ */
371
+ setLoopPoints(startPosition, endPosition) {
372
+ this.loopStart = startPosition;
373
+ this.loopEnd = endPosition;
374
+ return this;
375
+ }
376
+ /**
377
+ * The swing value. Between 0-1 where 1 equal to the note + half the subdivision.
378
+ */
379
+ get swing() {
380
+ return this._swingAmount;
381
+ }
382
+ set swing(amount) {
383
+ // scale the values to a normal range
384
+ this._swingAmount = amount;
385
+ }
386
+ /**
387
+ * Set the subdivision which the swing will be applied to.
388
+ * The default value is an 8th note. Value must be less
389
+ * than a quarter note.
390
+ */
391
+ get swingSubdivision() {
392
+ return new TicksClass(this.context, this._swingTicks).toNotation();
393
+ }
394
+ set swingSubdivision(subdivision) {
395
+ this._swingTicks = this.toTicks(subdivision);
396
+ }
397
+ /**
398
+ * The Transport's position in Bars:Beats:Sixteenths.
399
+ * Setting the value will jump to that position right away.
400
+ */
401
+ get position() {
402
+ const now = this.now();
403
+ const ticks = this._clock.getTicksAtTime(now);
404
+ return new TicksClass(this.context, ticks).toBarsBeatsSixteenths();
405
+ }
406
+ set position(progress) {
407
+ const ticks = this.toTicks(progress);
408
+ this.ticks = ticks;
409
+ }
410
+ /**
411
+ * The Transport's position in seconds
412
+ * Setting the value will jump to that position right away.
413
+ */
414
+ get seconds() {
415
+ return this._clock.seconds;
416
+ }
417
+ set seconds(s) {
418
+ const now = this.now();
419
+ const ticks = this._clock.frequency.timeToTicks(s, now);
420
+ this.ticks = ticks;
421
+ }
422
+ /**
423
+ * The Transport's loop position as a normalized value. Always
424
+ * returns 0 if the transport if loop is not true.
425
+ */
426
+ get progress() {
427
+ if (this.loop) {
428
+ const now = this.now();
429
+ const ticks = this._clock.getTicksAtTime(now);
430
+ return (ticks - this._loopStart) / (this._loopEnd - this._loopStart);
431
+ }
432
+ else {
433
+ return 0;
434
+ }
435
+ }
436
+ /**
437
+ * The transports current tick position.
438
+ */
439
+ get ticks() {
440
+ return this._clock.ticks;
441
+ }
442
+ set ticks(t) {
443
+ if (this._clock.ticks !== t) {
444
+ const now = this.now();
445
+ // stop everything synced to the transport
446
+ if (this.state === "started") {
447
+ const ticks = this._clock.getTicksAtTime(now);
448
+ // schedule to start on the next tick, #573
449
+ const remainingTick = this._clock.frequency.getDurationOfTicks(Math.ceil(ticks) - ticks, now);
450
+ const time = now + remainingTick;
451
+ this.emit("stop", time);
452
+ this._clock.setTicksAtTime(t, time);
453
+ // restart it with the new time
454
+ this.emit("start", time, this._clock.getSecondsAtTime(time));
455
+ }
456
+ else {
457
+ this.emit("ticks", now);
458
+ this._clock.setTicksAtTime(t, now);
459
+ }
460
+ }
461
+ }
462
+ /**
463
+ * Get the clock's ticks at the given time.
464
+ * @param time When to get the tick value
465
+ * @return The tick value at the given time.
466
+ */
467
+ getTicksAtTime(time) {
468
+ return this._clock.getTicksAtTime(time);
469
+ }
470
+ /**
471
+ * Return the elapsed seconds at the given time.
472
+ * @param time When to get the elapsed seconds
473
+ * @return The number of elapsed seconds
474
+ */
475
+ getSecondsAtTime(time) {
476
+ return this._clock.getSecondsAtTime(time);
477
+ }
478
+ /**
479
+ * Pulses Per Quarter note. This is the smallest resolution
480
+ * the Transport timing supports. This should be set once
481
+ * on initialization and not set again. Changing this value
482
+ * after other objects have been created can cause problems.
483
+ */
484
+ get PPQ() {
485
+ return this._clock.frequency.multiplier;
486
+ }
487
+ set PPQ(ppq) {
488
+ this._clock.frequency.multiplier = ppq;
489
+ }
490
+ //-------------------------------------
491
+ // SYNCING
492
+ //-------------------------------------
493
+ /**
494
+ * Returns the time aligned to the next subdivision
495
+ * of the Transport. If the Transport is not started,
496
+ * it will return 0.
497
+ * Note: this will not work precisely during tempo ramps.
498
+ * @param subdivision The subdivision to quantize to
499
+ * @return The context time of the next subdivision.
500
+ * @example
501
+ * // the transport must be started, otherwise returns 0
502
+ * Tone.Transport.start();
503
+ * Tone.Transport.nextSubdivision("4n");
504
+ */
505
+ nextSubdivision(subdivision) {
506
+ subdivision = this.toTicks(subdivision);
507
+ if (this.state !== "started") {
508
+ // if the transport's not started, return 0
509
+ return 0;
510
+ }
511
+ else {
512
+ const now = this.now();
513
+ // the remainder of the current ticks and the subdivision
514
+ const transportPos = this.getTicksAtTime(now);
515
+ const remainingTicks = subdivision - transportPos % subdivision;
516
+ return this._clock.nextTickTime(remainingTicks, now);
517
+ }
518
+ }
519
+ /**
520
+ * Attaches the signal to the tempo control signal so that
521
+ * any changes in the tempo will change the signal in the same
522
+ * ratio.
523
+ *
524
+ * @param signal
525
+ * @param ratio Optionally pass in the ratio between the two signals.
526
+ * Otherwise it will be computed based on their current values.
527
+ */
528
+ syncSignal(signal, ratio) {
529
+ if (!ratio) {
530
+ // get the sync ratio
531
+ const now = this.now();
532
+ if (signal.getValueAtTime(now) !== 0) {
533
+ const bpm = this.bpm.getValueAtTime(now);
534
+ const computedFreq = 1 / (60 / bpm / this.PPQ);
535
+ ratio = signal.getValueAtTime(now) / computedFreq;
536
+ }
537
+ else {
538
+ ratio = 0;
539
+ }
540
+ }
541
+ const ratioSignal = new Gain(ratio);
542
+ // @ts-ignore
543
+ this.bpm.connect(ratioSignal);
544
+ // @ts-ignore
545
+ ratioSignal.connect(signal._param);
546
+ this._syncedSignals.push({
547
+ initial: signal.value,
548
+ ratio: ratioSignal,
549
+ signal,
550
+ });
551
+ signal.value = 0;
552
+ return this;
553
+ }
554
+ /**
555
+ * Unsyncs a previously synced signal from the transport's control.
556
+ * See Transport.syncSignal.
557
+ */
558
+ unsyncSignal(signal) {
559
+ for (let i = this._syncedSignals.length - 1; i >= 0; i--) {
560
+ const syncedSignal = this._syncedSignals[i];
561
+ if (syncedSignal.signal === signal) {
562
+ syncedSignal.ratio.dispose();
563
+ syncedSignal.signal.value = syncedSignal.initial;
564
+ this._syncedSignals.splice(i, 1);
565
+ }
566
+ }
567
+ return this;
568
+ }
569
+ /**
570
+ * Clean up.
571
+ */
572
+ dispose() {
573
+ super.dispose();
574
+ this._clock.dispose();
575
+ writable(this, "bpm");
576
+ this._timeline.dispose();
577
+ this._repeatedEvents.dispose();
578
+ return this;
579
+ }
580
+ }
581
+ Emitter.mixin(Transport);
582
+ //-------------------------------------
583
+ // INITIALIZATION
584
+ //-------------------------------------
585
+ onContextInit(context => {
586
+ context.transport = new Transport({ context });
587
+ });
588
+ onContextClose(context => {
589
+ context.transport.dispose();
590
+ });
591
+ //# sourceMappingURL=Transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transport.js","sourceRoot":"","sources":["../../../../Tone/core/clock/Transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,e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OAAO,CAAC,EAAE;IACvB,OAAO,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,OAAO,CAAC,EAAE;IACxB,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { Seconds, Ticks } from "../type/Units";
2
+ declare type Transport = import("../clock/Transport").Transport;
3
+ export interface TransportEventOptions {
4
+ callback: (time: number) => void;
5
+ once: boolean;
6
+ time: Ticks;
7
+ }
8
+ /**
9
+ * TransportEvent is an internal class used by [[Transport]]
10
+ * to schedule events. Do no invoke this class directly, it is
11
+ * handled from within Tone.Transport.
12
+ */
13
+ export declare class TransportEvent {
14
+ /**
15
+ * Reference to the Transport that created it
16
+ */
17
+ protected transport: Transport;
18
+ /**
19
+ * The unique id of the event
20
+ */
21
+ id: number;
22
+ /**
23
+ * The time the event starts
24
+ */
25
+ time: Ticks;
26
+ /**
27
+ * The callback to invoke
28
+ */
29
+ private callback?;
30
+ /**
31
+ * If the event should be removed after being invoked.
32
+ */
33
+ private _once;
34
+ /**
35
+ * The remaining value between the passed in time, and Math.floor(time).
36
+ * This value is later added back when scheduling to get sub-tick precision.
37
+ */
38
+ protected _remainderTime: number;
39
+ /**
40
+ * @param transport The transport object which the event belongs to
41
+ */
42
+ constructor(transport: Transport, opts: Partial<TransportEventOptions>);
43
+ static getDefaults(): TransportEventOptions;
44
+ /**
45
+ * Current ID counter
46
+ */
47
+ private static _eventId;
48
+ /**
49
+ * Get the time and remainder time.
50
+ */
51
+ protected get floatTime(): number;
52
+ /**
53
+ * Invoke the event callback.
54
+ * @param time The AudioContext time in seconds of the event
55
+ */
56
+ invoke(time: Seconds): void;
57
+ /**
58
+ * Clean up
59
+ */
60
+ dispose(): this;
61
+ }
62
+ export {};