Git Product home page Git Product logo

Comments (3)

ddf avatar ddf commented on August 14, 2024

Ah, yeah, that's tricky. The trouble is that the Waveform used by Oscil is sampled using a 0-1 phase value, so there isn't a reliable moment when the waveform "finishes" playing. The moment where is wraps could happen at any point in the buffer provided to AudioListener but that information is not really available from there. What I would do in this case is to use multiple Oscil objects that each reference a different Waveform. Run them all continuously and when you want to swap to a particular Waveform fade out the currently audible Oscil with a Line patched to its amplitude property and fade in the Oscil you want to hear with a different Line patched to its amplitude. You could make these fades extremely short so that it sounds more like a swap. If you want to directly update the Waveform used by a particular Oscil you could do so while its amplitude is 0.

from minim.

misterbo94 avatar misterbo94 commented on August 14, 2024

Thank you, that's a very good idea. However, if I'm correct, for each Oscil I'd need two Lines patched to the same UGenInput (for fading in and out), but that's not possible. Is there something I'm missing?

from minim.

ddf avatar ddf commented on August 14, 2024

You only need one Line. When you want to fade out an Oscil you'd do something like call activate(0.05,1,0) on the attached Line and then later when you want to fade that Oscil back in, you'd call activate(0.05, 0, 1) on that same Line.

from minim.

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.