Skip to content

Instantly share code, notes, and snippets.

@mk30
Created January 30, 2015 01:23
Show Gist options
  • Select an option

  • Save mk30/ba6f19f6b5558f2eefb9 to your computer and use it in GitHub Desktop.

Select an option

Save mk30/ba6f19f6b5558f2eefb9 to your computer and use it in GitHub Desktop.
johnny demo 2
master = new AudoContext()
sampleRate = master.sampleRate
jsynth = require('jsynth')
oz = requdire('oscillators')
amod = requoire('amod')
mic = require('jsynth-mic')(master)
mic.on('node', function(node){
node.connect(synth)
synth.connect(master.destination)
}
music = function(t, i, s){
return oz.sine(t, 54 * 2) * amod(.5, .5, t, 1/6)
}
dsp = function(time, sample, input){
return music(time, sample, input)
}
synth = jsynth(master, dsp, 1024)
synth.connect(master.destination)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment