## Help aligning waveform peaks

Apr 12, 2012 at 6:31pm

# Help aligning waveform peaks

I have both a triangle and sine waveform whose peaks I would like to align. At the moment the waveform cycles are synchronised, however, the sine trough occurs during the triangle peak – and I would like both to peak and trope at the same time.

I have generate the sine using the [phasor~ [cos] objects and the triangle using a [phasor~] [triangle 0.5] combination. Could anyone help me find an calculation that allows you to move a waveform by half a cycle. I have included the patch I am working which outlines the two waveforms.

– Pasted Max Patch, click to expand. –
#62928
Apr 12, 2012 at 7:13pm

you just need to set the phase on the left [cos] phasor~ to 0.5.

heres your patch modified to do so

– Pasted Max Patch, click to expand. –
#227148
Apr 12, 2012 at 7:25pm

Hi
the simplest way to phase-shift is to use the phase inlet (R) of your two phasors, which takes a value between 0. and 1. Set one at 0. the other at 0.5 (180deg). Or use one phasor twice, shifting the second ramp via [+~ 0.5]–>[%~ 1]:

– Pasted Max Patch, click to expand. –

Brendan

edit: pipped

#227149
Apr 12, 2012 at 7:26pm

I see what you mean – that it is just a case of inverting the phase of the sine. I did try put pcos~ 0.5] but it did not resolve the issue – the sine trough still occurs during the triangle peak. I am doing this right?

#227150
Apr 12, 2012 at 7:46pm

Sorry I didn’t see the rest of this message. Thanks so much for the help.

I just added [*~ -3 to invert the phase of the triangle wave so that it’s peak matched the sine’s.

#227151
Apr 12, 2012 at 8:03pm

[*~ -3] would require additional scaling to match the output of your phasor/cos pair; surely you meant [*~ -1] which would work. There are a number of ways to do this:

– Pasted Max Patch, click to expand. –

Brendan

also look here, might be of interest if you’re building LFO’s:

http://cycling74.com/2008/07/15/lfo-tutorial-1-the-zen-of-the-silent-patch/

#227152
Apr 12, 2012 at 10:25pm

They look like good tutorials Brendan (I’m gonna have a proper read through all those LFO tutorials this weekend, so thank you), and gave me the hint that you could scrap the triangle object and just do it like this,

– Pasted Max Patch, click to expand. –
#227153

You must be logged in to reply to this topic.