A Gen5 UGen can produce a wave with exponential line segments.
We have to give coefficients in range (-1 to +1), for x from 0 to 1. These serve as the y-points where the piecewise exponential curve goes through.
Since a ramp from 0 to 1 is the function of a Phasor, a phasor drives the Gen5 oscillator.
We have 2 periods of Gen5 as the phasor varies 0 to 1, for 2 periods.
# chuck32.py - Gen5
Phasor phasor
Gen5 g5
dac = g5
g5 = phasor
# 0.1 is inital value
# At 0.5, it is at 0.9
# At 0.75 (0.5+0.25), it is at 0.7
# At 1 (0.5+0.25+0.25), it is at 0.1
g5.coefs = [0.1, 0.5, 0.9, 0.25, 0.7, 0.25, 0.1]
phasor.freq = 100
time(20::ms)
This is the wave, after running python createWav.py chuck32, on command line: