Skip to content

Instantly share code, notes, and snippets.

@shashi
Created September 10, 2014 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shashi/dbc4a44ede975ac7d8e5 to your computer and use it in GitHub Desktop.
Save shashi/dbc4a44ede975ac7d8e5 to your computer and use it in GitHub Desktop.
using AudioIO
macro time_call(ex)
println(ex)
var = gensym()
ex = Expr(:(=), var, ex)
quote
$ex;
AudioIO.pull($var, 44100, 0, 44100);
@time AudioIO.pull($var, 44100, 0, 44100);
end
end
println("rendering 1s of samples at 44100Hz")
@time_call NullNode()
@time_call WhiteNoise()
@time_call LinRamp(0, 1, 0.75)
@time_call SinOsc(220)
@time_call SinOsc(220) * .5
@time_call SinOsc(220) + .5
@time_call SinOsc(220) * 5 + .5
@time_call AudioMixer(SinOsc(220), LinRamp(0, 1, 0.75))
@time_call AudioMixer(SinOsc(220), SinOsc(343))
@time_call AudioMixer(SinOsc(220), SinOsc(343), SinOsc(434))
@time_call AudioMixer(SquareOsc(220), SinOsc(343), SinOsc(434))
@time_call AudioMixer(SquareOsc(220), TriangleOsc(343, pi/2), SinOsc(434))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment