Trying to build a simple quadrature oscillator


#1

Hi folks,

Have been spending some quality time with the brand new Axoloti and I have come across something I thought it would be easier. Clearly, I still haven't got the hang of programming in this environment.

Is there a way to do this? (a pd patch using wrap~ to create a quadrature oscillator). I have tried with Axoloti's wrap but it is obviously doing something else smile

This is what I'm trying to achieve [image attached]:

Thanks!


#3

how about the phase inlet of osc/sine?


#4

osc/phasor into math/sin and math/cos


#5

I already tried this, but the results weren't what I expected. What am I doing wrong?

Thanks


#6

Hi,

I thought of that, but I would need a way to have always a certain relationship between the two signals, and by only using the phase inlets it could be that the two oscillators do not necessarily start in phase.

Also, with a phasor and then applying the sin and cos functions for the two outputs (if it worked) I could obtain multiple waveforms with a fixed 90ยบ phase difference by using some waveshaping and math functions.

Regards,

Pere


#7

hmmm the fix is inserting conv/unipolar2bipolar between phasor and sin,cos.
But this may highlights a semantic problem...

So phasor generates "ramps" from 0 to 64 units. The sin/cos objects take 64 units as 180 degrees rather than 360 degrees.

I believe in Max/PD phasor outputs in 0..1 range and the cos object takes 1 for 360 degrees.


#8

Hi, thanks for your answer.

Unfortunately, as you say, this solution still has some problem.

I have checked with a hardware scope and the phase relationship changes with frequency. (?)

Thanks again,

Pere


#9

That's because of execution order.
Often it does not matter so much, but here it is important.
Objects are evaluated in reading order, left to right then top to bottom. A connection from an outlet of an object to an inlet of an object earlier in execution order inserts a delay of one buffer.
So arrange your objects so that connections follow execution order and it will be fine.


#10

Thank you very much indeed!

This small exercise has been a master class in itself!

gift


#11

I have changed the scaling of math/sin and math/cos to have 64 units correspond to 360 degrees. So from release 1.0.3 on, which is online now, the unipolar2bipolar conversion after phasor needs to be removed.