/*
Problem 1
Write a CtkSynthDef called \exp_dec that will generate a single sine tone with an exponential decay. Your synth should take the following arguments:
freq - (frequency in Hertz)
amp (amplitude in dB)
noteDur (duration in seconds)
attDur (attack duration in seconds)
For the envelope creating the exponential decay, you should use the Env.perc method (look at the Env help file for more details) with a curve of -10.
After creating \exp_dec you should be able to call it like this:
*/
(
var noteObj, note;
noteObj = CtkSynthDef(\exp_dec, { arg ...
...
});
note = noteObj.new(1.0, 5.0).freq_(1000).amp_(-9).noteDur_(5).attDur_(0.001).play;
)
/*
Design Hints:
- Remember you need to use EnvGen in conjunction with Env to generate the samples of the envelope.
- You have to convert the amp parameter from dB to linear scale before using it for scaling values inside the SynthDef.
- You might want to give some default values to the SynthDef's parameters (in particular attDur which you might want to keep fixed in most of the calls).
*/
/*
Problem 2
Write a series of note calls that generates a "bell sound" by additive synthesis using \exp_dec from Problem 1. The bell sound will be produced by the combination (addition) of eleven sinusoidal partials. Each partial will be an individual note; but when the eleven notes are played together, sounding like a bell. Appropriate amplitude, frequency, and duration values will be used for each note to simulate the bell instrument on page 105 of Dodge's book.
Note: a number of the details described below vary from and supersede the details given in the Dodge book.
You should use the above code block as a starting point. Add in variables for amplitude, duration and frequency for your overall bell sound, where amp is your base amplitude (between 0 and 1), dur the total duration of the bell sound, and freq its fundamental frequency. Also add a varibale for a CtkScore, and to the score you will add 11 notes with the following parameters.
|
Partial |
Amplitude |
Duration |
Frequency |
|
1 |
Amp * 0.37 |
Dur * 1.0 |
Freq * 0.56 |
|
2 |
Amp * 0.25 |
Dur * 0.9 |
(Freq * 0.56) + 1 |
|
3 |
Amp * 0.37 |
Dur * 0.65 |
Freq * 0.92 |
|
4 |
Amp * 0.67 |
Dur * 0.55 |
(Freq * 0.92) + 1.7 |
|
5 |
Amp * 1.0 |
Dur * 0.325 |
Freq * 1.19 |
|
6 |
Amp * 0.62 |
Dur * 0.35 |
Freq * 1.7 |
|
7 |
Amp * 0.55 |
Dur * 0.25 |
Freq * 2.0 |
|
8 |
Amp * 0.5 |
Dur * 0.2 |
Freq * 2.74 |
|
9 |
Amp * 0.5 |
Dur * 0.15 |
Freq * 3.0 |
|
10 |
Amp * 0.37 |
Dur * 0.1 |
Freq * 3.76 |
|
11 |
Amp * 0.5 |
Dur * 0.075 |
Freq * 4.07 |
After filling in your score, you will play the score to produce your bell.
Notes:
- notice that the Amplitudes above are scalers on linear amplitudes between 0 and 1, while the CtkSynthDef wants values in decibels. Make sure you convert as needed!
- There are 11 notes played, so you will probably ALSO need to scale all the amplitudes by 1/11. Figure out a good way to work this into your code.
- under materials, 'bell.aif' is about what your bell should sound like.
*/