Hi,
Given the recent discussion on the list about intentional aliasing noise I am hoping someone might be able to help me with a similar issue I am having.
I have been working on an instrument that uses FM synthesis with extreme modulation indexes. This sounds exactly like I want when I render it at a particular sample rate, the one I use for composing. However, I generally like to render the final mix at higher rates than I use when I am composing so I can remove unintentional aliasing. Doing this, of course, makes my instrument sound completely different. I have been experimenting with ways to fix this the past few weeks and I haven't been making much progress.
I initially tried using the fold opcode. If I put a fold opcode on each individual oscillator and listen to each oscillator alone with no modulation they seem to have the same spectrum regardless of sample rate. When I start connecting the oscs together and listen to the resulting FM, however, the sample rate affects the sound. Here is some test code that demonstrates the problem when compiled at sample rates:
<CsoundSynthesizer>
<CsInstruments>
sr = 44100 ;change to something higher to hear the difference in sound
ksmps = 1
nchnls = 1
gisquarewave ftgen 0, 0, 2^16, 7, -1, (2^16)/2, -1, 0, 1, (2^16)/2, 1
gipulsewave ftgen 0, 0, 2^16, 7, -1, (2^16)/4, -1, 0, 1, ((2^16)/4)*3, 1
instr 1
aosc1 oscil3 1, 400, gipulsewave
aosc1 fold aosc1, sr/44100
aosc2 oscil3 5000, 1000 + aosc1 * 18000, gisquarewave
aosc2 fold aosc2, sr/44100
out aosc2
endin
</CsInstruments>
<CsScore>
i1 0 1
</CsScore>
</CsoundSynthesizer>
I have tried creating a user defined opcode and making all of the oscs run at krate. Unfortunately, I use ksmps = 1 and, correct me if I am wrong, you can only increase ksmps in a UDO, not decrease it.
I found the vaget and vaset solution mentioned in the previous conversation to be an interesting idea, but it requires ksmps to be greater than 1, if I understand the methodology correctly.
Any ideas?
--
Electronically,
Jeff Taylor