| Hi,
You can do modulate between square and rectangular pulse using vco and vco2. As far as I can see it should be possible to create code that would also modulate between sawtooth and square wave by gradually changing the components of the pulses. You could probably do this in Csound code with band limited pulse trains, and working with the leaky integrator and whether or not you subtract the pulse train or not. Not sure how accurate the waveforms will turn out though.
Regards,
Hans Mikelson
On Mar 19, 2010, at 7:52 PM, Oeyvind Brandtsegg wrote:
> Just a shot in the dark, but since these waveforms are all constructed
> by adding sinusoidal harmonic components, wouldn't it be possible to
> morph between the waveforms by controlling the amplitude of each
> harmonic separately ? Obviously, one would need some of the harmonics
> in different phase flavors (as e.g. the triangle wave has every second
> component phase inverted), but such a doubling of some harmonics need
> not be very expensive CPU-wise? The amplitudes for each harmonic
> component could be stored in a table(one control table for each
> desired waveform), and then use ftmorf to create the transition
> (writing to the table used to actually control the synthesis
> parameters). Bandlimiting could be achieved by simply calculating the
> available number of harmonics below Nyquist, and since the amplitude
> of each harmonic is continuously controlled this would allow for
> correct bandlimiting even if the tone has pitch sweeps.
> Oh, admittedly it's a "brute force" approach, but some optimization
> could be done to not process oscillators with zero amplitude. And of
> course PWM effects would need some special handling, I'm not sure but
> maybe opcodes like pdhalf could do some of that, or use phase
> modulation (synchronized to the base pitch) on all oscillators.
>
> Oeyvind
>
> 2010/3/20 Michael Gogins :
>> The problem here is aliasing... you can't just draw the shape in a
>> wavetable and be done with it, and for the same exact reason you can't
>> just draw a sharp shape and be done with it. The shape has to be
>> smoothed to avoid aliasing, i.e. the square corners have to be curved
>> or have some sort of sinusoidal component, else the infinite number of
>> partials implied by the discontinuous click at the sharp corner will
>> fold over the Nyquist frequency and be heard as things you don't want
>> to hear.
>>
>> The bandlimited simple waveforms in Csound are done in different ways
>> to avoid this, and I frankly don't know if any of them admit of
>> continuous gradual changes in waveform. I know that it is possible to
>> continuously vary waveshaping distortion so I think that something
>> like this probably is possible, but somebody like Victor would know
>> better than I.
>>
>> Hope this helps,
>> Mike
>>
>> On Fri, Mar 19, 2010 at 5:58 PM, David Bowen wrote:
>>> The conversation about analog synths got me looking at the Moog web
>>> pages and, in particular, the Mini Moog. If I understood the demo
>>> video the oscillators had some wave shapes that were continuously
>>> variable via a control knob. One example was a rectangular wave, think
>>> a square wave but with the high and low sections of the wave having
>>> different lengths. I believe the other was a variable triangle wave.
>>> Is there a Csound opcode for either of these? If not, is there an easy
>>> way to create them with existing op codes? Obviously, you could change
>>> the wave table every time the wave shape parameter changed, but that's
>>> going to be much more effort if the wave shape is changing at a rate.
>>> The code to implement them shouldn't be complicated, so if they don't
>>> exist I may have to code them up myself, but I'm inclined to think I'm
>>> just not seeing them in the Manual.
>>>
>>> Dave Bowen
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>>
>>>
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
Send bugs reports to the Sourceforge bug tracker
https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
|