Commit graph

401 commits

Author SHA1 Message Date
Yotam Mann
e18ed2e677 polyfill for browsers that don't support interpolate value curves
Required by [the
spec](http://webaudio.github.io/web-audio-api/#widl-AudioParam-setValueC
urveAtTime-AudioParam-Float32Array-values-double-startTime-double-durati
on), but not currently implemented by Safari and FF.
2016-03-20 18:36:59 -04:00
Yotam Mann
40d739fc4d More waveshaper points
works better on Safari
2016-03-16 13:09:46 -04:00
Yotam Mann
04614a2948 added setCurveAtTime to Timeline 2016-03-05 10:44:03 -05:00
Yotam Mann
18b2136148 .value returns the scheduled value at time=now 2016-03-03 13:04:02 -05:00
Yotam Mann
93d70a3a9e waveshaper goes between -1 and 1 inclusive 2016-02-27 17:08:53 -05:00
Yotam Mann
23c70cbc93 disposing fully 2016-02-27 11:22:26 -05:00
Yotam Mann
0441bc5008 pruning away unused signal classes 2016-02-27 11:18:59 -05:00
Yotam Mann
c4f85780f2 using sampleTime variable 2016-02-27 11:16:51 -05:00
Yotam Mann
a427070904 Outputs 0 at audio-rate
This is to get around an optimization in most browsers which stops
processing when the gain is equal 0 in the Signal.
2016-02-27 11:16:25 -05:00
Yotam Mann
ecd15808c2 simplified Abs
now only accepts signals in the range [-1,1]
2016-02-06 15:06:03 -05:00
Yotam Mann
c72a5f25c9 makes sure that exponential ramping is never from or to 0
when trying to ramp from 0, it does a setValueAtTime to a near zero
value, then ramps exponentially. And the reverse when ramping to 0.
2016-01-31 23:33:36 -05:00
Yotam Mann
3bbd66c5d2 constrain TimelineSignal's memory 2015-12-07 00:19:38 -05:00
Yotam Mann
ae669e7fa6 making sure the ramp time constant is above 0 2015-12-06 13:14:36 -05:00
Yotam Mann
1b10f4e47b reverting. getValueAtTime should return unconverted units
Making a note of this in the docs
2015-11-26 01:24:34 -05:00
Yotam Mann
093d2e3a36 getValueAtTime returns converted values 2015-11-23 23:49:54 -05:00
Yotam Mann
2c215ce703 setting ramp point cancels next values so they don't interfere with the next ramp 2015-11-16 11:11:01 -05:00
Yotam Mann
858c815640 docing 2015-11-02 20:09:19 -05:00
Yotam Mann
2d6d733008 signal uses regular gain node 2015-11-01 17:49:14 -05:00
Yotam Mann
4bb7f2928a inherit connect SignalBase 2015-10-21 12:12:17 -04:00
Yotam Mann
7fc477b746 removing circular dependency 2015-10-21 12:11:41 -04:00
Yotam Mann
cd3ae4f860 Timeline signal using new Tone.Param 2015-10-21 10:53:43 -04:00
Yotam Mann
b73a8cb71f updating to new Param class 2015-10-21 10:34:37 -04:00
Yotam Mann
11b4995b25 moving overridden flag to Param 2015-10-21 10:27:44 -04:00
Yotam Mann
0f841ff709 Signal extends Param and uses new Gain node 2015-10-21 10:11:34 -04:00
Yotam Mann
386acdbb03 Param base class wraps native AudioParam 2015-10-21 10:01:40 -04:00
Yotam Mann
f844b6b021 updating docs 2015-10-11 16:02:10 -04:00
Yotam Mann
7c0318cbdf getNextEvent->getEventAfter 2015-09-05 16:27:42 -04:00
Yotam Mann
eccdb659c2 renamed Tone/core/Types -> Tone/core/Type 2015-09-04 16:48:21 -04:00
Yotam Mann
66d8566c9e correctly converts from units
I was converting the values twice.
2015-08-31 15:14:34 -04:00
Yotam Mann
a42b8e74ee making the signal explicitly 1 channel 2015-08-28 18:33:31 -04:00
Yotam Mann
9659689fd8 constant signal generator is now AudioBufferSource 2015-08-24 17:30:49 -04:00
Yotam Mann
102262cea9 removing unnecessary safari inconsistency bug 2015-08-24 17:30:11 -04:00
Yotam Mann
499bb57ac6 updating doc 2015-08-24 17:29:52 -04:00
Yotam Mann
c0bf3556dc added AudioToGain method 2015-08-21 17:04:44 -04:00
Yotam Mann
7cb373635d renamed Signal methods
setCurrentValueNow -> setRampPoint, linearRampToValueNow ->
linearRampToValue
2015-08-21 15:02:33 -04:00
Yotam Mann
b5c94bbfee clarifying _toUnits and _fromUnits 2015-08-18 16:29:15 -04:00
Yotam Mann
72ee2dcc37 renamed Schedulable to Timeline 2015-08-18 16:28:55 -04:00
Yotam Mann
8ed60da67a updated to new Schedulable API 2015-08-17 01:01:04 -04:00
Yotam Mann
2fcb93f3ce don't cancel scheduled values when setting a value 2015-08-17 01:00:02 -04:00
Yotam Mann
b74b8a781d using minOutput throughout 2015-08-16 15:16:07 -04:00
Yotam Mann
d56f4c196e schedulable signal class
Allows state in the future to be queried
2015-08-16 15:15:54 -04:00
Yotam Mann
a5820e406e updated link 2015-08-10 14:40:03 -04:00
Yotam Mann
01060f13db removing old API test 2015-07-18 14:59:18 -04:00
Yotam Mann
3ccc0683bf changing doc links to markdown style 2015-07-04 15:25:37 -04:00
Yotam Mann
8ffd6e538f fixed doc bugs 2015-06-22 01:21:25 -04:00
Yotam Mann
4e9cb3ce1e doc'ing 2015-06-20 15:50:57 -04:00
Yotam Mann
b13beccba8 doc'ing signals 2015-06-19 00:52:04 -04:00
Yotam Mann
cf6fdefdab doc'ing signals 2015-06-14 01:17:09 -04:00
Yotam Mann
23cc2408b2 changing link tag 2015-06-13 21:54:20 -04:00
Yotam Mann
20ad29dc61 removing types from array notation 2015-06-13 20:56:41 -04:00
Yotam Mann
a81ba071f3 changing the styling of this in return statements 2015-06-13 20:54:29 -04:00
Yotam Mann
571183bf27 removing Tone.Type prefix in docs 2015-06-13 20:20:36 -04:00
Yotam Mann
f2f838b630 using signal jsdoc 2015-06-13 19:50:39 -04:00
Yotam Mann
d29ecdad36 parameter can be passed in 2015-06-07 13:16:50 -04:00
Yotam Mann
68a47a9d58 Normal->NormalRange & Number->Default 2015-05-24 09:45:15 -04:00
Yotam Mann
1f69151c5f renamed Tone.Frequency -> Tone.Type.Frequency 2015-05-23 19:07:28 -04:00
Yotam Mann
6ef3dd2f51 renamed Tone.Time -> Tone.Type.Time 2015-05-23 19:01:05 -04:00
Yotam Mann
f0bcd68812 renamed Tone.Signal.Units to Tone.Type
also renamed Tone.Source.State to Tone.State
2015-05-23 18:57:05 -04:00
Yotam Mann
eec1c3135d option not to convert units
that would make the .units attribute only for labelling and
non-functional.
2015-05-05 16:38:46 -04:00
Yotam Mann
90a3aeb151 removing setValueAtTime in exponential ramp 2015-04-18 20:24:07 -04:00
Yotam Mann
c0de630442 fixing dispose methods 2015-04-05 14:42:14 -04:00
Yotam Mann
7f984464bd properly disposing readonly objects
first making them writable
2015-04-05 14:35:32 -04:00
Yotam Mann
550ceb5038 stricter interface on signal attributes 2015-04-05 14:25:01 -04:00
Yotam Mann
6b1373e431 cosmetics 2015-04-05 14:01:05 -04:00
Yotam Mann
da1d03b616 inverse of AudioToGain
maps values in the gain range [0, 1] to the audio range [-1, 1]
2015-04-05 12:13:03 -04:00
Yotam Mann
7be93abc0a correctly maps values in Safari
Fixes #59
2015-04-05 12:12:32 -04:00
Yotam Mann
b093dd4d73 deleting deprecated classes 2015-03-26 10:50:48 -04:00
Andrew Petersen
a2aeffe2a2 prevent SyntaxError(s) in Firefox 2015-03-21 23:24:54 -04:00
Luke Phillips
237202c049 updated typescript definitions and fixed a few type errors 2015-03-07 19:17:16 +00:00
Luke Phillips
db5c6eb865 remove old get and set functions 2015-03-07 18:41:10 +00:00
Luke Phillips
d2755e10de Merge Tone r4 2015-03-05 16:06:27 +00:00
Yotam Mann
930728648b jsdoc'ing 2015-02-27 13:40:35 -05:00
Yotam Mann
0c4a67296a simplified modulo by constraining input range
only handles inputs between -1 and 1
2015-02-27 13:00:20 -05:00
Yotam Mann
a791d80ddf removing some vestigial methods 2015-02-26 11:26:49 -05:00
Yotam Mann
76973cda7d changed internal tag to private tag
JSDoc stuff
2015-02-25 16:19:43 -05:00
Yotam Mann
9722415a4c deprecated Inverse and Divide
They were more complicated than they were useful.
2015-02-23 19:39:46 -05:00
Yotam Mann
db04c9db39 default value 2015-02-23 00:31:05 -05:00
Yotam Mann
93ded2eb2f extend Signal to allow for scheduling 2015-02-23 00:30:53 -05:00
Yotam Mann
c52d61deaf moved syncing to Transport 2015-02-21 14:05:58 -05:00
Yotam Mann
c824b023eb updated to new signal api with connections 2015-02-20 00:53:39 -05:00
Yotam Mann
531836c42c this._scalar.gain -> this._value 2015-02-13 10:52:38 -05:00
Yotam Mann
b5ddc8203e using bind instead 2015-02-11 23:10:04 -05:00
Yotam Mann
8f77745a6b only convert when setting. 2015-02-11 14:37:36 -05:00
Yotam Mann
6b36cf13ef fully migrated to new Signal API 2015-02-10 16:45:05 -05:00
Yotam Mann
86be033f31 rampTime defaults to 0 2015-02-10 16:33:55 -05:00
Yotam Mann
a8619a95b6 clarifying Signal.Units enum 2015-02-10 11:37:36 -05:00
Yotam Mann
50917ac49f migrating signals to ES5 getter/setters 2015-02-06 17:47:26 -05:00
Yotam Mann
e713c6d2ce Normal and Audio range signals 2015-02-04 10:29:25 -05:00
Yotam Mann
e7f9595ac8 Signal accepts units and an AudioParam
passing in an AudioParam allows that AudioParam to be synced to the
Transport and use the unit conversions of the Signal class.
2015-02-04 00:36:18 -05:00
Yotam Mann
fe93152920 signal value setters/getters 2015-02-02 12:50:18 -05:00
Yotam Mann
ee8c2cd43f using isFunction method 2015-02-02 09:41:32 -05:00
Yotam Mann
bda90701d6 all Signals return this 2015-02-01 22:56:33 -05:00
Yotam Mann
362afb32eb returning to public dispose method 2015-02-01 22:05:24 -05:00
Yotam Mann
632baf2862 new dispose method and getter/setter 2015-02-01 20:02:30 -05:00
Luke Phillips
16ee304d48 Chebyshev getter functions 2015-01-20 13:55:28 +00:00
Luke Phillips
ab6710e0b1 WaveShaper getter functions 2015-01-20 13:50:51 +00:00
Luke Phillips
782d7731cf AutoPanner getter functions 2015-01-20 13:00:23 +00:00
Luke Phillips
b584ea242e Pow getter functions 2015-01-20 12:50:31 +00:00
Luke Phillips
cc829b2327 ScaleExp getter functions 2015-01-20 12:49:08 +00:00
Luke Phillips
20bbfd85ed Scale getter functions 2015-01-20 12:46:37 +00:00
Yotam Mann
9ed92b7af0 removing unneeded disposes 2014-12-19 16:33:43 -05:00
Yotam Mann
a730873ff1 Threshold - removing deprecated 2014-12-09 15:02:36 -05:00
Yotam Mann
908ae686f2 ramp exponential won't go below some small value 2014-12-06 16:47:48 -05:00
Yotam Mann
db544d20c4 using markdown instead of example tag 2014-12-03 17:25:34 -05:00
Yotam Mann
1b9cc1483b jsdoc'ing 2014-12-03 17:20:23 -05:00
Yotam Mann
2d0bcffc9f adding defaults to jsdocs 2014-12-02 01:42:08 -05:00
Yotam Mann
0a944516af doc tweaks 2014-12-02 00:27:28 -05:00
Yotam Mann
398f2bcce2 jsdoc tweak 2014-12-02 00:08:44 -05:00
Yotam Mann
a7dbac68bb optimizing input/output
also subclass of Tone.SignalBase
2014-11-30 23:26:42 -05:00
Yotam Mann
ce0d5f3597 signals inherit from a signal base class 2014-11-30 23:26:06 -05:00
Yotam Mann
25496dea77 switched to updated chain method 2014-11-30 21:32:09 -05:00
Yotam Mann
9498d6af3c boost Tone.Pow resolution 2014-11-30 17:42:02 -05:00
Yotam Mann
cf2cb263b2 chain -> connectSeries, fan -> connectParallel 2014-11-30 17:37:29 -05:00
Yotam Mann
d1839dc1b6 output is 0 when input is 0 2014-11-30 17:36:56 -05:00
Yotam Mann
310231dbd1 using Tone.WaveShaper instead of native node 2014-11-30 13:20:35 -05:00
Yotam Mann
ae24c8272d Tone.WaveShaper abstraction on WaveShaperNode 2014-11-30 13:16:20 -05:00
Yotam Mann
09f4b5fdf8 Normalize an input range to 0,1 2014-11-29 21:37:21 -05:00
Yotam Mann
d3bb514dde Scale and ScaleExp scale from gain range only 2014-11-29 21:18:04 -05:00
Yotam Mann
15c33fdecd Scale a gain to an equal power scale 2014-11-29 20:32:33 -05:00
Yotam Mann
b67c187caa map audio range to gain range 2014-11-29 20:30:52 -05:00
Yotam Mann
aa2f1fc2ef cleaning up the constructor - Expr 2014-11-09 10:57:34 -05:00
Yotam Mann
4587420071 some deps cleanup 2014-11-09 10:56:55 -05:00
Yotam Mann
7e09fc6931 small reorganization 2014-11-04 01:24:24 -05:00
Yotam Mann
dcfac108eb using Tone constructor in signal classes 2014-11-04 01:21:42 -05:00
Yotam Mann
043172df7c keeping reference to Float32Array
potentially causing crashes (trying to debug)
2014-11-03 19:22:17 -05:00
Yotam Mann
3d9639b48a tiny bit of clean up 2014-11-01 22:00:36 -04:00
Yotam Mann
5c3cdab7cc does string replacements 2014-11-01 21:53:36 -04:00
Yotam Mann
56791f2ef2 pow is just a waveshapercurve 2014-11-01 21:53:14 -04:00
Yotam Mann
4f6d04498a using Pow and optimizing nodes 2014-11-01 21:52:49 -04:00
Yotam Mann
21a0b84137 including Pow and Divide 2014-11-01 16:18:23 -04:00
Yotam Mann
c454357fd7 small modulo optimization 2014-11-01 16:16:27 -04:00
Yotam Mann
ef4692789e Tone.Divide division 2014-10-30 21:34:53 -04:00
Yotam Mann
77559a4264 Tone.Inverse multiplicative inverse of a number 2014-10-30 21:34:34 -04:00
Yotam Mann
3a6261c9b9 Tone.Pow exponential 2014-10-30 21:34:11 -04:00
Yotam Mann
36f4a85582 connect method from Tone.Signal 2014-10-30 19:48:53 -04:00
Yotam Mann
79e4c1c9fc refactored Expr
put regexp all in one place and function callbacks all in one place
2014-10-30 17:04:15 -04:00
Yotam Mann
9d41f7aa3d handles multiple inputs 2014-10-30 01:05:17 -04:00
Yotam Mann
47a5e2d962 bug fixes 2014-10-30 01:04:49 -04:00
Yotam Mann
e19e0cea30 first Expr version
aggregate signal processing expression
2014-10-29 23:56:08 -04:00
Yotam Mann
0fce1bf624 Modulo small doc changes. 2014-10-22 21:52:42 -04:00
Yotam Mann
7ae56f179c Equal accepts two signals. 2014-10-22 21:26:10 -04:00
Yotam Mann
0a68826768 LessThan accepts two signals 2014-10-22 21:25:28 -04:00
Yotam Mann
8b58bd0a9b Greater than compares two signals 2014-10-22 21:24:40 -04:00
Yotam Mann
de194f24c3 min and max accept two signals 2014-10-22 21:23:47 -04:00
Yotam Mann
fcba9bd62a multiply handles two signals 2014-10-22 21:20:43 -04:00
Yotam Mann
23eaf83935 handles summing two signals
or a signal and a number.
2014-10-22 21:19:04 -04:00
Yotam Mann
7f7e093a4b Subtract class
subtract a signal and a number or a signal and a signal
2014-10-22 21:17:29 -04:00
Yotam Mann
eb07e84a6e simplified internals of IfElseThen
changes API slightly because false is 0 and not != 1
2014-10-13 19:24:06 -04:00
Yotam Mann
7277a7eb68 wrote Min and Max with IfThenElse
makes the internals much more readable
2014-10-13 19:22:11 -04:00
Yotam Mann
231d803848 IfThenElse class
convenience on using the selector for signal switching logic.
2014-10-03 17:20:35 -04:00
Yotam Mann
fe96656d2a AND and OR classes
Fixes #22
2014-10-03 17:20:00 -04:00
Yotam Mann
4eaa4f75df es5 getter/setter on Tone.Signal value
#33
2014-10-03 15:50:21 -04:00
Yotam Mann
0270b3c9e0 deprecating Tone.Threshold 2014-10-03 13:07:53 -04:00
Yotam Mann
f94034345d rewrote GreaterThan and LessThan in terms of GreaterThanZero 2014-10-03 13:07:26 -04:00
Yotam Mann
93eace9694 new GreaterThanZero class
Fixes #20. Also deprecates the need for Tone.Threshold
2014-10-03 13:06:26 -04:00
Yotam Mann
2e753b80dc renamed Tone.Not -> Tone.NOT
much clearer this way.
2014-09-24 14:44:56 -04:00
Yotam Mann
a99ff1d48e removed Tone.Not
renaming it Tone.NOT
2014-09-24 14:44:01 -04:00
Yotam Mann
04359f6dbb documenting Tone.Not 2014-09-23 22:23:58 -04:00
Yotam Mann
dff5852607 greater than equal to on threshold. 2014-09-14 15:34:37 -04:00
Yotam Mann
e3dc3a2f6a modulo comments 2014-09-14 15:33:02 -04:00
Yotam Mann
a0fe662dcd more modulus optimization 2014-09-12 01:03:48 -04:00
Yotam Mann
5b178359fd optimizing modulo operator 2014-09-12 00:55:10 -04:00
Yotam Mann
669c52ee60 jsdoc'ing. 2014-09-11 13:38:41 -04:00
Yotam Mann
08c6d3d4b2 Modulus operator on incoming signal
the cost of the operation is proportional to the number of bits the
incoming signal has
2014-09-08 11:49:21 -04:00
Yotam Mann
8552833330 refactored GT and LT to get rid of redundant code
Fixes #21
2014-09-07 22:16:19 -04:00
Yotam Mann
820b9e8005 readded min...?
dunno what happened there.
2014-09-07 21:43:24 -04:00
Yotam Mann
253884d19e renamed Tone.Selector to Tone.Select 2014-09-07 21:42:31 -04:00
Yotam Mann
71af6ca206 testing dispose methods for all classes.
a few classes were not being disposed correctly and leaving some
garbage attached.
2014-09-06 18:55:11 -04:00
Yotam Mann
925e9b19a6 slight refactor + firefox exponential ramp bug 2014-09-06 15:57:01 -04:00
Yotam Mann
d71f1cb5b7 jsdocs updates. 2014-09-05 11:32:35 -04:00
Yotam Mann
af85ae7e19 Added "use strict" to all classes
Fixes #17
2014-09-04 00:41:40 -04:00
Yotam Mann
dc525e90ce fixed setTargetAtTime typo 2014-09-03 17:31:51 -04:00
Yotam Mann
9d337cb101 fixed wave shaper curve length 2014-08-27 15:22:21 -04:00
Yotam Mann
b612f7839c Added Signal dep to all Signals
#11
2014-08-24 15:47:59 -04:00
Yotam Mann
7890e74ac0 moved Merge and Split to components 2014-08-24 15:46:55 -04:00
Yotam Mann
b2c85eaf44 signals inherit Signal.connect method
this is so that params and signals they connect to don’t need to be
manually zeroed out after connecting.

Fixed #11
2014-08-24 13:19:49 -04:00
Yotam Mann
5f29b82d3b privatized the _scalar 2014-08-23 14:22:18 -04:00
Yotam Mann
833132643e Tone.ScaleExp scales values with an exponent
Fixes #14
2014-08-23 13:11:01 -04:00
Yotam Mann
343b54b784 reflects new connect method with indexing
changed the input/output to be arrays so that they can be used with the
new connect method
2014-08-20 17:09:58 -04:00
Yotam Mann
4e531dc06f fixed deps. ability to setContext 2014-07-30 13:56:32 -04:00
Yotam Mann
ded3f1a61a formerly Tone.Gate 2014-07-23 15:47:46 -04:00
Yotam Mann
b09fc13dc2 rename Gate to Switch and Switch to Selector 2014-07-23 15:47:00 -04:00
Yotam Mann
86c3b6e261 uses Tone.Switch now 2014-07-22 18:54:23 -04:00
Yotam Mann
8e646f033f route a single input to multiple outputs
select the open output. (similar to Switch)
2014-07-22 13:39:53 -04:00
Yotam Mann
738f1c8c5d api change from open to select 2014-07-22 13:39:28 -04:00
Yotam Mann
3494326f65 min and max using the new Tone.Switch 2014-07-22 12:48:37 -04:00
Yotam Mann
d9aa476a3f some linting 2014-07-22 12:48:22 -04:00
Yotam Mann
524bae2e60 accepts input/output number selection 2014-07-22 12:48:04 -04:00
Yotam Mann
fe418cbe89 switch that accepts multiple inputs 2014-07-22 12:47:28 -04:00
Yotam Mann
1a9a5fae2b min / max setters 2014-07-22 11:31:14 -04:00
Yotam Mann
fca7b0eba3 clip the incoming signal 2014-07-20 18:26:33 -04:00
Yotam Mann
69294ce410 switch between two sources 2014-07-20 18:18:43 -04:00
Yotam Mann
505bad1674 signal min and max 2014-07-20 18:18:29 -04:00
Yotam Mann
2ee294b278 fixed logic.
now nearly the same as greater than
2014-07-20 18:17:01 -04:00
Yotam Mann
d91f177fb5 fixed dep and doc 2014-07-20 18:15:17 -04:00
Yotam Mann
10e2acdea9 class description for signals 2014-07-04 13:47:56 -04:00
Yotam Mann
2f027cfd50 updated docs 2014-07-04 13:36:13 -04:00
Yotam Mann
2bab21a9f5 rename 2014-07-03 22:59:35 -04:00
Yotam Mann
465d83f308 signal comparison 2014-07-03 22:59:16 -04:00
Yotam Mann
ce4d75db50 signal absolute value 2014-07-03 22:57:04 -04:00