Csound Csound-dev Csound-tekno Search About

[Csnd] Question re GEN routines

Date2023-05-02 05:03
FromScott Daughtrey
Subject[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:

https://www.dropbox.com/s/sv37xf4un2b841t/expon_saw.jpg?dl=0

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
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-05-02 05:38
Fromthorin kerr
SubjectRe: [Csnd] Question re GEN routines
I'd try cobbling together a table with GEN 18.



On Tue, May 2, 2023 at 2:03 PM Scott Daughtrey <stunes6556@gmail.com> wrote:
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:

https://www.dropbox.com/s/sv37xf4un2b841t/expon_saw.jpg?dl=0

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
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2023-05-02 14:01
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Question re GEN routines
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

On 2 May 2023, at 05:39, thorin kerr <thorin.kerr@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

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



On Tue, May 2, 2023 at 2:03 PM Scott Daughtrey <stunes6556@gmail.com> wrote:
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:

https://www.dropbox.com/s/sv37xf4un2b841t/expon_saw.jpg?dl=0

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
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here