-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs/ improve automation() & buildOptions()
- Set the final options ramp only if the given ramp is not undefined - Add `skipImmediate` parameter to automation(), which will force it to run the full automation even if the change appears redundant. Using a number[] for ramp will do nothing if the difference between the current value of the audioParam is the same as the destination value, even when using `skipImmediate`. This may be a permanent limitation. - Re-order setValueAtTime and cancelAndHoldAtTime, as this is the order the events should happen in. In practice, this doesn't make a meaningful difference. - If an exponential ramp is requested, but either the current value or the destination value is close to zero, the ramp is changed to a natural ramp. See included comment for explaination. TL;DR: exponential isn't intuitive, so use natural. - Fix bug with chrome's implementation of Web Audio API. In theory, calling cancelAndHoldAtTime(time) on an active setTargetAtTime() is supposed to insert an implicit setValueAtTime(time). Chrome seemingly implements the spec incorrectly, or I don't understand the spec. - Modify natural ramping to use a local constant for timesteps, which can be more easily changed in the future by other developers - Add warning log when calling automation() without a ramp type
- Loading branch information
Showing
2 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters