summaryrefslogtreecommitdiff
path: root/examples/bformenc1.csd
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2014-01-24 13:54:37 -0300
committerFelipe Sateler <fsateler@debian.org>2014-01-24 13:54:37 -0300
commitbcf06a42deb371baf3deb9f4addb474b08273120 (patch)
tree4a8c3fb811dd164d4486628d8eff6043ebe8a6c3 /examples/bformenc1.csd
parent3a91171181113761a14bcc36a086a8dda144b77b (diff)
Imported Upstream version 6.02~dfsg
Diffstat (limited to 'examples/bformenc1.csd')
-rw-r--r--examples/bformenc1.csd68
1 files changed, 49 insertions, 19 deletions
diff --git a/examples/bformenc1.csd b/examples/bformenc1.csd
index 9f2ff76..8df29ad 100644
--- a/examples/bformenc1.csd
+++ b/examples/bformenc1.csd
@@ -8,35 +8,65 @@
</CsOptions>
<CsInstruments>
sr = 44100
-kr = 4410
-ksmps = 10
+ksmps = 32
nchnls = 8
+0dbfs = 1
-instr 1
- ; generate pink noise
- anoise pinkish 1000
+instr 1 ;without arrays
+; generate pink noise
+anoise pinkish 1
- ; two full turns
- kalpha line 0, p3, 720
- kbeta = 0
+; two full turns
+kalpha line 0, p3, 720
+kbeta = 0
- ; generate B format
- aw, ax, ay, az, ar, as, at, au, av bformenc1 anoise, kalpha, kbeta
+; generate B format
+aw, ax, ay, az, ar, as, at, au, av bformenc1 anoise, kalpha, kbeta
- ; decode B format for 8 channel circle loudspeaker setup
- a1, a2, a3, a4, a5, a6, a7, a8 bformdec1 4, aw, ax, ay, az, ar, as, at, au, av
+; decode B format for 8 channel circle loudspeaker setup
+a1, a2, a3, a4, a5, a6, a7, a8 bformdec1 4, aw, ax, ay, az, ar, as, at, au, av
+
+; write audio out
+outo a1, a2, a3, a4, a5, a6, a7, a8
+endin
+
+instr 2 ;with arrays (csound6)
+;set file names for:
+S_bform = "bform_out.wav" ;b-format (2nd order) output
+S_sound = "sound_out.wav" ;sound output
+
+; generate pink noise
+anoise pinkish 1
- ; write audio out
- outo a1, a2, a3, a4, a5, a6, a7, a8
+; two full turns
+kalpha line 0, p3, 720
+kbeta = 0
+
+;create array for B-format 2nd order (9 chnls)
+aBform[] init 9
+
+; generate B-format
+aBform bformenc1 anoise, kalpha, kbeta
+
+;write out b-format
+fout "fout.wav", 18, aBform
+
+;create array for audio output (8 channels)
+aAudio[] init 8
+
+;decode B format for 8 channel circle loudspeaker setup
+aAudio bformdec1 4, aBform
+
+; write audio out
+fout S_sound, 18, aAudio
endin
+
</CsInstruments>
<CsScore>
-
-; Play Instrument #1 for 20 seconds.
-i 1 0 20
+i 1 0 8
+i 2 8 8
e
-
-
</CsScore>
</CsoundSynthesizer>
+