Keeping oscillators in sync in a two oscillator synthesizer

Aug 1, 2007 at 2:24am

Keeping oscillators in sync in a two oscillator synthesizer

Hi there,

I am building a simple two oscillator synthesizer and I am running into problems with the two oscillators getting out of sync with each other. Ideally, when both oscillators are running at the same frequency, I would like for the waveforms they output to always match up. What happens right now is, if I start up the oscillators at the same time and with the same frequency, then they will run in sync with each other (exactly how I want them to). But, if I then change the frequency of one of the oscillators (such as by using an LFO to modulate the pitch) and then change it back (so that they have the same frequency again), then the two oscillators become out of sync. This creates a significantly different sound then if the two oscillators are in sync. Is this possible to fix?

The patch pasted below illustrates the problem.

I searched through the forums and the closest references I’ve found to a solution to this is to use a “master phasor” to keep the oscillators in sync. I’ve tried doing this but I have a long list of issues that come up with this solution, so right now I want to confirm whether this is the “right” solution to the problem or if there are alternatives. (Since the goal of this project is to emulate basic common synth functionality, in this case the “right solution” would be whatever solution most other software/hardware synths use).

Thanks in advance for any insight you might have!

-Roben

#P window setfont “Sans Serif” 9.;
#P window linecount 5;
#P comment 103 509 100 196617 Note that now the two oscillators are out of sync (the waveforms no longer match up exactly).;
#P window linecount 4;
#P comment 103 359 100 196617 3. Now click me to set one of the oscillators to run at a frequency of 300.;
#P window linecount 1;
#P message 218 373 26 196617 300;
#P user scope~ 404 363 827 492 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P user scope~ 404 228 827 357 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P user ezdac~ 211 28 255 61 0;
#P message 219 121 26 196617 220;
#P newex 404 186 40 196617 tri~;
#P newex 328 186 40 196617 tri~;
#P window linecount 2;
#P comment 101 31 100 196617 1. First click me to turn on DSP;
#P window linecount 4;
#P comment 101 113 100 196617 2. Then click me to set both oscillators to a frequency of 220.;
#P window linecount 9;
#P comment 101 164 100 196617 Observe that when both oscillators are started up at the same frequency they are in sync (i.e. in the two scopes to the right , the waveforms match up exactly).;
#P window linecount 8;
#P comment 103 410 100 196617 After clicking the 300 to change the frequency of one the oscillators , click the 220 above again to set both oscillators back to the same frequency.;
#P connect 4 0 9 0;
#P connect 5 0 8 0;
#P connect 6 0 5 0;
#P connect 10 0 4 0;
#P connect 6 0 4 0;
#P window clipboard copycount 13;

#33110
Aug 1, 2007 at 3:44am

Roben Kleene skrev:
> Hi there,
>
> I am building a simple two oscillator synthesizer and I am running into problems with the two oscillators getting out of sync with each other. [...] (Since the goal of this project is to emulate basic common synth functionality, in this case the “right solution” would be whatever solution most other software/hardware synths use).
Hi Roben,
well, oscillators aren’t typically synced like this – and moreover it’s
not a typical operation to have two oscillators at the exact same
settings – since 1 is enough for this.
The general idea of using multiple oscillators is to have multiple settings.

If you particularly like the sound of oscillators phasing I would simply
add a static phaser effect to the synth and be done with.

Andreas.

#109754
Aug 1, 2007 at 4:38am

Hi Andreas,

Thanks for the response.

When you say “oscillators aren’t typically synced like this” — Do you mean (for example) that in most dual oscillator software synthesizers that the oscillators aren’t synced? I ask, since this is the setup I am trying to replicate.

I know that in general, the idea is for multiple oscillators to have multiple settings. But with most dual oscillator synthesizers you can set both oscillators to have same settings, so I would like my synthesizer to behave “correctly” in those circumstances. There are reasons you’d want to do this, for example if you wanted to apply further processing to only one of the oscillators later.

Thanks again for the input!

-Roben

#109755
Aug 1, 2007 at 7:31am

#109756
Aug 1, 2007 at 7:46am

#109757
Aug 1, 2007 at 11:47am

Look into rate~ ?

On Jul 31, 2007, at 11:44 PM, Andreas Wetterberg wrote:

> Roben Kleene skrev:
>> Hi there,
>>
>> I am building a simple two oscillator synthesizer and I am running
>> into problems with the two oscillators getting out of sync with
>> each other. [...] (Since the goal of this project is to emulate
>> basic common synth functionality, in this case the “right
>> solution” would be whatever solution most other software/hardware
>> synths use).
> Hi Roben,
> well, oscillators aren’t typically synced like this – and moreover
> it’s not a typical operation to have two oscillators at the exact
> same settings – since 1 is enough for this.
> The general idea of using multiple oscillators is to have multiple
> settings.
>
> If you particularly like the sound of oscillators phasing I would
> simply add a static phaser effect to the synth and be done with.
>
> Andreas.

#109758
Aug 1, 2007 at 12:50pm

you might find the oscsync-advanced.pat patch of interest. its in the oscsync-folder in the examples. there is a method for syncing oscillators there.

pelado

#109759
Aug 1, 2007 at 2:23pm

Roben Kleene skrev:
> Hi Andreas,
>
> Thanks for the response.
>
> When you say “oscillators aren’t typically synced like this” — Do you mean (for example) that in most dual oscillator software synthesizers that the oscillators aren’t synced? I ask, since this is the setup I am trying to replicate.
>
You’re right – as others have pointed out, syncing of oscillators
provides quite a different range of sounds.
> I know that in general, the idea is for multiple oscillators to have multiple settings. But with most dual oscillator synthesizers you can set both oscillators to have same settings, so I would like my synthesizer to behave “correctly” in those circumstances. There are reasons you’d want to do this, for example if you wanted to apply further processing to only one of the oscillators later.
>
I can definitely see the rationale behind wanting to do this, but two
identical oscillators being processed differently doesn’t do anything a
mixing matrix can’t handle – simply split the signal and send it
different places.

Andreas.

#109760
Aug 2, 2007 at 4:31am

Hi Everyone,

Thanks for all the suggestions.

I didn’t realize there was an example patch that showed a syncing implementation, that will be very helpful.

I am still not positive that this is the right solution. I realize now that I think that I could have better described the problem as “out of phase”, instead of “out of sync”. Syncing is really what Patrick Delges describe in his comment above.

I think that there is a good chance that the solution will be the same though, since two oscillators that are synced at the same frequency must also be “in phase” as well. This is the potential solution I am going to explore for now anyway.

Thanks again for all the comments!

-Roben

#109761
Aug 2, 2007 at 6:27am

This thread got me wondering…

When using “symmetric” oscillators (tri~, rect~, sine waves) in a poly~, if two voices are set to the same frequency and happen to be 180 degrees out of phase, the signal would cancel out (or at least significantly attenuate since exact 180 degree phase difference seems unlikely). In practice this hasn’t been a problem for me, but I am wondering if other people compensate for this in poly~ patches?

-Adam

#109762
Aug 2, 2007 at 7:32am

Hi Adam,

After doing some more research, I believe that what you are describing is exactly the problem I was experiencing. When the waveforms are very slightly out of phase, portions of two waveforms cancel each other out which makes a significantly different sound then if the two waveforms are exactly in phase.

On a final note, I tested out a few synthesizers and I’ve no concluded that (at least in some cases) the oscillators *are not* kept in phase. In fact, with 2 of the 3 synthesizers I tested, you could get the oscillators out of phase by simply turning off the second oscillator playing a note, and then turning it back on. It seems that every time you do this you get a different sound, even though all the settings on the synthesizer are identical.

(In case anyone is wondering, the synthesizers I tested were SCB Synth, Reason’s Subtracter, and Automat. The SCB Synth is the only one where the oscillators stayed in phase for the above test. This doesn’t necessarily mean that it keeps the oscillators in phase, only that *when you play a note it always starts the oscillators in phase*).

Since my goal for this project is to create a “standard” dual oscillator synthesizer, I am considering this problem sorted out. The information from this thread will still be coming in very handy, my next task is to implement a master oscillator/slave oscillator style sync feature.

Thanks again!

-Roben

#109763
Aug 6, 2007 at 10:06am

Roben Kleene schrieb:
> Since my goal for this project is to create a “standard” dual
> oscillator synthesizer, I am considering this problem sorted out.

I was always wondering while reading the thread – why does he want the
less interesting sound? If you get two oscillators synced but out of
phase, that’s what usually makes synced oscillators interesting, because
they sound different every time… Elsewise any non synced (detuned)
oscillators sound much fatter than a synced one. Two synced oscillators
are actually exactly the same as a single oscillator with a bit
different waveform…

Maybe the concept of creating anything “standard” is questionable in
general?… ;-)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#109764
Aug 6, 2007 at 8:36pm

Quote: Stefan Tiedje wrote on Mon, 06 August 2007 03:06
—————————————————-
> I was always wondering while reading the thread – why does he want the
> less interesting sound? … non synced (detuned)
> oscillators sound much fatter than a synced one.

In my opinion this is generally desirable.

To answer my previous question in this thread about compensating for interference between oscillators at the same frequency, I’m now thinking in poly~ it’s probably a good idea to add a small random amount to any incoming frequency. This way, if two notes come in at the same frequency you will get a fat detuned sound and minimal chance for signal cancellation.

I just don’t understand why in my simple oscillator-based poly~ patches I never noticed the signal getting really quiet when hitting the same note twice in a row… could using an amplitude envelope have something to do with it?

-Adam

#109765
Aug 8, 2007 at 5:13am

Adam Murray schrieb:
> I just don’t understand why in my simple oscillator-based poly~
> patches I never noticed the signal getting really quiet when hitting
> the same note twice in a row… could using an amplitude envelope
> have something to do with it?

If you used a keyboard to hit them twice in a row, you switched one of
before the other is switched on. This results in an overlap of
envelopes, wich has only a very little chance to cancel out and that
only for a fraction of a fraction of a second…
If you overlap two notes in a sequencer, and take care that they have
exactly the same amplitude, you will hear the canceling…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#109766

You must be logged in to reply to this topic.