Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Re: creating a variable width pulse wave...

Date2009-11-10 02:17
Frommichael.gogins@gmail.com
Subject[Csnd] Re: Re: Re: creating a variable width pulse wave...
It's not that easy to get right, and that's why there is an opcode. There are several ways.
 
You can have a set of wavetables, each of which contains a bandlimited sum of harmonics, i.e. you assign a base frequency to each table, then add partials to it only until you approach the Nyquist frequency. This works very well if you use enough tables, and go almost up to Nyquist with your partials. But it only works for static waveforms.
 
You can use a bandlimited interpolation (BLIP) technique, where you shift, scale, and sum copies of a sinc signal to reconstruct a desired waveform in a bandlimited manner. https://ccrma.stanford.edu/~jos/resample/Theory_Ideal_Bandlimited_Interpolation.html has the math with a good illustration. 
 
You can generate a bandlimited impulse train (BLIT) and integrate it with a filter.
 
A more comprehensive summary is in https://ccrma.stanford.edu/~stilti/papers/blit.pdf.
 
You can oversample a wavetable, and then low-pass filter.
 
There are variations on these themes, as well.
 
Hope this helps,
Mike
 
 
----- Original Message -----
Sent: Monday, November 09, 2009 6:05 PM
Subject: [Csnd] Re: Re: creating a variable width pulse wave...

Hey all,
I know the vco opcodes do this for you, but for those of us who are trying to make assembling from smaller parts a lesson in learning what we're doing . . .
How do you generate your own pwm sound generator?
Greg

On Nov 10, 2009, at 5:45 AM, victor wrote:

Try vco2.
----- Original Message -----
Sent: Monday, November 09, 2009 8:27 PM
Subject: [Csnd] creating a variable width pulse wave...

Hello fellow csounders,

I am working on a patch that requires a pulse wave with a variable pulse
width. I was wondering what would be the best opcode to use in creating
such a waveform. The pulse width will be controlled in realtime.


Thanks,
Anthony