I've been trying to create an 88 key piano with the Web Audio API. The plan is to run all the 88 oscillators first in the appropriate frequencies and then use Oscillator.connect()
and Oscillator.disconnect()
methods on the respective oscillators as the piano keys are pressed and released. The state of the AudioContext
will be "running" all the time. Now, I have two questions here,
- Is this the right way to do it?
- I get a clicking noise at the start and end of the sounds when I play them. Why is this happening and how to get rid of it?
PS: The reason for creating a piano like this is to indulge myself in the delight of having created something from scratch. So using prerecorded sounds is not an option.