Created
June 25, 2011 16:18
-
-
Save bobpoekert/1046624 to your computer and use it in GitHub Desktop.
My first Chuck instrument
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
MidiIn min; | |
MidiMsg msg; | |
if (!min.open(0)) me.exit(); | |
SinOsc s => Gain g => DelayL d => dac; | |
s => Gain g2 => dac; | |
d => Gain g3 => d; | |
15::ms => d.delay; | |
0.1 => g.gain; | |
0.1 => g2.gain; | |
0.98 => g3.gain; | |
512 => int max; | |
while (true) { | |
if (min.recv(msg)) { | |
<<<msg.data2+":"+Std.mtof(msg.data2)>>>; | |
(Std.mtof(msg.data2) $ int) + 0 => max; | |
} | |
if (max < 0) { | |
0 => max; | |
} | |
Std.rand2(max-512, max) => s.freq; | |
0.01 ::ms=> now; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment