File: hrtfearly.csd

package info (click to toggle)
csound-manual 1%3A6.08.0~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 34,580 kB
  • sloc: xml: 193,471; python: 1,332; makefile: 783
file content (74 lines) | stat: -rw-r--r-- 1,379 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<CsoundSynthesizer>
<CsOptions>

; Select flags here
; realtime audio out
 -o dac
; file ouput 
; -o hrtf.wav
  
</CsOptions>
<CsInstruments>

nchnls = 2

gasrc init 0	;global

instr 1		;a plucked string, distorted and filtered

  iamp = 15000
  icps = cpspch(p4)

  a1 pluck iamp, icps, icps, 0, 1
  adist distort1 a1, 10, .5, 0, 0
  afilt moogvcf2 adist, 8000, .5 
  aout linen afilt, 0, p3, .01
  
  gasrc = gasrc + aout

endin

instr 10	;uses output from instr1 as source
  
  ;simple path for source
  kx line 2, p3, 9

  ;early reflections, room default 1
  aearlyl,aearlyr, irt60low, irt60high, imfp hrtfearly gasrc, kx, 5, 1, 5, 1, 1, "hrtf-44100-left.dat", "hrtf-44100-right.dat", 1

  ;later reverb, uses outputs from above
  arevl, arevr, idel hrtfreverb gasrc, irt60low, irt60high, "hrtf-44100-left.dat", "hrtf-44100-right.dat", 44100, imfp

  ;delayed and scaled
  alatel delay arevl * .1, idel
  alater delay arevr * .1, idel

  outs	aearlyl + alatel, aearlyr + alater
  
  gasrc = 0

endin
  
</CsInstruments>
<CsScore>

; Play Instrument 1: a simple arpeggio
i1 0 .2 8.00 
i1 + .2 8.04
i1 + .2 8.07
i1 + .2 8.11
i1 + .2 9.02
i1 + 1.5 8.11
i1 + 1.5 8.07
i1 + 1.5 8.04
i1 + 1.5 8.00
i1 + 1.5 7.09
i1 + 4 8.00

; Play Instrument 10 for 13 seconds.
i10 0 13

</CsScore>
</CsoundSynthesizer>