1

I would like to sequence musical events with web audio, to do a simple musical piece. I'm just gettin started with web audio & I'm looking for tips or pointers in the right direction to be able to sequence simple events one after the other. I know how to make a playable synth with web audio but what i want is to make a small composition:

Example of what I mean by sequencing events (or making a composition):

1- at time 0 : 1 oscillator is paying a part that will end after 3 minutes. 2- after 1 minute another oscillator starts another part that will stop after 30 sec. 3- after 2 minutes an audio file starts (let's say a prerecorded bass)

How do we sequence (start & stop) different parts at a different time ?

I know how to make a synth with web audio but i would like to time events in a timeline. Where should I start ?

I guess my question is "what is the best way to trigger a function a certain amount of time after another one or when one is finished with Web Audio?"

thx!

alexalex25
  • 33
  • 6
  • 1
    Sadly this question is a little too open ended for SO. My personal recommendation is to look at wrappers for web audio and se if there is already an implementation of what you’re looking for . E.g [P5js](https://p5js.org/reference/#/p5.Score), [Elementary](https://www.elementary.audio/) – fdcpp Apr 18 '22 at 21:09
  • @fdcpp I guess my question is "what is the best way to trigger a function a certain amount of time after another one or when one is finished with Web Audio? – alexalex25 Apr 18 '22 at 23:24
  • There are a lot of examples in the net how to do this. If you still need help after you have started your own coding, please share a minimal code example that shows your actual issue. – Markus Apr 19 '22 at 06:50
  • Check this nice tutorial to start with web audio ([link](https://www.html5rocks.com/en/tutorials/webaudio/intro/)). – Markus Apr 19 '22 at 08:03

0 Answers0