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 » Developers' Corner
VCO - handling 1v/oct with a microcontroller?
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [10 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
jonbutler88



Joined: Aug 11, 2019
Posts: 2
Location: UK

PostPosted: Thu Oct 03, 2019 3:27 pm    Post subject: VCO - handling 1v/oct with a microcontroller? Reply with quote  Mark this post and the followings unread

Hi all,

While I'm pretty sure this won't work, I can't find anything that will tell me it won't, so please put me out of my misery!

Basically I've been reading around synth DIY for a few months now with the intention of building a few eurorack modules to go with my non-DIY collection. I'm not keen on kits as I want to get the hang of things like PCB layout (relevant skills for my job / future jobs), so I thought I'd try making a simple VCO from scratch. Of course I now realise that's a somewhat ambitious goal if I want it to track 1v/oct well, and I disappeared into decision paralysis around matching transistors vs finding a dual matched transistor pair IC vs using a V2164, and rather than making fun sounds I've spent too long worrying about accuracy and the joy has gone out of it somewhat...

I still want to make an analog VCO, but I don't really want to have to worry about the thermal properties of transistors and such like. What I really want is to handle the linear to exponential conversion with a simple microcontroller (e.g. something like an attiny), and then use that in place of the typical exponential conversion part of a VCO schematic (e.g. to feed into an OTA as part of the VCO core).

I'm assuming this won't work, because if it did everyone would be doing it I imagine. But I'm curious why.

First post, be gentle Smile
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 4540
Location: Moon Base
Audio files: 633

PostPosted: Thu Oct 03, 2019 5:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

welcome party!

It's possible but there is a limit to the precision you can get depending on the used dac.

Grumble and JovianPyx can probably tell you more about it.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
JovianPyx



Joined: Nov 20, 2007
Posts: 1854
Location: West Red Spot, Jupiter
Audio files: 218

PostPosted: Thu Oct 03, 2019 11:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

What PHOBoS said.

There certainly are microprocessors that could do it - but do it well? I have doubts. There are even microprocessors that have both DAC and ADC, but usually the (cheap ones) have functional but not precise ADC and DAC.

To be honest, I started out using analog circuits to do electronic music, but I too didn't want to mess around with the expo stuff with matched transistors and tempcos. I built two Fatman synths. Those use "linear" instead of "expo" CVs and do not need special attention paid to temperature. However, expo has a clear advantage with modulation especially in a patchable synth.

If I were doing analog today, I'd want proper electronic treatment of expo signals with tempcos and matched transistors. That is the way to get VCOs that have the widest in-tune tracking range.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 1024
Location: Netherlands
Audio files: 27

PostPosted: Thu Oct 03, 2019 11:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

My first few generators use a Direct Digital Synthesizer (AD9833), so it is at crystal stability and can be tuned very precise using a cheap chinese knockoff arduino nano.
I used a small piece of software to calculate the frequency register values from a given frequency, it is slower than using a lookup table but it enables me to modulate the frequency with a control voltage.
The frequency is set by a serial signal (note) derived from the midi input of the synth.
At this moment I turned to analog oscillators based on the AS3340 Memorymoog schematics from Electricdruid.

Sure it is possible to make a lin >> exp converter, but you need very accurate DAC and ADC's with a large input/output range.
I think it's easyer to build one from schematics that float all over the internet (including EM)

_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
AlanP



Joined: Mar 11, 2014
Posts: 624
Location: New Zealand
Audio files: 35

PostPosted: Fri Oct 04, 2019 4:16 am    Post subject: Reply with quote  Mark this post and the followings unread

I'm a simple man. I divide VCOs into two broad categories -- tasty, and precise.

Precise oscillators are largely digital, like the Mutable Instruments Braids oscillator, which uses a STM32 for everything. They can be analog, like Jurgen Haible's Living VCOs, but the cost tends to be higher to get accurate analog than with accurate digital.

Tasty oscillators are ones with funk and personality, like a friend who treats time as something he heard of once and turns up when he feels like, like a cat, but you like him anyway because of his personality.
Back to top
View user's profile Send private message
ixtern



Joined: Jun 25, 2018
Posts: 124
Location: Poland

PostPosted: Fri Oct 04, 2019 7:35 am    Post subject: Reply with quote  Mark this post and the followings unread

I suspect that simple controllers are not fast and accurate enough to make fast exponential conversion (think about frequency modulation to calculate, for example) and if you get controller with enough computing power, usually you can do other modules in software too.
So there is a boundary where using microcontrollers with analog circuits doesn't make sense.

Simple chips like Atmega 328 (or Arduino modules) may be used together with DACs(12 to 16 bits) to make linear control voltages (usually in MIDI to CV modules) to control analog exponential converters and that' all.

Making analog exponential converter is not a complicated thing - two transistors (monolithic pair, discrete or something between - two dies in one case) drived by two OpAmps and tempco somewhere.

There are still available old good CA3046, or double transistors (two dies in one case) like BC847DS or even paired 2N3904.

And there are some good tutorials about building VCOs.
The best for me was xonik's one:
https://xonik.github.io/theory/vco/expo_converter_1.html
https://xonik.github.io/theory/vco/expo_converter_2.html
Back to top
View user's profile Send private message
jonbutler88



Joined: Aug 11, 2019
Posts: 2
Location: UK

PostPosted: Fri Oct 04, 2019 2:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

Makes sense, I hadn't run the numbers on how much precision a 14-bit ADC might get me (for example), but I just assumed it would be "enough". Comforting to know I'm not the only one that doesn't want to struggle with this though, and it sounds like perhaps a dual matched transistor pair and a tempco will be sufficient.

I guess I'll just push ahead and build something anyway, if it doesn't track at least it will have personality Smile
Back to top
View user's profile Send private message
ixtern



Joined: Jun 25, 2018
Posts: 124
Location: Poland

PostPosted: Sat Oct 05, 2019 11:08 am    Post subject: Reply with quote  Mark this post and the followings unread

jonbutler88 wrote:
Makes sense, I hadn't run the numbers on how much precision a 14-bit ADC might get me (for example), but I just assumed it would be "enough". Comforting to know I'm not the only one that doesn't want to struggle with this though, and it sounds like perhaps a dual matched transistor pair and a tempco will be sufficient.

I guess I'll just push ahead and build something anyway, if it doesn't track at least it will have personality Smile


The problem is not with tracking. One transistor is enough for good tracking, matched transistor pair and tempco are for temperature stability only.
Without it simple breathing at the expo transistor may change pitch significantly.
Back to top
View user's profile Send private message
Electric Druid



Joined: Mar 13, 2012
Posts: 22
Location: UK

PostPosted: Wed Oct 09, 2019 2:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

It't not impossible to do Lin<->Exp conversion on a small cheap microprocessor. I've done it on a 16F PIC. The trick is that it's the same for every octave, but shifted one bit. So you can use an accurate look up table that covers an octave, and then do the right number of shifts. It's quick and it doesn't need any maths.
Which is handy, because we don't even have a multiply instruction.

Also worth pointing out that if you've got a microprocessor in your VCO, you can feed the VCO output back to the processor and add an autotune routine. So maybe you don't need that great a DAC after all - just compensate for it. It does however need enough *resolution* that you can't hear any little steps. It's only *linearity* that it doesn't need.

The worst problem (imho) is the ADC accuracy reading the incoming CV. If you're decoding a MIDI stream, you're ok because you've got fixed notes, and then you add a known pitch bend - all relatively simple. But an external CV? It could have *any* crazy modulation applied to it. It could even be the output from another oscillator as someone tries to do FM on your oscillator. Aliasing as the incoming frequency goes above your ADC sampling rate is going to cause all kinds of chaos, so you have to limit stuff like that.

It's certainly not a simple problem, but the linear-exponential conversion is the simplest bit, ironically.

_________________
Electric Druid Synth and Pedal DIY website
Back to top
View user's profile Send private message
ixtern



Joined: Jun 25, 2018
Posts: 124
Location: Poland

PostPosted: Wed Oct 09, 2019 10:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ah, lookup table, how could I forgot this simple solution which I've used with Arduino frequently. Although I've went further and even for modulation steps I've used lookup tables - one table for one modulation step. Crazy but worked. Not for expo conversion but for other solutions.
Thanks for the tips.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [10 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 » Developers' Corner
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
e-m mkii

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