I am very new to CSound and Cabbage. Both programms so far have been amazing. I made a few synths that I am starting to be very happy with.
I am trying to build a supersaw synthesiser, and I made an example of the problem I have with a synth I am making. I got two oscilators to detune with the following code:
instr 1 iFreq = p4 iGain = p5 iDetune = 2 aSig1 vco2 iGain, iFreq + iDetune aSig2 vco2 iGain, iFreq - iDetune aOut = aSig1 + aSig2 outs aOut, aOut endin
But the problem with this snippet is that I don’t want to hardcode the oscilators.
I want to have a slider in my GUI to select the amount voices to use for the supersaw.
So I made a loop that makes an oscilator for every voice.
The problem with the following code snipped is that it does not sound like a detuned saw, but rather a strange digital sound. Can someone explain to me why it makes this sound, and how I should go about generating oscilators?
instr 1 iFreq = p4 iGain = p5 iDetune = 2 iVoices = chnget("voices") ; =2 aOut = 0 ; maybe the initiation goes wrong? kIndx = 0 until kIndx == iVoices do aSig vco2 iGain, iFreq + iDetune * kIndx aOut += aSig kIndx += 1 od out aOut, aOut ; strange fm sound? endin
Thank you very much in advance for the effort.