week 2
B. Synthesis I
1. Tone generator & argument
많은 종류의 tone generator들을 SC에서는 UGEN(Unit Generator)으로 분류한다.
UGEN(Unit Generator)
http://en.wikipedia.org/wiki/Unit_generator
Unit Generators form the building blocks for designing synthesis and signal processing algorithms
in software. For example, a simple unit generator called OSC could
generate a sinusoidal waveform of a specific frequency (given as an
input or argument to the function or class that represents the unit generator).
ref.
Computer Music: Synthesis, Composition, and Performance
by Charles Dodge and Thomas A. Jerse
unit generator: an algorithm that performs a particular function of sound generation, modification, or combination. It is controlled by parameters obtained from a score or transducer. (438p)
Each unit generator has input parameters and at least one output. Each performs a specific function of signal generation or modification, or the combination of signals. Many music languages express synthesis algorithms in terms of unit generators, using them as the building blocks with which instruments are made. The internal algorithm of each unit generator has been determined and encoded by the music systems programmer. The musician's task is to interconnect the inputs and outputs of the unit generators to achieve an overall synthesis algorithm that produces the desired result. (72p)
ref.
ChucK :
Unit Generators Reference(
all)
ChucK : Language Specification > Unit Generators
Unit Generators are function generators that output signals that can be used as audio or control signals.
{Saw.ar}.play
{FSinOsc.ar}.play
{Pulse.ar}.play
Saw band limited sawtooth
Saw.ar(freq, mul, add)
Band limited sawtooth wave generator.
freq - Frequency in Hertz (control rate).
See also: LFSaw
// modulating the frequency
{ Saw.ar(XLine.kr(40,4000,6),0.2) }.play;
// two band limited sawtooth waves through a resonant low pass filter
{ RLPF.ar(Saw.ar([100,250],0.1), XLine.kr(8000,400,5), 0.05) }.play;
http://en.wikipedia.org/wiki/SawtoothA more general form, in the range −1 to 1, and with period
a, is
This sawtooth function has the same phase as the sine function.
A sawtooth wave's sound is harsh and clear.
http://en.wikipedia.org/wiki/440_Hz
A440 is the 440 Hz tone that serves as the standard for musical pitch. A440 is the musical note A above middle C (A4).
FSinOsc fast sine oscillator
FSinOsc.ar(freq, iphase,mul, add)
Very fast sine wave generator (2 PowerPC instructions per output sample!) implemented using a ringing
filter. This generates a much cleaner sine wave than a table lookup oscillator and is a lot faster.
However, the amplitude of the wave will vary with frequency. Generally the amplitude will go down as
you raise the frequency and go up as you lower the frequency.
WARNING: In the current implementation, the amplitude can blow up if the frequency is modulated
by certain alternating signals.
freq - frequency in Hertz
{ FSinOsc.ar(800, 0.0, 0.25) }.play;
{ FSinOsc.ar(XLine.kr(200,4000,1),0.0, 0.25) }.play;
// loses amplitude towards the end
{ FSinOsc.ar(FSinOsc.ar(XLine.kr(4,401,8),0.0, 200,800),0.0, 0.25) }.play;
http://en.wikipedia.org/wiki/Electronic_oscillatorhttp://en.wikipedia.org/wiki/Sine_wavePulse band limited pulse wave
Pulse.ar(freq, width, mul, add)
Band limited pulse wave generator with pulse width modulation.
freq - Frequency in Hertz (control rate)
width - Pulse width ratio from zero to one. 0.5 makes a square wave (control rate)
See also: LFPulse
// modulate frequency
{ Pulse.ar(XLine.kr(40,4000,6),0.1, 0.2) }.play;
// modulate pulse width
{ Pulse.ar(200, Line.kr(0.01,0.99,8), 0.2) }.play;
// two band limited square waves thru a resonant low pass filter
{ RLPF.ar(Pulse.ar([100,250],0.5,0.1), XLine.kr(8000,400,5), 0.05) }.play;
ref.
invalid-file
<Arbitrary Band-Limited Pulse Generation for Built-in Self-test Applications> Benoit Dufort & Gordon W. Roberts, McGill University