Skip to content

Instantly share code, notes, and snippets.

@amonks
Created June 28, 2012 20:39
Show Gist options
  • Save amonks/3013792 to your computer and use it in GitHub Desktop.
Save amonks/3013792 to your computer and use it in GitHub Desktop.
iphone alert sounds
fun void stairs(int inA, int inB, float step){
SinOsc a => dac;
inA => a.freq;
.1 => a.gain;
SinOsc b => dac;
inB => b.freq;
.1 => b.gain;
while(b.freq() < 500){
step::second => now;
a.freq() * 1.2 => a.freq;
b.freq() + 20 => b.freq;
}
}
fun void alarm(){
spork ~ stairs(100, 200, .05);
spork ~ stairs(50, 200, .03);
spork ~ stairs(100, 200, .01);
2::second => now;
}
fun void ring(){
spork ~ stairs(100,200,.2);
1::second => now;
spork ~ stairs(200,200,.05);
1::second => now;
spork ~ stairs(100,200,.1);
.5::second => now;
spork ~ stairs(200,200,.05);
2::second => now;
}
spork ~ alarm();
3::second => now;
spork ~ ring();
10::second => now;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment