Last active
February 27, 2019 23:13
-
-
Save abhishekkr/802f5e3e0b5f0fee393491689b9e77fd to your computer and use it in GitHub Desktop.
webaudio js samples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ctx = new AudioContext(); | |
t = {b: ctx.currentTime}; | |
o = ctx.createOscillator(); | |
o.connect(ctx.destination); | |
o.frequency.value = 500; | |
o.frequency.exponentialRampToValueAtTime(166,t.b+5); | |
o.start(t.b); | |
o.stop(t.b+5);} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ctx = new AudioContext(); | |
t = {b: ctx.currentTime}; | |
o = ctx.createOscillator(); | |
o.connect(ctx.destination); | |
o.frequency.value = 247; | |
o.frequency.setValueAtTime(329.63,t.b+0.25); | |
o.frequency.setValueAtTime(256,t.b+0.5); | |
o.frequency.setValueAtTime(329.63,t.b+0.75); | |
o.frequency.setValueAtTime(264,t.b+1); | |
o.frequency.setValueAtTime(329.63,t.b+1.25); | |
o.frequency.setValueAtTime(247,t.b+1.5); | |
o.frequency.setValueAtTime(329.63,t.b+1.75); | |
o.frequency.setValueAtTime(247,t.b+2); | |
o.frequency.setValueAtTime(329.63,t.b+2.25); | |
o.frequency.setValueAtTime(256,t.b+2.5); | |
o.frequency.setValueAtTime(329.63,t.b+2.75); | |
o.frequency.setValueAtTime(264,t.b+3); | |
o.frequency.setValueAtTime(329.63,t.b+3.25); | |
o.frequency.setValueAtTime(247,t.b+3.5); | |
o.frequency.setValueAtTime(329.63,t.b+3.75); | |
o.start(t.b); o.stop(t.b+4);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment