SH-101 pwm

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

aciddose wrote:you cant emulate the effect via modulation of frequency, pw, or by adding modulation to an integrator in the oscillator. you must adjust the reset point of the waveform _once_ per cycle based upon the modulation signal which is processed _every sample_. the result is that different frequencies beat against the modulation differently, and the over-all frequency is modulated, yet the ramp shape remains unmodified.
Yeah it sound like shite. I should have realized this before I even tried :oops: After spending a week or so working on this one of the main things you have to get right is the fractional position of the bleps. Or else you get frequency jitter which just sounds shitty. So adding noise to the main acumulator is just adding jitter, which sounds shite.

Post

aciddose wrote:you cant emulate the effect via modulation of frequency, pw, or by adding modulation to an integrator in the oscillator. you must adjust the reset point of the waveform _once_ per cycle based upon the modulation signal which is processed _every sample_. the result is that different frequencies beat against the modulation differently, and the over-all frequency is modulated, yet the ramp shape remains unmodified.
That looks a whole lot more complicated than my oscillator code that does more or less what you describe. I'm not sure why you think it would be necessary to process modulations for each sample though; you do need to solve the reset point based on whatever the frequency is during the reset (though at least for sub-audio modulations, I find it sufficient to assume constant frequency for the duration of a single sample, which makes finding the reset point a trivial matter of solving the root for a 1st order polynomial) but other than that you could have a separate control rate if you wanted.

Actually one can even get away without adjusting the reset point and still get the same effect, but I guess I'm going to leave that as an exercise for the reader. :roll:
the up and down ramps will be shaped very differently, which is in combination with the reset point modulation the cause of a perfectly tweaked "square" having additional even harmonics in an analog oscillator / waveshaper.
So what you are trying to say here, is that one should use two different BLEPs (say with slightly different cutoffs, or with transitions sampled both directions if trying to replicate the spectra of a specific analog oscillator) rather than just one? That's an interesting idea, since it probably translates to more even harmonics in high frequencies and mostly odd harmonics in the low end. I guess I'm going to try that one. Thanks for the tip. :)

Post

well, it will make a difference, but only if you have significantly different slopes. the only circuit i know of which is common with this effect is the tb-303 pulse waveshaper. it not only has this asymmetric slewing, but it also drains current from a 'battery' capacitor so that lower frequencies start to get half of a ramp on the positive side of the waveform.

the reason you'd want to process the reset point every sample would be to get the correct frequency balance for your brown/pink noise. of course you could use a much more complicated RNG to produce the same effect only once per sample. note though that all oscillators should share a common modulation source, so the only practical way to produce this effect exactly as it should be is to process the modulation signal every sample.

setting the reset point is simple: after you have reset, copy the value from the modulation signal. if you have multiple oscillators/voices you will need to set it every sample as well, though.

this isnt complex, this is a matter of a couple integrators and a waveshaper processed globally for your synth, every sample. this is also how you should be processing noise: create a new value every sample and store it to be accessed by all voices. otherwise you will get unrealistic noise effects.

of course, it doesnt matter if you're not trying to be accurate to the electronic version of a subtractive synthesizer, however this is one of those cases where the electronic behaviour conveniently happens to be the best sounding behaviour.

Post

aciddose wrote: of course you could use a much more complicated RNG to produce the same effect only once per sample. note though that all oscillators should share a common modulation source, so the only practical way to produce this effect exactly as it should be is to process the modulation signal every sample.
Would you care to explain why do you think all oscillators should share a common modulation source? I guess you are trying to model long term tuning instability due to reference voltage drift, but to me that seems kinda pointless, and without knowing any better, I would guess that in the short term, thermal effects would dominate essentially meaning that for all practical purposes all oscillators would "see different noise."

I'm quite sure you will disagree, but I would be interested in hearing why?

Post

this has absolutely nothing to do with drift.

coincidentally, what is known as "thermal drift" is drift which forms a negative feedback oscillation. higher frequency = more current = increased vbe = reduced frequency = lower current = reduced temperature = decreased vbe.

this is just one potential system with such a feedback loop. there is of course the capacitor as well which is likely very temperature sensitive and will obey a similar law.

you can satisfy easily with brown/black noise modulating frequency for this, however it is a completely different effect.

Post

aciddose wrote:this has absolutely nothing to do with drift.
So what does it have to do then? When I said that I believe thermal effects would dominate, I was mainly referring to thermal noise (or shot noise if you prefer that term) thought I guess interferences and parasitic effects could have equal or greater effect.

Anyway, my main point is, I'm not going to believe that if you manage to get two oscillators reset within a 1/44100 second time window (or even less if you will), that they will actually reset at the exact same voltage, which is what I take you are trying to imply with the idea that there should be one global modulation channel, rather than just separate noise sources for different oscillators.

Ignoring that, I might also want to hear that in case we model such a global modulation channel, what might be the perceptually significant result that you believe is important? I can't understand what exactly is that you are after, and I'm honestly curious. Could you please care to explain?

Post

Aciddose, thanks for the info on the oscillators. I've not even looked at an oscillator circuit so far to begin modeling. I did check out the main output from the sh-101 and the mains hum was way bigger than the pink/brown noise, so that's probably due to a shitty power supply and perhaps old caps in the sh-101. I've also added a little bit of gaussian white noise to the whole thing too.

I am currently using the same signal for all osc for the mains buzz + pink + brown, but adding a little bit of gaussian white noise to each voice as well. I'll reduce the mains buzz and see if it sounds better and generate some longer examples.

Post

Thanks as well aciddose for reminding me I need to add noise to my reset value and comparison value, which I wasn't doing yet, I was only adding noise to the pitch increment, and pwm comparison value.

Post

Right I've got new examples up in the same place. This time I strictly alternate between the two, I was randomizing the which one was first last time. Also I've removed the hum (as much as I could) and held all the notes for much longer.

http://www.vellocet.com/dsp/sh101

I added noise to the osc phase and the osc phase increment, but didn't mess with the comparison signal level or reset level. I also added noise to the pwm control signal. I think the results are about as good as they will get by experimenting and further improvements will require proper analysis.

I was am using linearly interpolated sub sample intersection points and adding band limited corrective grains to smooth discontinuities. For the pwm I compare the phase to the pwm level and jump low if the phase is below the pwm level, and jump high if it's above, this can happen multiple times per sample if sync is involved.

Post

andy_FX wrote:Right I've got new examples up in the same place. This time I strictly alternate between the two, I was randomizing the which one was first last time. Also I've removed the hum (as much as I could) and held all the notes for much longer.
The first samples have way more 'noise' modulation than the second ones. You can very obviously hear the frequency jitter.

Post

nollock wrote:
andy_FX wrote:Right I've got new examples up in the same place. This time I strictly alternate between the two, I was randomizing the which one was first last time. Also I've removed the hum (as much as I could) and held all the notes for much longer.
The first samples have way more 'noise' modulation than the second ones. You can very obviously hear the frequency jitter.
Well spotted, I have since fixed that and reduced the noise added to the oscillator increment to reduce this :)

Post

You guys have good ears, thanks for the feedback :)

Post

i don't think i have too good hearing, but for me its also very obvious. it is most prominent on the last lowest note. you can hear much "smearing" at the high end

Post

the amount of real noise->frequency effect in most oscillators will be extremely small, perhaps below the ability of a person to hear. the most important effect is that reset point modulation which will contribute to the noise floor in the spectrograph, but will not directly contribute to any random signal passing through the waveform shape. i think it's important to avoid any fm of the oscillator which will give a grainy/noise timbre that we do not want.

listening to the pulse demo, it sounds like you've got the modulation almost right, only in the first examples the depth is way too much. the effect is almost exactly matching other than the depth, though. remember that the depth of this effect is going to be at most about 1.3%pp. (the total scale of the modulation going into the reset point should be no more than 1.3% peak-to-peak)

Post

Well I had some time to play around with it again today. And heres where I have determined.

It's definately a bad idea to mess about with the main blep, the accumulator passes zero blep. Best to leave that rock steady and so leave the frequency rock steady, imho. Thats not to say it shouldn't drift, but random noise->freqency is a bad idea imo.

I tried adding some random noise to the pulsewidth, +- 0.4% roughly. First thing i found was the reason accidose advised to sample this random noise once per cycle. If you add a random offset per sample then you can trigger multiple pulsewidth flips on lower frequencys. Where the per sample accumulator step is less than the noise jiggling about on the pulsewidth point.

The next thing I noticed is that it sounded progressively more dirty the lower you go down in pitch. For example...

www.flak.clara.co.uk/PWM1.wav

That's got extra pulsewidth noise to make the effect more obvious.

Also as accidose noted this noisey modulation of the pulsewidth point generates a 'noise floor'. You can see it between the main harmonics. And in that sample you can see that the noise floor increases the lower the notes go in pitch.

If you look at the SH-01 samples Andy posted, the analog oscillator has this noise floor too, but it stays fairly constant across all notes. The effect doesnt change much with frequency.

I know very little about electronics tbh, so this next bit is mostly conjecture rather than informed opinion :P

So that says to me that the random variation in the positioning of the pulsewidth step is constant time. It's not +- X% pulsewdith, its +- X micro seconds.

So perhaps rather than there being error on the pulsewidth control voltage, there is error in the time in which the "comparitor" can react. Or at least the later is the majority effect.

Here's an example..

www.flak.clara.co.uk/PWM2.wav

I tweaked the random variation so that it had roughly the same amount of 'noise floor' as the SH-01 samples Andy posted.

Still i think the highest note sounds a little noisy, cant get it loud enough to tell for sure atm, it's 12:30.

How do you get constant time offset? Well it's actualy very simple, you use the phase acumulator step to scale the random value you add to the pulsewidth.

Here's one with no pulsewwidth variation, for referance.

www.flak.clara.co.uk/PWM3.wav

So I agree with basicly everything accidose said, except I dont think its a fixed amount of pulsewidth variation, i think it's more a fixed amount of time variation. Or put another way the amount of pulsewidth jitter decreases as the frequency of the oscillator decreases.
Last edited by nollock on Thu Feb 28, 2008 12:37 am, edited 1 time in total.

Post Reply

Return to “DSP and Plugin Development”