The goal of this lab is to make a musical instrument combining acoustic sound excitations with digital elements. Sounds excitations are fed into a digital resonator (e.g., a waveguide, a comb filter, a reverb, etc.). The parameters of the resonator can be changed to modify the properties of the generated sound.
Connecting a Microphone or a Piezo to ChucK
Audio can be retrieved in ChucK simply by declaring an adc:
adc => dac;
which will connect the audio input of your system to the output. Be careful with that when prototyping with headphones as it might create feedback!
Microphones can be used to capture sound in the air and piezos in solids.
To be connected to a computer, the signal of microphones and piezos must be digitized. This can be done by using an audio interface. A bunch of them are available in the MaxLab for this week's lab.
Take the piezo from your kit and solder a coaxial cable to it as such:
Make sure the 2 pins of the cable are not touching each other! You might want to use a multimeter to check that.
Solder the 1/4" male jack plug of your kit to the other side of the cable:
Since the piezo is a mono component, only 2 pins on the jack are needed, thus you should solder the middle pin to the ground pin as such:
Your piezo + cable + jack should now look like this (in your case, the cable should be a bit longer):
Plug one of the USB audio interface in the MaxLab to your computer. You should make sure that it works by going in the audio preferences of your system. Since this works differently on each operating system, feel free to ask if you have no idea how to do that.
Plug your piezo to the first mic input of the audio interface. Adjsut the gain of the preamp by tapping on it and monitoring picks.
Try your system in Chuck by running the following simple program:
adc => dac;
while(true){
10::ms => now;
}
You should be able to hear the sound captured by the mic or the piezo in your headphones.
Let's now use this sound to excite virtual resonators running in ChucK. Resonators can be implemented in many different ways using comb filters, waveguides or even with a simple reverb.
Try to run the examples contained in the resonators folder of the starter code file. Don't forget to drive them with acoustic excitations captured with your piezo or your mic. Experiment with the different parameters of the resonators and see how they impact the generated sound.
comb.ck and ks.ck work in a very similar way and both implement a virtual string. More information on this type of algorithm can be found on Julius Smith's website.
In both cases, the R parameter controls the duration of the resonance of the string. The closer it will be to 1, the longer it will resonate.
Most built-in reverbs in ChucK have a rather limited number of parameters to control. For example, JCRev which is used in reverb.ck only allows to change the dry/wet mix through its mix parameter. Thus, in that case, the reverb is used as a resonator and an audio effect (dynamic pitch shifter in reveb.ck) is placed after it to add some expressivity to the instrument.
Exercise: Adding Sensor Control to the Previous Instruments
Take any of the starter code from the resonators folder and control one or several of its parameters with external sensor(s).
Lab 2 should contain all the material needed for you to reach this goal.
Make sure that your instrument is expressive and playable.
Try different sound sources, materials, etc. to drive it. Feel free to use anything available in the MaxLab for that.
Feel free to incorporate some of the audio effect examples available in the effects folder of the starter code file. In lab 5, we'll see how more effects can be used in ChucK using FaucK.
Assignment (Due on Feb. 1, 2018)
Make an instrument combining acoustic excitations captured in real-time with piezo(s) and/or microphone(s) to a virtual resonator and audio effects.
Feel free to explore different materials and mediums to create different types of sound excitations.
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 Feb. 1, 2018.