Commit graph

674 commits

Author SHA1 Message Date
Yotam Mann
42cfbcd456 linting docs and examples 2019-10-22 23:04:52 -04:00
Yotam Mann
032808dd2a ensure that partialsCount is never below 0 2019-10-13 15:05:41 -04:00
Yotam Mann
2dab77c7a8 updating partialCount when partials is set 2019-10-09 17:32:37 -04:00
Yotam Mann
2753d3756b the partials length is controllable by the partialCount 2019-10-09 17:06:57 -04:00
Yotam Mann
54059825ae set the partials from the cache as well 2019-10-09 15:21:02 -04:00
Yotam Mann
9ad519ea10 feat: Get an oscillator wave as an array 2019-10-08 19:22:59 -04:00
Yotam Mann
10469ba924 only dispose when things are in the only AudioContext
otherwise it leads to silence

addresses #551
2019-10-04 12:04:53 -04:00
Yotam Mann
5f41b0bc76 assert that there is a device 2019-09-29 10:35:46 -04:00
Yotam Mann
4eb05a1ec0 using promise response instead of done() 2019-09-27 17:57:19 -04:00
Yotam Mann
ed367e0f9b adding nominal range to properties 2019-09-24 17:21:59 -04:00
Yotam Mann
0ffc5d65da deleting old js files 2019-09-20 18:51:51 -04:00
Yotam Mann
4d5b63d97e adding categories for docs 2019-09-20 18:51:45 -04:00
Yotam Mann
1dd208c1ea converting UserMedia to ts 2019-09-20 18:51:17 -04:00
Yotam Mann
26855a9398 using the clocks ticks instead of tracking offset
addresses #544
2019-09-20 17:46:30 -04:00
Yotam Mann
72b9604d8e using epsilon floating point comparisons 2019-09-20 17:45:22 -04:00
Yotam Mann
9625492b2f including GrainPlayer in export 2019-09-20 11:06:40 -04:00
Yotam Mann
82ae4930af adding some additional coverage tests 2019-09-20 10:11:03 -04:00
Yotam Mann
0e0073b75b adding logging for restart 2019-09-20 00:16:45 -04:00
Yotam Mann
3f6bcd9438 undoing additional lookAhead
turns out to not be necessary
2019-09-20 00:16:03 -04:00
Yotam Mann
70efec4637 add an additional lookAhead to the onended callback
this fixes an issue where the source was scheduled to stop in the time between the current time and the lookAhead time.

fixes #422
2019-09-19 18:22:44 -04:00
Yotam Mann
1426da90c4 adding restart method
with test
2019-09-19 17:09:30 -04:00
Yotam Mann
3ab260de90 import transport for the side effects 2019-09-19 16:55:57 -04:00
Yotam Mann
5d128470c5 convert GrainPlayer to typescript 2019-09-19 16:55:46 -04:00
Yotam Mann
d82d715c64 testing out the max cache-size for the oscillator periodic wave 2019-09-17 14:04:32 -04:00
Yotam Mann
470e906d15 doesn't require a custom get function
testing that it gets all of the attributes
2019-09-17 12:21:00 -04:00
Yotam Mann
36db2c3cdc updating example 2019-09-16 10:49:35 -04:00
Yotam Mann
401d278063 Adding categories to all the nodes 2019-09-16 10:15:23 -04:00
Yotam Mann
e8e785ffdd linting 2019-09-15 23:32:40 -04:00
Yotam Mann
1bde88a19b linting 2019-09-14 18:12:44 -04:00
Yotam Mann
61c9f191b6 removing calls to tslint
getting rid of tslint from project and using eslint instead
2019-09-14 18:06:46 -04:00
Yotam Mann
286692e67b updating block comment style 2019-09-14 17:47:07 -04:00
Yotam Mann
261a5f4c3b normalizing whitespace in comments 2019-09-14 16:39:18 -04:00
Yotam Mann
9be3ffeb05 removing js files 2019-09-12 15:54:28 -04:00
Yotam Mann
6c67ebd9ec fixing example 2019-09-12 15:52:47 -04:00
Yotam Mann
05f83239d2 removing old js file 2019-09-09 23:51:44 -04:00
Yotam Mann
4453025efc testing that it can be constructed with an AudioBuffer 2019-09-09 23:42:04 -04:00
Yotam Mann
1152ee1ad6 converting Players to typescript 2019-09-09 23:39:32 -04:00
Yotam Mann
1e37601d5d converting LFO to typescript 2019-09-04 22:57:27 -04:00
Yotam Mann
b2b8a32c91 expose getInitialValue
returns the value of the oscillator before it's started
2019-09-04 20:01:16 -04:00
Yotam Mann
736106de5f accidentally put extra tab before name 2019-09-04 19:18:44 -04:00
Yotam Mann
2289f3c67f renaming OscillatorNode file to ToneAudioNode 2019-09-04 18:40:28 -04:00
Yotam Mann
51291538a8 renaming file to match class name 2019-09-04 18:39:28 -04:00
Yotam Mann
75a35108af name is a readonly string 2019-09-04 18:38:04 -04:00
Yotam Mann
a8962eb824 also export Options 2019-09-04 18:34:42 -04:00
Yotam Mann
f0f997c09d swapping constructor order
easier to read in the docs
2019-08-30 09:34:04 -07:00
Yotam Mann
c9d757aaa6 removing references to "@private"
old jsdoc comments
2019-08-30 09:08:29 -07:00
Yotam Mann
3e2de8f259 fixing spacing
typedoc wants one space before the "@"
2019-08-30 09:06:38 -07:00
Yotam Mann
48ec3f9320 exporting all options 2019-08-30 09:04:03 -07:00
Yotam Mann
5bdbda9c1c updating docs 2019-08-30 09:03:42 -07:00
Yotam Mann
1dba46a822 removing converting files 2019-08-27 10:06:34 -07:00
Yotam Mann
230287f813 updating docs 2019-08-27 10:02:31 -07:00
Yotam Mann
d57dd7e07a updating docs 2019-08-27 08:47:52 -07:00
Yotam Mann
3fc30c4884 Merge branch 'dev' into typescript 2019-08-26 11:05:12 -07:00
Yotam Mann
9982db3d1b adding fadein/out to noise 2019-08-19 18:50:11 -07:00
Yotam Mann
77806402b6 omiting synth options on each individual options object
instead of on the entire object which caused some issues
2019-08-14 13:16:23 -04:00
Yotam Mann
9494b570b4 clamping time to current time when not synced
correctly this time
2019-08-14 11:52:20 -04:00
Yotam Mann
68dac541dd using computed values in protected calls to _start and _stop 2019-08-14 10:44:27 -04:00
Yotam Mann
85847df8d2 removing clearing onended callback
introduces bugs when multiple oscillators are scheduled to start/stop in the future, the onended callback is not invoked
2019-08-14 10:43:16 -04:00
Yotam Mann
177e903589 logging the computed time 2019-08-14 10:02:22 -04:00
Yotam Mann
6e77fe2e35 clearing onended callback on old oscillators when restarting 2019-08-13 19:36:10 -04:00
Yotam Mann
4594855dc3 adding logging to Source 2019-08-13 19:35:40 -04:00
Yotam Mann
b58812b36a adding stop and cancelStop logging 2019-08-13 19:34:39 -04:00
Yotam Mann
4d00150b66 computing time 2019-08-13 18:35:07 -04:00
Yotam Mann
511d98564b adding some tests for full coverage 2019-08-12 09:37:48 -04:00
Yotam Mann
07cdf6840e adding onstop to noise 2019-08-11 11:42:17 -04:00
Yotam Mann
f6843947d8 adding onstop to all the sources 2019-08-10 11:51:35 -04:00
Yotam Mann
0719a8ba9d cancel stop when the ending is implicit 2019-08-09 23:35:08 -04:00
Yotam Mann
fdbf9d64bf removing 'only' from tests 2019-08-09 23:11:51 -04:00
Yotam Mann
d507188149 Player.onstop is invoked when the buffer has stopped
fixes #519
2019-08-09 23:07:09 -04:00
Yotam Mann
63d68f3446 onended callback passes in the file in the parameter 2019-08-09 23:02:28 -04:00
Yotam Mann
73dbca2e1b removing unused import 2019-08-09 23:00:51 -04:00
Yotam Mann
32d0dfea0e removing 'only' from tests 2019-08-09 20:01:02 -04:00
Yotam Mann
27e7fbcb91 source tests
testing syncing with different offsets and timings
2019-08-09 19:53:10 -04:00
Yotam Mann
25e24800d4 stop the oscillator if it's started 2019-08-08 16:32:22 -04:00
Yotam Mann
1360828a6c caching periodic wave computations
helps when creating many custom oscillators with the same phase or partials
2019-08-08 14:22:15 -04:00
Yotam Mann
4a7c8809e8 linting 2019-08-08 14:17:41 -04:00
Yotam Mann
38d6f9d242 optimization by moving child objects into constructor
means that in many cases the param won't be assigned twice
2019-08-08 14:15:56 -04:00
Yotam Mann
73bc128265 small optimization when partials list is [] 2019-08-08 13:05:34 -04:00
Yotam Mann
f7405d963a Removing disconnect on ended
not necessary and caused a lot of issues

fixes #463
2019-08-07 11:50:44 -04:00
Yotam Mann
c0a70924ad Fixing typing on Oscillator params 2019-08-06 18:24:32 -04:00
Yotam Mann
56db8b3a7a simplifying _internalChannels
channelCount/Mode/Interpretation check the input/output nodes, which removes the need for many classes to have _internalChannels
2019-08-03 12:00:14 -04:00
Yotam Mann
b52103652f doc'ing 2019-08-02 21:49:38 -04:00
Yotam Mann
4364f2f843 no longer necessary to pass in number of inputs
the count is inferred by checking the input or output node
2019-08-02 21:47:57 -04:00
Yotam Mann
52bcac2599 setting name to readonly 2019-08-02 21:09:35 -04:00
Yotam Mann
858af77521 fixing offset errors 2019-07-30 15:53:19 -04:00
Yotam Mann
6e5e8b3399 using specific types
importing them so there are not multiple import type errors
2019-07-30 15:35:27 -04:00
Yotam Mann
474ec85408 fixing default duration
made it so that the player never started when Player was synced.
2019-07-30 14:51:07 -04:00
Yotam Mann
bfc3d7ed15 toMaster() -> toDestination()
more consistent with the Web Audio API
2019-07-25 11:32:56 -04:00
Yotam Mann
923940576c abstract classes must take the options object
no passing in individual parameters. This simplifies the code a little
2019-07-24 23:33:31 -04:00
Yotam Mann
9051687276 exporting player 2019-07-24 21:54:38 -04:00
Yotam Mann
b858f03040 disconnecting the oscillator on dispose 2019-07-24 19:30:53 -04:00
Yotam Mann
97002d776f using already computed fadeOut time 2019-07-24 19:30:31 -04:00
Yotam Mann
fa95e74ab9 removing the disconnect onended
causes glitches and clicks. might be because the frequency.disconnect is not fully implemented
2019-07-24 19:28:39 -04:00
Yotam Mann
1c8210fb25 using Set instead of array 2019-07-23 13:47:36 -04:00
Yotam Mann
53df0f3caa differentiating between BasicPlaybackState and PlaybackState
PlaybackState includes "paused"
2019-07-23 13:43:35 -04:00
Yotam Mann
9306e5188c adding additional option to StateTimeline.add
enables more strict typing of returned object
2019-07-23 13:43:11 -04:00
Yotam Mann
ffad8c1475 confirm that an instance was disposed
implement Tone.prototype.dispose which flips a boolean wasDisposed.
2019-07-23 12:11:57 -04:00
Yotam Mann
07bd1d6867 updating docs 2019-07-23 11:48:26 -04:00
Yotam Mann
23bbbcb887 moving onended functionality to OneShotSource class 2019-07-23 11:47:32 -04:00
Yotam Mann
126b4a3226 updating typing 2019-07-23 11:46:08 -04:00
Yotam Mann
c31aa5fa77 converting Player to ts 2019-07-23 11:27:55 -04:00
Yotam Mann
1f4fcbf996 removing need for time to be clamped to currentTime
when player is synced, this is necessary
2019-07-23 11:27:43 -04:00
Yotam Mann
5a2e6ee714 moved some setup to parent class 2019-07-22 16:17:49 -04:00
Yotam Mann
8fcff92e39 time is optional 2019-07-22 16:17:03 -04:00
Yotam Mann
4540533727 one shot source sets up fadeIn/Out and curve 2019-07-22 16:16:54 -04:00
Yotam Mann
329ef50e45 Time is optional 2019-07-22 16:16:29 -04:00
Yotam Mann
cae39e7435 fixing test
something was accidentally commented out
2019-07-19 13:20:32 -04:00
Yotam Mann
b9dd8440b7 using OscillatorInterface to define all the oscilator properties 2019-07-19 12:32:17 -04:00
Yotam Mann
b36d57d5d0 deriving OmniOscillatorOptions from ConditionalOptions 2019-07-18 14:04:21 -04:00
Yotam Mann
6f040c3d2c checking that harmonicity is undefined when not set to AM or FM osc 2019-07-18 11:24:20 -04:00
Yotam Mann
11a353a117 linting 2019-07-18 10:21:42 -04:00
Yotam Mann
ea21746bc3 removing console 2019-07-18 10:21:34 -04:00
Yotam Mann
698dee1e73 changing <pre> tags to markdown 2019-07-17 17:40:47 -04:00
Yotam Mann
5d36e4a523 only use relative imports 2019-07-17 13:12:21 -04:00
Yotam Mann
70e945396d adding Omni to source export 2019-07-17 12:56:44 -04:00
Yotam Mann
0101edf173 converting OmniOscillator to ts 2019-07-17 12:55:34 -04:00
Yotam Mann
e7b898eb1a souce has 1 output 2019-07-17 12:54:42 -04:00
Yotam Mann
58bf79a872 increasing comparison threshold 2019-07-16 17:15:55 -04:00
Yotam Mann
7c6a873121 adding oscillator types 2019-07-16 17:10:47 -04:00
Yotam Mann
38d1197359 converting PWMOscillator to typescript 2019-07-16 17:10:07 -04:00
Yotam Mann
6bd5a0d45b updating docs 2019-07-16 17:09:54 -04:00
Yotam Mann
ad7d928be8 adding some doc image 2019-07-16 16:47:07 -04:00
Yotam Mann
f13336bcaa converting FatOscillator to ts 2019-07-16 16:30:09 -04:00
Yotam Mann
b339dee564 converting FMOscillator to typescript 2019-07-16 16:05:48 -04:00
Yotam Mann
e2ede8e8cc marking signal value to readonly 2019-07-16 16:05:38 -04:00
Yotam Mann
1277564f2c making oscillator props readonly 2019-07-16 09:32:22 -04:00
Yotam Mann
990c0f56ed using type instead of string types 2019-07-15 15:37:25 -04:00
Yotam Mann
f553fc3b63 surrounding diagram with pre tags 2019-07-15 12:33:40 -04:00
Yotam Mann
7c2e675c52 fixing typo and allowing for extended oscillator types 2019-07-15 12:33:31 -04:00
Yotam Mann
3b22baea67 updating doc diagram 2019-07-15 12:32:48 -04:00
Yotam Mann
4fc334c9c7 converting PulseOscillator to typescript 2019-07-15 12:22:55 -04:00
Yotam Mann
ab9b363965 converting AMOscillator to ts 2019-07-15 09:46:10 -04:00
Yotam Mann
b8f0d1d576 exporting OscillatorInterface
to make sure that all oscillators have the same interface
2019-07-15 09:45:56 -04:00
Yotam Mann
70086527ea changing OscillatorOptions -> ToneOscillatorOptions
to avoid any potential conflicts
2019-07-11 12:45:20 -04:00
Yotam Mann
219462fe9e cleaning up circular deps 2019-07-11 09:57:06 -04:00
Yotam Mann
f48696a69e Revert "every class calls super.dispose()"
This reverts commit 60a63cacf8.
2019-07-11 00:36:16 -04:00
Yotam Mann
60a63cacf8 every class calls super.dispose()
makes sure that things don't get disposed twice, which seems to be a common source of issues
2019-07-10 23:35:29 -04:00
Yotam Mann
ae2804fbc5 implement syncSignal 2019-07-10 23:33:36 -04:00
tambien
db35b3ae3a linting 2019-06-24 13:41:38 -04:00
Yotam Mann
02cfefa7ef
Merge branch 'typescript' into fix-typescript-linting 2019-06-24 13:33:18 -04:00
tambien
74671b0bda transport is no longer possibly undefined
since Context requires initialization step
2019-06-23 15:03:54 -04:00
tambien
62b4b47fd1 prefering toDestination over toMaster
more consistent with Web Audio API
2019-06-23 15:03:31 -04:00
tambien
8b4f1cfa19 Global now only manages global Context
global AudioContext was moved to AudioContext.ts
2019-06-23 15:02:38 -04:00
Garren Smith
efbd3c7f5f Fix linting issues
Also add in no-unused-expression-chai rule so that chai works with
tslint.
2019-06-23 12:53:57 +02:00
tambien
bc61ddaa2b simplifying logic 2019-06-19 18:17:24 -04:00
tambien
5896a7ca9c Update BufferSource.test.ts 2019-06-19 17:30:31 -04:00
tambien
c8396d38eb waiting for promise to resolve before starting test 2019-06-19 17:20:59 -04:00
tambien
5472ca1dcc offset does not default to 0 2019-06-19 17:20:20 -04:00
tambien
d2b7562021 waiting for promise to resolve before starting next test 2019-06-19 17:20:12 -04:00
tambien
9e229146c0 converting Oscillator to ts 2019-06-19 15:53:14 -04:00