Commit graph

866 commits

Author SHA1 Message Date
Yotam Mann
5bdbda9c1c updating docs 2019-08-30 09:03:42 -07:00
Yotam Mann
d073b68b09 fromContext returns the Tone.js objects bound to the passed in context
WIP
2019-08-30 09:03:08 -07:00
Yotam Mann
65c63e57a6 fixing doc error 2019-08-30 09:02:18 -07:00
Yotam Mann
99dc1412a8 doc'ing 2019-08-30 09:02:06 -07:00
Yotam Mann
7a5ca042d0 removing converting classes 2019-08-27 10:02:44 -07:00
Yotam Mann
230287f813 updating docs 2019-08-27 10:02:31 -07:00
Yotam Mann
a54ab4ea68 using typechecks from standardized-audio-context 2019-08-26 16:52:21 -07:00
Yotam Mann
0c805aec7b setContext takes a context or AudioContext or OfflineAudioContext 2019-08-26 10:55:43 -07:00
Yotam Mann
e6431d9890 using standardized-audio-context as AudioContext
goal of normalizing behavior across all browsers that support Web Audio.

thanks @chrisguttandin!
2019-08-26 10:55:04 -07:00
Yotam Mann
b09b81c64b adding categories 2019-08-26 10:44:43 -07:00
Yotam Mann
4c106930e0 adding typedocs 2019-08-21 13:59:01 -07:00
Yotam Mann
e6635058d5 adding readonly to name 2019-08-21 13:44:12 -07:00
Yotam Mann
b018cac113 adding categories 2019-08-21 13:01:12 -07:00
Yotam Mann
ce88eb9b88 using createAudioContext and createOfflineAudioContext
easier to eventually move those to standardized-audio-context
2019-08-19 11:15:53 -07:00
Yotam Mann
c353df6d5a skip this test
for now
2019-08-19 10:04:28 -07:00
Yotam Mann
94a9f78704 don't merge object when the type is AudioParam, AudioNode or AudioBuffer
addresses standardized-audio-context/#642
2019-08-19 10:04:21 -07:00
Yotam Mann
560ac489af moving tests to AdvancedTypeCheck 2019-08-19 10:01:37 -07:00
Yotam Mann
05586661b3 adding types 2019-08-19 09:59:31 -07:00
Yotam Mann
fd1bbb708b overloaded offline constructor 2019-08-19 09:59:07 -07:00
Yotam Mann
74ae46a7d4 adding interface to deepMerge which reflects the merging interfaces 2019-08-16 13:57:17 -04:00
Yotam Mann
d1c281c810 using isAudioParam and isAudioNode to test instanceof
will make migrating to standardized-audio-context easier
2019-08-16 12:49:04 -04:00
Yotam Mann
ed88e6bf10 adding typing to 'connect' method 2019-08-14 13:01:16 -04:00
Yotam Mann
0ad8d40c79 making overridden abstract
implemented by extending classes
2019-08-12 14:18:34 -04:00
Yotam Mann
0b1a6bee58 updating typing 2019-08-12 13:17:37 -04:00
Yotam Mann
9bd9feb7fb removing unused import 2019-08-12 10:14:55 -04:00
Yotam Mann
48c410cfc4 added floating point midi conversion 2019-08-12 00:15:30 -04:00
Yotam Mann
4e9fca3df3 marking toMaster as deprecated 2019-08-12 00:15:11 -04:00
Yotam Mann
4d52317fd3 takes an array of partials 2019-08-12 00:09:40 -04:00
Yotam Mann
f79cce25ca updating docs 2019-08-12 00:09:22 -04:00
Yotam Mann
18facc5576 safety checks before trying connection 2019-08-10 18:07:10 -04:00
Yotam Mann
edddd9e3ba moving assert and log to their own file 2019-08-10 18:07:02 -04:00
Yotam Mann
0dff2423e7 checking if connecting to a source with no inputs throws an error 2019-08-10 18:06:41 -04:00
Yotam Mann
70b76c317c adding TONE_DEBUG_CLASS to the window object 2019-08-08 17:00:42 -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
e3d8598533 small optimization which avoids setting the same value 2019-08-08 14:21:20 -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
6f4ad826a0 Revert "small optimization to avoid setting the same value twice"
This reverts commit 3208497102.
2019-08-07 11:38:31 -04:00
Yotam Mann
3208497102 small optimization to avoid setting the same value twice
happens sometimes on initialization
2019-08-07 00:53:07 -04:00
Yotam Mann
3a3d563c6e schedule volume from time = 0 2019-08-07 00:52:31 -04:00
Yotam Mann
2397dfedb6 small optimization
doesn't set multiply more than once
2019-08-07 00:52:05 -04:00
Yotam Mann
5dbd58e700 moving assertions first 2019-08-06 23:19:03 -04:00
Yotam Mann
8af43901bf exposing utils, units and param 2019-08-04 13:12:39 -04:00
Yotam Mann
dd0158d0bf exposing ToneAudioBuffers 2019-08-04 11:04:48 -04:00
Yotam Mann
6160d4ec70 exposing conversions 2019-08-04 11:02:14 -04:00
Yotam Mann
8c2979fe8a connection tests and channel property tests 2019-08-04 09:54:53 -04:00
Yotam Mann
cc18de471d exposing ToneAudioNode 2019-08-04 09:54:16 -04:00
Yotam Mann
9ab45ab84c removing channel properties from constructor options
will need to set individually when relevant or come up with another solution to setting in constructor. the relevant nodes are not available at the time of the constructor
2019-08-04 09:54:06 -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
5e8a32b662 numberOfInputs/Outputs is inferred by looking at the input/output node 2019-08-02 21:48:28 -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
1792ff1d05 merging functionality from 'dev'
changes were made to .js files which are no longer there. moving functionality to .ts files
2019-08-02 13:56:51 -04:00
Yotam Mann
344bd48bc0 removing js files 2019-08-02 10:37:07 -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
d1716266e7 had slice logic backwards
oops
2019-07-30 10:52:49 -04:00
Yotam Mann
a88e9b5a84 making time optional 2019-07-30 10:25:17 -04:00
Yotam Mann
c0bd377805 export 'connect' 2019-07-30 10:24:13 -04:00
Yotam Mann
d9eae0123f removing window reference 2019-07-26 11:50:59 -04:00
Yotam Mann
dd14e412ae return context immediately
don't wait for the buffer promise to finish because the context will be set wrong for that entire time
2019-07-26 11:45:11 -04:00
Yotam Mann
61fe1a6a0d fixing initialization case 2019-07-25 18:32:58 -04:00
Yotam Mann
7a099b2310 handling case where window is not defined
either because it's loaded in node.js or because of the context that the script is loaded in
2019-07-25 18:28:17 -04:00
Yotam Mann
86bef350e2 adding note on name change 2019-07-25 13:10:52 -04:00
Yotam Mann
bfc3d7ed15 toMaster() -> toDestination()
more consistent with the Web Audio API
2019-07-25 11:32:56 -04:00
Yotam Mann
9a49c873df exporting modules from main entry 2019-07-25 11:29:36 -04:00
Yotam Mann
cbae25a15c remove Array.prototype.reverse.call, use .reverse() instead 2019-07-25 10:45:02 -04:00
Yotam Mann
111ecc1396 delayTime is in Time instead of seconds 2019-07-25 10:44:32 -04:00
Yotam Mann
ef19d2e6e8 input and output are no longer arrays
simplifies connect/disconnect logic greatly. Simplifies API to just have clearly named inputs/outputs instead of overloading input/output connect numbers
2019-07-25 10:43:47 -04:00
Yotam Mann
9788bcc847 optimizing slice implementation
no longer requires iteration over the arrays
2019-07-25 09:08:34 -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
5fcb7df3cc Revert "getFrom is like getAfter, but also includes the event at the given time"
This reverts commit b4b924f2e0.
2019-07-24 19:54:57 -04:00
Yotam Mann
4858251ba6 Revert "small optimization reducing the number of cancelScheduledValues calls"
This reverts commit 37a62137fa.
2019-07-24 19:54:50 -04:00
Yotam Mann
37a62137fa small optimization reducing the number of cancelScheduledValues calls
first check if there are any more values which are scheduled
2019-07-24 19:50:49 -04:00
Yotam Mann
b4b924f2e0 getFrom is like getAfter, but also includes the event at the given time 2019-07-24 19:49:31 -04:00
Yotam Mann
934ab5d77f clearer error messages
catch the error before it becomes "the value is non-finite". show the original value
2019-07-24 09:30:58 -04:00
Yotam Mann
6362f00e58 checking both time and value arguments 2019-07-23 17:46:13 -04:00
Yotam Mann
6cb6472f46 if object key is 'value' just copy it over
deep merging was causing some errors with ToneEvent
2019-07-23 17:09:11 -04:00
Yotam Mann
3c0953b3a4 adding more detailed error handling
addresses #515
2019-07-23 17:08:48 -04:00
Yotam Mann
61a02e6633 toTicks can take a class as well 2019-07-23 15:17:11 -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
2978244fd5 interval can also be a time class 2019-07-23 13:12:27 -04:00
Yotam Mann
027bffc10e check if the attribute exists and is not falsy 2019-07-23 13:11:01 -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
cd968292d4 correcting docs 2019-07-23 11:28:33 -04:00
Yotam Mann
7e65d90ec9 dont remove primitive types from 'get' response 2019-07-23 11:28:22 -04:00
Yotam Mann
5a8ee37c77 adding implicit end attribute to StateTimeline
used when the ending is impilcitly scheduled as in Player
2019-07-23 11:26:41 -04:00
Yotam Mann
a820e5bee5 implementing debug 2019-07-23 11:24:38 -04:00
Yotam Mann
622b547e32 time is optional in toSeconds 2019-07-22 16:18:01 -04:00
Yotam Mann
9e8ffa3dd0 optionsFromArguments can accept an object
uses 4th parameter to know which options should be an object
2019-07-22 16:15:55 -04:00
Yotam Mann
ca43351e92 convert ToneAudioBuffers to ts 2019-07-22 12:29:50 -04:00
Yotam Mann
6e8cb73ca3 type coersion 2019-07-19 12:32:55 -04:00
Yotam Mann
c56798ebf4 takes a string array instead of object 2019-07-19 12:32:42 -04:00
Yotam Mann
f8d845cede return from 'get' should be serializable 2019-07-19 11:09:28 -04:00
Yotam Mann
9306f9e797 RecursivePartial is useful for nested properties 2019-07-18 14:06:53 -04:00
Yotam Mann
72d4b80f97 fixing typo 2019-07-18 14:06:20 -04:00
Yotam Mann
3efd706458 omiting defaults from object
useful for removing redundant properties in get/set
2019-07-18 14:06:10 -04:00
Yotam Mann
8b501cca7e only using the attributes which are available in getDefaults() 2019-07-18 14:05:42 -04:00
Yotam Mann
11aed433d7 don't try to set an undefined attribute 2019-07-17 12:54:25 -04:00
Yotam Mann
8c3c2fe9d1 removing old type classes 2019-07-16 16:05:58 -04:00
Yotam Mann
e0a83ef8cd removing old js files 2019-07-16 15:44:43 -04:00
Yotam Mann
45a254f7e6 setting unused method to abstract
should be implemented by extending classes
2019-07-16 15:44:36 -04:00