In that case, Albert begins and is followed by Maureen after 2 seconds. Maureen is twice as fast as Albert.
Let's now add Alex whose making use of subtractive synthesis. f is a bandpass filter with a very high Q, giving a pitch to the filtered noise. The center frequency (f.freq) of f determines the pitch of the generated sound.
fun void alex(){
Noise n => BPF f => dac;
5 => n.gain;
30 => f.Q;
while(true){
Math.random2f(500,3000) => f.freq;
125::ms => now;
}
}
Don't forget to "spork" Alex!
Finally, let's make some "optimization" by declaring the reverb only once:
Note that pitch can also be expressed as a MIDI note number. Std.mtof(value) can be used to convert a MIDI note number into a frequency in ChucK.
More Basic ChucK Examples
Go though the basic and stk ChucK examples available in File/Open Example... in MiniAudicle and try to get some basic understanding of them. Feel free to ask if you have any question!
Assignment (Due on Jan. 18. 2018)
Go through the keyboard and mouse hid ChucK examples (File/Open Example... in MiniAudicle) such as kb.ck, keyboard-organ.ck, mouse-fm.ck, mouse.ck).
Design a keyboard and/or mouse-controllable musical instrument using one (or several) of the sound synthesis technique(s) presented in this lab (e.g., in the basic and stk examples or in the section on making a simple "orchestra").
Make sure that your instrument is expressive, artful, beautiful, playable, etc.
Make a video of yourself playing it and post it on YouTube.
Send the link of this video along with the source code of your instrument to by Jan. 18, 2018.