electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Sync and digital oscillators
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
bazrush



Joined: Oct 20, 2012
Posts: 2
Location: Woking UK

PostPosted: Tue Oct 23, 2012 2:40 am    Post subject: Sync and digital oscillators
Subject description: Interfacing to the modular world
Reply with quote  Mark this post and the followings unread

First post here I think. So hello Smile

I've built an FM oscillator using a dsPic33. Before you ask it sounds fabulous, thank you Wink

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
View user's profile Send private message
syntherjack



Joined: Oct 29, 2012
Posts: 21
Location: Poland, Poznan

PostPosted: Tue Nov 20, 2012 3:52 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
bazrush



Joined: Oct 20, 2012
Posts: 2
Location: Woking UK

PostPosted: Wed Nov 21, 2012 1:33 am    Post subject: Reply with quote  Mark this post and the followings unread

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 Smile

(Yeah -is a bit dead isn't it!)
Back to top
View user's profile Send private message
syntherjack



Joined: Oct 29, 2012
Posts: 21
Location: Poland, Poznan

PostPosted: Sun Nov 25, 2012 3:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
AmbiphonicDSP

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use