On 26/02/2014, Risto Holopainen <rist...@hotmail.com> wrote: > When it comes to programming hard sync, I would use oversampling. I'm not > saying that you should, I'm just lazy enough to do it the easy way.
You need to oversample a *lot* to chase away aliasing, though. The Alesis Fusion - and its descendant, the M-Audio Venom, does the same - does hard sync naively, by resetting the slave oscillator's phase to 0 every time the master crosses from negative to positive... only it doesn't oversample at all and does the comparison on sample boundaries, with the result that hard sync sounds *lousy* on the Fusion. I've done a couple of experiments which appear to suggest that the aliasing caused by this is *far* worse than that caused by not bandlimiting the actual discontinuity - for example, by using a "hidden master oscillator" (actually a fractional multiplier of the phase counter) to read from a wavetable corrected only to the frequency of the slave. In fact, you can bandlimit the discontinuity as much as you please, and it'll *still* sound awful, because you're essentially randomising the pitch of the oscillator. Worse, even if your slave is running at exactly the same frequency as its master, you'll STILL get random glitches in the sound as its phase is reset to exactly 0 when the master's phase is some tiny fraction greater than 0. And the sad thing is, there's no justification for it. In the Venom, for example, you're always syncing to oscillator 1 - which means that you know the frequency ratio between the two oscillators. Moreover, you're syncing against a known waveform - which means you also know when exactly that waveform will cross from negative to positive. Therefore, when your slave detects that it did, rather than resetting itself to 0, it can reset itself to the difference between the actual phase of the master and the phase at which the master would have crossed 0, multiplied by the slave:master frequency ratio. For sawtooth and pulse waves, of course, that's particularly simple - there's only one zero-crossing per cycle, and if you make sure that zero-crossing is always at the point where the phase is 0, you can use the carry of the master's phase accumulator to detect sync, then multiply the master's current phase by the slave:master ratio and set the slave's phase to that. And lo! - no more random-frequency-wibbling alias. *Then* you can start worrying about how to bandlimit the slave's phase. Sorry for going on at length about something that is surely obvious to everyone else here (I know nowt about owt) but it really bugs me - and clearly it wasn't obvious to Alesis when they designed the Fusion. And in fairness, the Fusion could sync to itss noise generator or an arbitrary signal coming into the audio inputs (can any other VA do this? Nord Modular, perhaps?) at which point the naive approach is the best you can do without either intepolating between input samples (which needs division) or upping the input sample rate - but even so, 99% of the time the Fusion is still syncing to another oscillator whose frequency and waveform it necessarily knows. And there's just no excuse for the Venom. *spent and tremulous, returns to hiding under desk* -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://music.columbia.edu/cmc/music-dsp http://music.columbia.edu/mailman/listinfo/music-dsp