Hi,
I’ve written this and I cannot figure out for the life of me why it’s outputting an empty WAV file. What am I doing wrong?
<CsoundSynthesizer>
<CsOptions>
;-odac ; Disable real-time audio output
-o output.wav ; Output to a WAV file
</CsOptions>
<CsInstruments>
sr = 44100 ; Sample rate
ksmps = 32 ; Control rate
nchnls = 2 ; Number of output channels
instr 1
; Set up global variables
kEnv madsr 0.2, 0.2, 0.4, 0.6
aLFO oscil 1, 0.2, 1
aPanLFO oscil 0.5, 0.1, 1
aPanLFO = aPanLFO * 2 - 1
; Create the main sound using a resonant lowpass filter
aSound vco2 p5, 80
aSound butterlp aSound, 800
aSound = aSound * kEnv
; Apply panning
aLeft = aSound * (1 - aPanLFO)
aRight = aSound * aPanLFO
; Output the sound
outs aLeft, aRight
; Schedule the next note
if p3 + p4 < 180 then
schedule 1, 0, p3 + p4, p4, p5 * aLFO
endif
endin
</CsInstruments>
<CsScore>
; Define the function table
f1 0 16384 10 1
; Play the piece
i 1 0 180 0.2 cpsmidinn(60) ; Instrument 1, start time 0, duration 180s, amplitude 0.2, frequency 60Hz
</CsScore>
</CsoundSynthesizer>