Get the latest tech news
Variable duty cycle square waves with the Web Audio API
Daniel Black's personal website
The Web Audio API allows you to create OscillatorNode s that represent periodic waveforms like a sine, sawtooth, triangle, or square waves. The nice thing about the music tracker software that I am working on is that I only need to support four duty cycles so I can compute my waveShaper curves once ahead of time and reuse them throughout the application. This is just the tip of the iceberg as it relates to the Web Audio API - I really do think there is a lot of potential for building cool things with this tool and more devs should check it out.
Or read this on Hacker News