Sunday, November 13, 2016

31. Gen7

A Gen7 UGen can produce a wave with linear line segments.


We have to give coefficients in range (-1 to +1), for x from 0 to 1.


Since a ramp from 0 to 1 is the function of a Phasor, a phasor drives the Gen7 oscillator.


We have 2 periods of Gen7 as the phasor varies 0 to 1, for 2 periods.


# chuck31.py - Gen7

Phasor phasor
Gen7 g7

dac = g7
g7 = 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

g7.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 chuck31, on command line:


No comments:

Post a Comment