Comments (4)
Setting volume on a wad during playback is tricky, because the volume envelope is already scheduled to change the volume during playback. In your code, it looks like you'e modifying the output of a reverb or delay node, which will work, but only if the wad has one of those nodes (and it requires you to know where that node is, as you noted).
One solution that you might find simpler is to wrap the wad in a polywad, and then you can dynamically set volume on the polywad.
It might also work to modify the basic set up for all wads to use two gain nodes by default, instead of one. One of them would be modulated by the volume envelope, and the other could be manually manipulated with setVolume.
from wad.
@rserota Yeah I noticed setting volume was a bit tricky myself!
If I am not mistaken, I am preety sure that was actually a node named the volume envelope (Name appeared in chrome dev tools console).
And I'll play around with polywads once I have the chance!
I'll look into setting two gain nodes, as that would make sense. And to be honest, I make a lot of music myself, so I know a bit of music terms, by I am not completely sure of what you mean by modulated. Do you mean like changed on the fly?
However, There is a javascript map trick @julianpoy and I used before, to set keys to array indexes, that is actually preety powerful, and I think that would help in acessing the nodes added to Wad.nodes. That way, by using a key, we can quickly search for if the node exists, without checking every value. I'll have @julianpoy elaborate, as he is the one that taught the javascript technique to me. And then perhaps you ( @rserota ), @julianpoy, and I can decide on a good solution for this :)
from wad.
Yeah, by 'modulate', I just meant that the gain node is being changed on the fly by the volume envelope.
from wad.
Forgot that I was ultimately supposed to come up with some sort of better solution for this.
The project involving WAD has been on hold for a bit, but I hope to be back to it soon and improving things.
from wad.
Related Issues (20)
- reverse? HOT 3
- Pitch detection not working HOT 3
- How to add onEnd event listener HOT 5
- TypeScript Typings HOT 3
- Custom Work HOT 2
- Polywad does not appear to implement setPanning HOT 2
- How do I get the playhead position of a Wad object? HOT 3
- Trouble applying compression HOT 3
- requestAnimationFrame(logPitch) outputs infinite frame count HOT 1
- Adding Stronger Sound Caching/Grouping Functionality HOT 2
- getUserMedia() build error HOT 2
- getUserMedia() build error HOT 4
- Low quality mic recording / MediaStreamConstraints HOT 2
- Mute mic output when recording HOT 5
- connect output of wads (post processing) HOT 4
- How to show progress bar for audio file? HOT 1
- Pitch Detection example doesn't work HOT 1
- import Wad from 'web-audio-daw' throws ReferenceError: window is not defined HOT 1
- Idk HOT 1
- dawproject
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wad.