Homework: Effects and Patterns
- Out: Oct 12, 2021 Tuesday
- Due: Oct 26, 2021 Tuesday
Objective and Overview
Homework 3 should be a quick study to work with some essentials in Chuck. Its components might help you imagine more final project possibilities.
Set up a microphone for real-time input to chuck. CCRMA is loaning out mic kits + soundcards this year and they are ready for pick up at the 2nd floor admin area (self-serve). Alternatively, feel free to use whatever is convenient to plug into your soundcard. (Later in the quarter we're intending to have a mic building lab but that won't be in time for this assignment.)
Key Steps
- Make a local directory
hw3
with anindex.html
file and a subdirectory to contain ChucK code. - Download and test each example in this repository locally using ChucK in the command line, miniAudicle or webchuck.
- Homework 3's assignment is to use adc input in combination with effects processing and pattern generation.
- Upload the project to a new homework directory named
hw3
on your CCRMA web space.
Background
The examples introduce several new concepts in turn:
- ADC input (from microphone)
- UGen's for effects processing (resonator, pitch shifter)
- pattern generating functions (chaos, periodic, random)
- FFT-based tracking (spectral centroid, RMS amplitude)
The examples
inOut.ck
- Send mic to speaker through chuck as if a straight wire.
inEfx.ck
- Resonance filter affecting mic signal
- Time-varying with slow, rectified sine pattern
chaotic.ck
- Print changing values from the logistic map chaotic function.
x
is chaos state variable.r
is chaos "heat".
plotChaotic.ck
- Store the changing values to a text file with a "hardwired" filename. Storing works only for command line Chuck or miniAudicle (but not webchuck).
- Plot the values using your choice of plotting applications.
- gnuplot is a good choice
- You can run the chuck script as fast as possible with
chuck -s
option since we just want the computed result.
plotPeriodic.ck
- Store values from a low frequency periodic signal to the same plot file.
f
is wave frequency.a
is wave amplitude.
plotRandom.ck
- Store values from a random walk to the same plot file.
l
is low bound.h
is high bound.
FFT.ck
- Pass input signal to spectral centroid and RMS amplitude trackers.
- Print their changing values.
- Apply changing values to a SinOsc simultaneously.
l
is low bound.h
is high bound.- Trackers are borrowed from analysis/features/centroid.ck and analysis/features/rms.ck.
Also play around with the following examples of combinations:
combineEfxRandom.ck
- Adc input through pitch shifter with random variation
PitShift
effect- Random class from above
- (for a simpler example, see book/digital-artists/chapter6/Listing6.14.ck)
combineClarinetChaotic.ck
- Clarinet physical model with chaotic variation
- Clarinet UGen
- Logistic class from above for chaotic variation
kbdControlChaotic.ck
- Computer keyboard control with clarinet and chaotic variation
- First, determine kbd hid number with
probe.ck
.- On linux devices, to get permissions for that:
sudo chmod a+r /dev/input/event*
- On linux devices, to get permissions for that:
- First, determine kbd hid number with
Hid
Class for reading keyboard events- Clarinet UGen
- Logistic class from above for chaos pattern
- (for another example of kbd event polling, see hid/kb.ck).
- Computer keyboard control with clarinet and chaotic variation
The combineEfxRandom, combineClarinetChaotic and kbdControlChaotic scripts above present combinations of respectively, adc + efx, physical model + patterns, kbd + patterns.
Consideration
Homework 3's assignment is to use adc input in combination with effects processing and pattern generation. That's what's essential, but don't be constrained by what's in the examples. Feel free to explore other FFT-based tracking, efx or combine some synthesis from earlier work.
Please don't just recycle the above examples. Customize them and layer multiple musical "voices" so there's more than one thing going on at a time. That can either be done by creating functions for that in the chuck script being built by scheduling them or by post-processing, for example, mixing .wav files in an audio editor as in the previous homework.
Capture the output of different real-time performances as .wav files by either using the
WvOut
orWvOut2
UGens or by directly routing Chuck output into to an audio editor for recording.
If using the UGens with miniAudicle, the file needs to be explicitly closed after playing and outputting the samples, for example, by calling
w.closeFile()
.
The final mix should be a .wav file in a subdirectory media
under hw3
and playable from a link or button included in the index.html
page.