Consonance and Dissonance
If the frequencies of two tones played together are f1 and f2, then the measure of consonance is generally high if the ratio f2/f1 can be expressed as the ratio of two small integers.
Examples:
2/1 (octave) - most consonant
3/2 (fifth) - fairly consonant
72/21 - dissonant
Musical Scales
Conventional Western music defines an octave as a pair of notes such that the frequency of one note is twice the frequency of other note
Eight notes are defined between the two notes above to form the diatonic scale
Major diatonic scale: WWHWWWH (W = whole step, H = half step)
The notes in the scale are chosen to achieve the highest degree of consonance
Chromatic Scale
If each whole step is replaced with two notes (two half steps), the diatonic scale converts to the chromatic scale with twelve tones
Ideally, a pair of adjacent tones should have the same frequency ratio regardless of which two adjacent tones are chosen
Pythagorean Tuning
Scale based on the perfect fifth (freq. ratio of 3/2)
Start with a note with freq. f, generate notes a perfect fifth higher to the previous note, and translate all notes by octaves until all notes fall within one octave of f, sort the resulting frequency ratios to get the Pythagorean scale
Whole steps in scale are ratio of 9/8, half steps 256/243. See handout for relative frequencies.
Disadvantage: there exist two notes a "fifth" apart in the scale that are not related by the ratio 3/2.
Another problem occurs for perfect fourths (ratio of 4/3)
Just Tuning
Scale designed around the fifth, fourth and third intervals (freq ratios of 3/2, 4/3, 5/4).
Disadvantage: The whole step has two different frequency ratios, depending on where in the scale you are. This causes problems in musical transposition (shifting music to alternate keys)... you can't just multiply all frequencies by some factor to get the same composition in a different musical key.
Equal Tempered Tuning
All notes are separated by an equal frequency ratio: Whole step 22/12, Half step 21/12
Amount of dissonance is minimal for most intervals
Any tuning systems can be derived using this method (microtuning). An octave split into 20 halfsteps would use a freq ratio of 21/20.
Pitch Notation in Csound
cps - cycles per second (default)
pch - octave point pitch class
example: 8.09
8 = octave representation (8 = octave starting with Middle C)
09 = 9 half steps above C ==> A
oct - octave point decimal
example: 8.75
8 = octave representation (as with pch)
75 = percentage of octave above C (9/12 = 75%) ==> A
Pitch Converters in Csound
Orchestra functions used to convert between pitch representations
octpch() - convert from pch to oct pchoct() - convert from oct to pch cpspch() - convert from pch to cps <-- most common with oscil octcps() - convert from cps to oct cpsoct() - convert from oct to cps
Pitch Representation Example in Csound
instr 1 k1 linen p4, p3/10, p3, p3/2 a1 oscil k1, cpspch(p5), 1 out a1 endin f1 0 1024 10 1 0 0.33 0 0.2 i1 0 0.5 10000 8.09 ; A i1 1.0 0.5 20000 8.06 ; F# or Gb i1 2.0 1.0 15000 7.11 ; B (below Middle C) e
The Scot Score Translator
Language for describing scores similar to traditional music notation
Generates score files in standard Csound format for use in Csound compilation with an appropriate orchestra
Scot Program Sections
Orchestra - defines instrument names and macro definitions
Functions - defines function table definitions
Score - defines notes for music composition
Orchestra Declaration Section
orchestra {
[ pp=2000 p=4000 mp=7000 mf=10000 f=20000 ff=30000 ]
guitar = 1
piano = 2
cello = 3 [ pizz=0 arco=1 ]
}
Function Declaration Section
functions {
f1 0 256 10 1 0 0.5 0 0.3
f2 0 256 7 0 64 1 64 0.7 64 0
}
Score Declaration Rules
Note pitches specified by letter only will always fall within an interval of a fourth (6 halfsteps) from the preceding pitch
Displace these pitches by octave(s) by preceding pitch with one or more ' or ,
The equal sign = acts a dummy Middle C for pitch placement
Score Declaration Section
score {
$cello
!ti "4/4"
4=g 4e 4d 4c/ 4='g 4e 4d 4c/
4=g e d c/ ''g e d c/
2=c 4c# 4r/ 4.=c 8e- 2r/
}
Scot Use of Note Parameter Fields
p1 = instrument number
p2= start time of note (in beats)
p3 = duration of note (in beats)
p4 = "slur" value (0,1,2,3)
p5 = pitch (in pch notation)
p6,p7,p8,... are user defined (optional)
More Score Rules
Accidentals are carried throughout the measure, except they are applied to all notes of the same pitch class
Tempo can be specified with a "t" statement in a single instrument part (and is applied to all instruments played at that time)
Pitches are translated to pch format
Extended Scot Example
orchestra {
[ p=4000 mf=10000 f=20000 ff=30000 ]
guitar = 1
}
functions {
f1 0 256 10 1 0 0.5 0 0.3
}
score {
$guitar
!ti "4/4"
2=c[p] 4r 4d__[mf]/ 4.d[mf] 8e-_[ff] 2d[f]/
}
Translated Csound Score File for Extended Scot Example
t0 60 f1 0 256 10 1 0 0.5 0 0.3 i1 0 2.0 0 8.00 4000 i1 3.0 2.5 0 8.02 10000 i1 5.5 0.5 1 8.03 30000 i1 6.0 2.0 0 8.02 20000 e
Example Csound orchestra to use with Scot program for score
instr 1 ; p6 = amp
if p4 = 1 goto postslur if p4 = 2 goto preslur ; else p4=0 (no slur) k1 linen p6, p3/4, p3, p3/4 goto done postslur: k1 linen p6, p3/4, p3, 0 goto done preslur: k1 linen p6, 0, p3, p3/4 done: a1 oscil k1, cpspch(p5), 1 out a1 endin
COURSE INFORMATION | HOMEWORK ASSIGNMENTS
COURSE PROJECT | CS240 HELP DESK