Git Product home page Git Product logo

Comments (4)

rserota avatar rserota commented on July 22, 2024

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.

torch2424 avatar torch2424 commented on July 22, 2024

@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.

rserota avatar rserota commented on July 22, 2024

Yeah, by 'modulate', I just meant that the gain node is being changed on the fly by the volume envelope.

from wad.

julianpoy avatar julianpoy commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.