Messages Search About

Re: [Csnd] Question rev how to create a ramp waveform vs saw

Date2022-09-20 21:41
FromScott Daughtrey
SubjectRe: [Csnd] Question rev how to create a ramp waveform vs saw
Issue somewhat resolved, I now realize there is an lfo opcode. However the waveform produced is unipolar. Is there a way to make the waveform bipolar?

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

Date2022-09-20 21:52
From"Jeanette C."
SubjectRe: [Csnd] Question rev how to create a ramp waveform vs saw
Sep 20 2022, Scott Daughtrey has written:

> Issue somewhat resolved, I now realize there is an lfo opcode. However the waveform produced is unipolar. Is there a way to make the waveform bipolar?
Several ways. If you're happy with the LFO, just scale the value, with
linlin or by adding/subtracting and multiplying the value.
If the output gooes from 0 to 1 you can do something like:
kBipolar = (kUnipolar - .5) * 2
or:
kBipolar = linlin(kUnipolar, -1, 1)

Or you use a more generic approach to the LFO with the oscil opcodes (or
direct table opcodes). Function generator GEN07 constructs a table (or
waveform in your case) from straight lines, so just draw a straight line
from the beginning of the table to the end. If you want it bipolar,
don't forget to use a negative GEN number:
giRampUp = ftgen(0, 0, 4096, -7, -1, 4096, 1)
Both oscil* and table opcodes can output k-rate or a-rate variables.

HTH.

Best wishes,

Jeanette
...

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Do you even know what I like
Just what I'm living for,
What I adore <3
(Britney Spears)

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