| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-o dac -m128 |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
|
| 7 |
sr = 44100 |
| 8 |
nchnls = 2 |
| 9 |
0dbfs = 1 |
| 10 |
ksmps = 32 |
| 11 |
|
| 12 |
instr Pythagorean |
| 13 |
giScale[] fillarray 1, 9/8, 81/64, 4/3, 3/2 |
| 14 |
schedule("LetPlay",0,0) |
| 15 |
puts "Pythagorean scale",1 |
| 16 |
endin |
| 17 |
|
| 18 |
instr Meantone |
| 19 |
giScale[] fillarray 1, 10/9, 5/4, 4/3, 3/2 |
| 20 |
schedule("LetPlay",0,0) |
| 21 |
puts "Meantone scale",1 |
| 22 |
endin |
| 23 |
|
| 24 |
instr Quatertone |
| 25 |
giScale[] fillarray 1, 2^(1/24), 2^(2/24), 2^(3/24), 2^(4/24) |
| 26 |
schedule("LetPlay",0,0) |
| 27 |
puts "Quatertone scale",1 |
| 28 |
endin |
| 29 |
|
| 30 |
instr Partials |
| 31 |
giScale[] fillarray 1, 2, 3, 4, 5 |
| 32 |
schedule("LetPlay",0,0) |
| 33 |
puts "Partials scale",1 |
| 34 |
endin |
| 35 |
|
| 36 |
instr LetPlay |
| 37 |
indx = 0 |
| 38 |
while indx < 5 do |
| 39 |
schedule("Play",indx,2,giScale[indx]) |
| 40 |
indx += 1 |
| 41 |
od |
| 42 |
endin |
| 43 |
|
| 44 |
instr Play |
| 45 |
iFreq = mtof:i(60) * p4 |
| 46 |
print iFreq |
| 47 |
aSnd vco2 .2, iFreq, 8 |
| 48 |
aOut linen aSnd, .1, p3, p3/2 |
| 49 |
out aOut, aOut |
| 50 |
endin |
| 51 |
|
| 52 |
</CsInstruments> |
| 53 |
<CsScore> |
| 54 |
i "Pythagorean" 0 10 |
| 55 |
i "Meantone" 10 10 |
| 56 |
i "Quatertone" 20 10 |
| 57 |
i "Partials" 30 10 |
| 58 |
</CsScore> |
| 59 |
</CsoundSynthesizer> |
| 60 |
;example by joachim heintz |