Created
May 3, 2013 02:13
-
-
Save whichlight/5506776 to your computer and use it in GitHub Desktop.
simple deep drone synth
This file contains hidden or 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
| s1 = get_synth(35); | |
| s2 = get_synth(35.2); | |
| function get_synth(pitch){ | |
| nodes={}; | |
| nodes.source = myAudioContext.createOscillator(); | |
| nodes.source.type=3; | |
| nodes.filter = myAudioContext.createBiquadFilter(); | |
| nodes.volume = myAudioContext.createGainNode(); | |
| nodes.filter.type=0; //0 is a low pass filter | |
| nodes.volume.gain.value = 0.5; | |
| nodes.source.connect(nodes.filter); | |
| nodes.filter.connect(nodes.volume); | |
| nodes.volume.connect(myAudioContext.destination); | |
| //pitch val | |
| nodes.source.frequency.value=pitch; | |
| //frequency val | |
| nodes.filter.frequency.value=100; | |
| nodes.source.noteOn(0); | |
| return nodes | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment