[Csnd] Question re GEN routines

If one wants to create custom/slightly more complex waveform shapes, is there a preferred GEN routine?

I noticed some that use exponents such as GEN05 only seem to allow either all positive or all negative values but not a combination.

For example, wanted to create a saw forward ramp waveform with an exponential curve from -1 to 1 like the one in this image:

This used:

giExp ftgen 2, 0, 1024, "exp", -2, 2, 0

which is convenient as it allows using mixed values (+, -) as well as 0. But using poscil to play, ex:

aSig = poscil(1, 110, 2)

produces a unipolar audio output. I was able to compensate using:

aSig = poscil(1.8, 110, 2)-.9

where the negative value has to be 1/2 of the amplitude.

Is there an easier method or better GEN, perhaps one that allows multiple values & options (more than one set of values, which GEN"exp" does not)? Especially if one wants to create irregular shapes, something that somewhat mimics transeg, allowing a mix of straight lines and curves (perhaps GEN25)? And best case scenario doesn't require compensating by using negative values after the oscil.

Scott

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

I’d try cobbling together a table with GEN 18.

Or offset+scale the oscillator signal. If the ramp is from 1 to close to 0, add -0.5 and then
scale it by 2.

Prof. Victor Lazzarini
Maynooth University
Ireland