This lab introduces you to working with physical models in ChucK. There is no short answer portion this assignment. Your deliverable will be a .wav file of the sound of ths physical model and the code that created the .wav file. Place these files in your /Library/220a/hw4/ directory.
For the composition, compose a short musical statement (1-2 min) consisting of a 'physical model band' using instruments in ChucK. For at least part of your composition, one of the instruments' sonic parameters must be controlled by data of your choosing. "Submission" entails placing an HTML file hw4.html that links to your code and .wav file in your /Library/Web/220a/ subdirectory. Make sure that your submission is timestamped on the Homework Factory.
In this lab, we will ask you to work with one of the physical models built into ChucK to create a short series of melodic notes. While this template code will be specific to the Clarinet physical model, it forms a template by which you can play other physical models.
Background: For those curious, the physical models implemented in ChucK use classes from the Synthesis Toolkit, a set of C++ classes by Perry Cook and Gary Scavonne, which have also been ported into Max/MSP Dan Trueman and Luke Dubois.
Before you begin the lab, take a moment to read and undestand the purposes of the parameters of the Clarinet class here.
Using the Clarinet instrument built in ChucK, create a sequence of clarinet tones separated by 1 second of silence as follows:
Reference the starter code clip_clar.ck for the functions necessary to get the sounds asked for above. You need to spork the function though, with the appropriate choices for your input parameters, to achieve the sounds above!
As in previous homeworks, export your homework as a .wav file, named LASTNAME_CLARINET.wav into your /Library/220/hw4/ subdirectory, and save the code you wrote as LASTNAME_CLARINET.ck.
Write a musical statement (~1 min) using at least two of the STK instruments in ChucK. One should be using a typically pitched instrument
and another should be using a more percussive instrument.
Physical Modeling Instructions
Some template code that might be of help:
Submit to the Homework Factory an HTML file titled hw4.html that includes the following:
Sonification is the use of non-speech audio to convey information or perceptualize data, and has been used by many composers to add depth to their works. Here, we are asking you to sonify some aspect of your composition - either one (or both) of your physical models, or some extra sound that you want to include. The tools to read data into ChucK are provided, but you can pick whatever data you'd like to sonify. Here are two example data files: (from the Time Series Data Library collection)
These .dat files contain data in them that, for instance, could be mapped to pitch, as in, the higher the sales, the higher the pitch. Depending on your data, you might choose to map it in different ways. For example, data on the heartbeat of a runner during a run may control the overall tempo of the piece. Or, it may control the 'breathiness' of a physical model - the higher the heart rate, the more likely they are out of breath. You can be creative with this - there are no wrong choices!
Here are the ChucK files to get you started:
Important: you need to modify the dataDir variable to have the paths point to where you've downloaded the data files on your computer.
Some Command Line Instructions (for those who want them)
In a terminal, launch chuck by providing the ChuK code file and the data filename as an argument to it. Arguments are preceded with a colon. For instance:
chuck hw4-DataReader.ck:data-drywhite.dat
reads in and sonifies the dry white wine sales data file.
Alternatively, we can shred two chuck files, where the first chuck file is hw4-DataReader.ck, and the second chuck file specifies the data file(s) to be used. In the following example, the second chuck file plays with smoothed envelopes:
chuck hw4-DataReader.ck hw4-Player.ck
In this case, no argument is needed to m220a-DataReader.ck because the data filenames are coded in the content of the second file. Since no arguments are passed to m220a-DataReader.ck, it handles only the reading in files part, while all data-to-sound mappings are defined in m220a-Player.ck. Also note the syntax: we shred multiple chuck files in the terminal by separating them with a space.