Getting two sine wave oscillators to stay phase locked

Andrew Lauzon's icon

Greetings o' forum of eternal wisdom...

I have two metro objects triggering two sine wave beeps via discrete cycle~ objects simultaneously, however the sine waves both start at various different places in the cycle, making for an inconsistent phase relationship from note to note. I believe what I'm looking for here is basically oscillator sync, so that they both begin at the same point (0 degrees) and are thus phase-locked. They're an octave apart, but I don't think that should matter. Also, (probably not relevant): one of the pairs is set to trigger slightly out of sync [between 5-20 ms] every 2 bars.

They're encapsulated in this poly~ ez-synth object I pulled out of the documentation, which is pasted below (comments came with it). You'll see I made an attempt by adding the phasor~ 4n in hopes that this would restart the cycle on every quarter note, but obviously I'm missing something.

Max Patch
Copy patch and select New From Clipboard in Max.

Incidentally, I've also tried to figure out how to alter the attack time on this sound so it has a slightly slower onset - but none of the numbers in "zl.reg" seem to affect it, and this is supposedly the envelope? Thought I'd mention it - although I will probably address this in a new post.

Screenshot-2016-02-09-21.48.11.png
png
leafcutter's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hopefully this might help.

Andrew Lauzon's icon

Thanks Leafcutter - this is helpful, although admittedly mostly over my head.

I did manage to get the oscillators to synch by changing the message to "phasor~ 4n @lock 1" however they are starting at varying points in the cycle, which produces a click sometimes, and not others. I need the cycles to start from the zero crossing every time so there's no click. Tried sending "int 0.5" message to the right inlet, triggered by a bang, triggered by the note message, however this didn't seem to have any effect at all.

Max Patch
Copy patch and select New From Clipboard in Max.

I'd be *extremely* grateful to anyone who can help me figure this out - it's for my thesis experiment and I need to start doing pilot trials this afternoon!!!

Roman Thilenius's icon

that it what should happen when you drive a cycle by a phasor: they will always start at the beginning.