DEV Community

Discussion on: Building a Synthesizer in Javascript

Collapse
 
calag4n profile image
calag4n

Great project 👏 !

I'm intented to build a metronome with advanced features for drumming purpose,so, as you guess, I need a very accurate and stable "audio engine" .
Do you think the WebAudio API is able to make the job ?

Collapse
 
iamschulz profile image
Daniel Schulz

Maybe.
Take a look at the limitations. It doesn't run on Apple software yet, and there's a limit on simultaneous tones on Chrome.
A metronome that just clicks should be fine and quite easy to implement. Something like this:

setInterval(()=>{
    -> AudioContext
    -> Osc(Sine, 440Hz)
    -> Ramp up and down to prevent clicking
    -> Delete audio node after ramping down
}, bpm)

I'm very interested in its accuracy over a long time, though. If you get around to do that, ping me please :)

Collapse
 
calag4n profile image
calag4n

Yes, I'll do, thanks 🙂.