How to 'dynamically' transform a Sine Wave into other wave shapes?

Ryan Lieber's icon

Hey all,

I am wondering how to go about 'dynamically' transforming a Sine Wave (say, from a Cycle object) into other wave forms (let's say just square and triangle to start).

My goal is to do this in a mathematically fundamental kind of way so as to better understand calculus and trigonometric functions better. Would I use trigonometric function objects to transform the sin function of a sine wave into a linear function (which is more analogous to a triangle wave)? Would this kind of functionality be better obtained using gen~?

An example of what I would like to do is to have one knob, which when set to "dry" (or "0"), leaves a sine wave untouched, and when the knob is set fully to "wet" (or "127"), the sine wave is fully transformed into a different waveform, say a triangle or square wave. I imagine I could set up something like a crossfader between pre-existing waveforms, but ideally i would like to know a method that would teach me more fundamentals about the calculus (differentiation, integration) behind waveforms...is this idea what the term 'wave-shaping' refers to?

Hopefully that makes sense! I'm sure there's a zillion ways to go about this, but I'd appreciate any thoughts or opinions. Again, the main goal here is to better understand the maths in calculus - and to make cool sounds, of course ;) Thanks a bunch my fellow Max-ers!