Login / Register  0 items | $0.00New @ What is KVR? Submit News Advertise

PolyBLEP Hard Sync Sawtooth Oscillator

DSP, Plug-in and Host development discussion.

Moderator: Moderators (Main)

Dreamwalk
KVRer
 
3 posts since 23 Jun, 2014

Postby Dreamwalk; Mon Jun 23, 2014 3:57 am PolyBLEP Hard Sync Sawtooth Oscillator

Any idea how to make a PolyBLEP hard-sync sawtooth oscillator?
Osc1_phase< osc1_increment -> osc2_phase=0 ? Bandlimited?
User avatar
Urs
u-he
 
18128 posts since 7 Aug, 2002, from Berlin

Postby Urs; Mon Jun 23, 2014 8:22 am Re: PolyBLEP Hard Sync Sawtooth Oscillator

First you have to find where inbetween the last sample and the new sample Osc 1 has wrapped:

if( Osc1_phase < osc1_increment )
momentOfWrap = (1 - Osc1_phase / osc1_increment );

then you have to place the bandlimited step at momentOfWrap into the new sample of Osc2 :)
Dreamwalk
KVRer
 
3 posts since 23 Jun, 2014

Postby Dreamwalk; Mon Jun 23, 2014 8:27 am Re: PolyBLEP Hard Sync Sawtooth Oscillator

Thanks man! I`ll try it today and post result.. But i believe you, that is that...
Have you tried? Hmm. Moment of wrap of osc1 or osc2?
User avatar
Urs
u-he
 
18128 posts since 7 Aug, 2002, from Berlin

Postby Urs; Mon Jun 23, 2014 8:54 am Re: PolyBLEP Hard Sync Sawtooth Oscillator

Dreamwalk wrote:Thanks man! I`ll try it today and post result.. But i believe you, that is that...
Have you tried? Hmm. Moment of wrap of osc1 or osc2?

It'll be moment of wrap for both of them.
2DaT
KVRist
 
289 posts since 21 Jun, 2013

Postby 2DaT; Mon Jun 23, 2014 9:30 am Re: PolyBLEP Hard Sync Sawtooth Oscillator

Dreamwalk wrote:Any idea how to make a PolyBLEP hard-sync sawtooth oscillator?
Osc1_phase< osc1_increment -> osc2_phase=0 ? Bandlimited?

Of course not.

For phase [0,1]:
Osc2Phase = Osc1Phase * Osc2Delta,
where delta is (Pitch / SampleRate)

But this needed to be done after transition placement.

There is a trickery in hard sync when placing a transition and phase wrap at the same sample. Sometimes you want to place phase wrap BLEP before hardsync; sometimes hard sync BLEP occurs earlier , resetting phase of the original. Improper implementation leads to aliasing when second osc is close to multiple of first osc.
Dreamwalk
KVRer
 
3 posts since 23 Jun, 2014

Postby Dreamwalk; Mon Jun 23, 2014 2:29 pm Re: PolyBLEP Hard Sync Sawtooth Oscillator

I try to implement your ideas, but without any success ( probably doing something wrong).
But I found:
phase2 = phase1 * phasor2 / phasor1;
(viewtopic.php?t=328129)

and works very well...
You do not have the required permissions to view the files attached to this post.
2DaT
KVRist
 
289 posts since 21 Jun, 2013

Postby 2DaT; Mon Jun 23, 2014 10:11 pm Re: PolyBLEP Hard Sync Sawtooth Oscillator

Dreamwalk wrote:I try to implement your ideas, but without any success ( probably doing something wrong).
But I found:
phase2 = phase1 * phasor2 / phasor1;

Yes, i made a mistake (while looking in the code) :dog:. This one is correct.
lppier
KVRer
 
6 posts since 1 Nov, 2007

Postby lppier; Mon May 18, 2015 6:19 pm Re: PolyBLEP Hard Sync Sawtooth Oscillator

2DaT wrote:
There is a trickery in hard sync when placing a transition and phase wrap at the same sample. Sometimes you want to place phase wrap BLEP before hardsync; sometimes hard sync BLEP occurs earlier , resetting phase of the original. Improper implementation leads to aliasing when second osc is close to multiple of first osc.


Hi 2Dat,

I realised this. But what is this trickery you speak of? Could you share? Thanks.
2DaT
KVRist
 
289 posts since 21 Jun, 2013

Postby 2DaT; Mon May 18, 2015 11:33 pm Re: PolyBLEP Hard Sync Sawtooth Oscillator

lppier wrote:
Hi 2Dat,

I realised this. But what is this trickery you speak of? Could you share? Thanks.

Definetly not a trickery, but some non-straightforward additions. There are plenty of hard-sync topics on KVR (even with code samples).
Here is nice HS explanation by mystran. Can't do better :tu:

Moderator: Moderators (Main)

Return to DSP and Plug-in Development