-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed new features: filtering, distortion and convolution (reverb) #238
Open
tyler-g
wants to merge
5
commits into
CreateJS:master
Choose a base branch
from
tyler-g:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…t is now filterNode=>panNode=>gainNode. Added properties to store the filter's frequency and q factor. These properties can be directly set or get from the sound instance, in the same manner as pan
…o the order is now: distortionNode => filterNode => panNode => gainNode. The distortion amount can be changed by distortionAmount public property on the sound instance. Oversampling is hardcoded to 4x currently.
…ter node => convolver node => pan node => gain node. Added ability to set/get the buffer of the convolverNode. This can be set with an AudioBuffer directly, or with a filepath to an impulse response. In the latter case, soundjs will read and decode the file automatically, and set the convolver buffer. Note currently there seems to be a bug where only stereo impulse responses will work. Mono impulse responses (or null buffer on the convolver node) will case the convolver node to output no audio. May need to find a way to bypass the convolver node completely if buffer is null or not set properly. Otherwise chain will to destination will break without proper care
Ok |
ghost
reviewed
May 1, 2018
* | ||
* @property convolverBuffer | ||
* @type {String} || {AudioBuffer} | ||
* @default null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<script src="https://gist.github.com/millsymel/fd110ff692f85b30acd2364bc56c4aab.js"></script>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wanted to share an idea I had for the soundJs library to be able to support additional features such as: *filtering, convolution (reverb) and distortion. *
I've been working on an experimental sound project which needed these extra features, so I forked off the great soundjs library.
Looking for feedback and/or if there is a better way to implement this. I took the approach of adding to the audio node chain, which is by default in the original soundJs library as follows: pan => gain => destination, and is now: distortion => filter => convolver => pan => gain => destination
I tried to follow the conventions for private / public methods, object setting/getting for these new features.
The convolverBuffer property can be set directly (as an AudioBuffer), or can be passed a string which is the filepath to an impulse response (essentially a .wav file recording of a loud impulse which tails off in the space). If passed a filepath, the code will recognize that and attempt to read the file into an AudioBuffer automatically.