| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in No messages |
| 5 |
;-odac -iadc -d ;;;RT audio I/O |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
-o bformenc.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
sr = 44100 |
| 11 |
ksmps = 32 |
| 12 |
nchnls = 8 |
| 13 |
0dbfs = 1 |
| 14 |
|
| 15 |
instr 1 ;without arrays |
| 16 |
; generate pink noise |
| 17 |
anoise pinkish 1 |
| 18 |
|
| 19 |
; two full turns |
| 20 |
kalpha line 0, p3, 720 |
| 21 |
kbeta = 0 |
| 22 |
|
| 23 |
; generate B format |
| 24 |
aw, ax, ay, az, ar, as, at, au, av bformenc1 anoise, kalpha, kbeta |
| 25 |
|
| 26 |
; decode B format for 8 channel circle loudspeaker setup |
| 27 |
a1, a2, a3, a4, a5, a6, a7, a8 bformdec1 4, aw, ax, ay, az, ar, as, at, au, av |
| 28 |
|
| 29 |
; write audio out |
| 30 |
outo a1, a2, a3, a4, a5, a6, a7, a8 |
| 31 |
endin |
| 32 |
|
| 33 |
instr 2 ;with arrays (csound6) |
| 34 |
;set file names for: |
| 35 |
S_bform = "bform_out.wav" ;b-format (2nd order) output |
| 36 |
S_sound = "sound_out.wav" ;sound output |
| 37 |
|
| 38 |
; generate pink noise |
| 39 |
anoise pinkish 1 |
| 40 |
|
| 41 |
; two full turns |
| 42 |
kalpha line 0, p3, 720 |
| 43 |
kbeta = 0 |
| 44 |
|
| 45 |
;create array for B-format 2nd order (9 chnls) |
| 46 |
aBform[] init 9 |
| 47 |
|
| 48 |
; generate B-format |
| 49 |
aBform bformenc1 anoise, kalpha, kbeta |
| 50 |
|
| 51 |
;write out b-format |
| 52 |
fout "fout.wav", 18, aBform |
| 53 |
|
| 54 |
;create array for audio output (8 channels) |
| 55 |
aAudio[] init 8 |
| 56 |
|
| 57 |
;decode B format for 8 channel circle loudspeaker setup |
| 58 |
aAudio bformdec1 4, aBform |
| 59 |
|
| 60 |
; write audio out |
| 61 |
fout S_sound, 18, aAudio |
| 62 |
endin |
| 63 |
|
| 64 |
|
| 65 |
</CsInstruments> |
| 66 |
<CsScore> |
| 67 |
i 1 0 8 |
| 68 |
i 2 8 8 |
| 69 |
e |
| 70 |
</CsScore> |
| 71 |
</CsoundSynthesizer> |
| 72 |
|