1

I'm trying to control a parameter with AE expressions and I need a triangle wave. I've got this so far:

freq = 20;
amplitude = 8; 

m = amplitude;
i = time*freq;

m - (i % (2*m) - m);

Unfortunately this gives a saw wave (see below) and my math's a bit rusty, any takers?

Thanks!

PJ

http://i25.photobucket.com/albums/c73/pjburnhill/Screenshot2010-04-09at153815.png

user1118321
  • 25,567
  • 4
  • 55
  • 86
PJ Palomaki
  • 99
  • 4
  • 10

1 Answers1

2

An easy way to get a triangle wave from here would be to subtract m/2 and take the absolute value. Alternatively, use f = m - abs(i % (2*m) - m).

John Feminella
  • 303,634
  • 46
  • 339
  • 357