Hello to everyone, a newbie here,
With this code I’m trying to control the phase of a sine with a slider, but I’m stuck why it doesn’t update when Csound runs:
Hi Ital,
I could be wrong but I think that as oscili will read the phase at i rate this won’t work.
You can instead read directly from the ftable using a table/tablei opcode. Here’s an example, in this case the phase of the right output is being modulated.
-odac
; -o phase_mod.wav
sr = 48000
ksmps = 32
nchnls = 2
0dbfs = 1
giSine = ftgen(1, 0, 2^14, 10, 1)
instr 1
kPhs = line(0, p3, 1) ; phase mod.
aIdx = phasor(220)
aL = tablei:a(aIdx, 1, 1, 0, 1)
aR = tablei:a(aIdx + kPhs, 1, 1, 0, 1)
iAmp = .8
outs aL * iAmp, aR * iAmp
endin