| Author |
Message |
bazrush
Joined: Oct 20, 2012 Posts: 2 Location: Woking UK
|
Posted: Tue Oct 23, 2012 2:40 am Post subject:
Sync and digital oscillators Subject description: Interfacing to the modular world |
 |
|
First post here I think. So hello
I've built an FM oscillator using a dsPic33. Before you ask it sounds fabulous, thank you
I'd love to implement an oscillator hard sync interface that works. Mostly so I can have consistent sounding bass notes, restarting the oscillator at the start of the note, rather than resetting the oscillator a zillion times a second.
However, I think I'm onto a slightly difficult problem. I get a nasty click when it resets. I've got code which processes the audio in 24 word chunks, shoving the next 24 words into a DMA buffer.
When i get the trigger I restart the waveform, but there are still a bunch of samples left in the buffer. So the VCA on the eurorack opens, squirting through some of the old samples before the reset.
I'm supposing that I could fix this by doing some code optimisation, removing the buffer entirely and pushing samples to the DAC one at a time, which should drop the latency on the trigger input down to the single sample level.
That's a bit of a pain in the arse. Any other solutions?
cheers!!! J. |
|
|
Back to top
|
|
 |
syntherjack

Joined: Oct 29, 2012 Posts: 18 Location: Poland, Poznan
|
Posted: Tue Nov 20, 2012 3:52 pm Post subject:
|
 |
|
Wow, topics in uC & PL are quite dead :/
You probably figured out how to make it, I wonder, what have you done.
If not, i think you can just silent output while "old" DMA data is pushed out. I don't know your uC, i've done something similar on ATMega using external resistor shorting output to ground when necessary.
Jack |
|
|
Back to top
|
|
 |
bazrush
Joined: Oct 20, 2012 Posts: 2 Location: Woking UK
|
Posted: Wed Nov 21, 2012 1:33 am Post subject:
|
 |
|
That's a really good thought.
However - I've re-written the code to get rid of the DMA transfer. The code now pokes values into the DAC without software buffering. That's made the output a lot nicer - there's at least no jittering backwards and forwards on the timing. I've halved the output latency too as a result.
It looks like there's a fixed delay in a delta-sigma based DAC though and wih the hardware buffer (140uS total). I'm going to move to a 12-bit R2R version which I think will solve the problem and allow my to produce a sample accurate no-latency oscillator. I'll let you know
(Yeah -is a bit dead isn't it!) |
|
|
Back to top
|
|
 |
syntherjack

Joined: Oct 29, 2012 Posts: 18 Location: Poland, Poznan
|
Posted: Sun Nov 25, 2012 3:38 pm Post subject:
|
 |
|
Instead of R2R you can also use PWM + LP filter (less uC pin wasted, quite easy to code). But I prefer R2R - with all PWM projects I hear some high frequency distortions :/
Jack |
|
|
Back to top
|
|
 |
|