I've been wondering about this for years. When I try to use the sine opcode to create waveforms, I run into two glitches. The basic csd (complete csd attached) below should generate a nice, 200 seconds long, sinewave with a frequency of 4000/(2pi)=636.619... hz.
This works for the first 4 seconds of the output file. Then the pitch rises about 1% and remains there until 126 seconds in, at which point the pitch drops drastically to about 430 hz ( two-thirds?).
Anyone have any idea what's going on?
I've attached an mp3 that illustrates the phenomenon. Just jump to 2 minutes in, and you can hear the dropoff at about 2:06.
I'm using Csound 5.08 on OS X, 10.4.10.
--------------------------------------------------------------------
sr = 44100 ; audio sampling rate is 44.1 kHz
kr = 44100 ; control rate is 44.1 kHz
ksmps = 1 ; number of samples in a control period=(sr/kr)
nchnls = 1 ; number of channels of audio output
instr 1; basic mono sine wave
; p3 is duration
; p4 is freq times 2 pi
; p5 is amplitude
a1 line 0, p3, p3
a2 = p5*sin(p4*a1)
out a2
endin
i1 0 200 4000 10000
e
| Attachment | Size |
|---|---|
| sineTest.mp3 | 4.58 MB |
| sineBasic01.csd | 494 bytes |


