putting connect calls into the onclick function and adding a source.onended block to connect and disconnect the audio nodes at good times, to make the effect work properly