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 » Arduino
Samplerate and Bitdepht of CV Generators
Post new topic   Reply to topic
Page 1 of 1 [9 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
JuliusB



Joined: Jan 25, 2020
Posts: 2
Location: Berlin

PostPosted: Sat Jan 25, 2020 2:54 pm    Post subject: Samplerate and Bitdepht of CV Generators Reply with quote  Mark this post and the followings unread

Hi,
im pretty new to digital stuff and electronics in general,
but i want to do some basic eurorack modules for cvgeneration, like envelope generator, lfos, sequencers, with microcontrollers, arduino or teensy.
So my question, is there a general Rule of thumb, how much samplerate i should aim for, and what resolution the dacs should have?

thx
Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 23283
Location: The Netherlands, Enschede
Audio files: 257
G2 patch files: 320

PostPosted: Sat Jan 25, 2020 3:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

welcome JuliusB

Depends a bit on what you are going to control .. how it will end up in the mix, how fast the signals are changing ...

Some ideas ...what I've noticed on my softsynth .. when I set the control rate to 44100 / 32 = 1378 samples/second the steps in the control signals can get very audible .. unless the patch gets complex or the control changes are small .. and then it will be not be noticed as much (being masked by the generated audio).

When I run the control rate at 48000 / 4 = 12 ks/s I don't usually notice the steps anymore - but my ears are not so young anymore Laughing

Clavia G2 uses 96000 / 4 = 22 ks/s IIRC - which can still have artifacts when you use those control signals directly as audio )i.e. fast changing control signals).

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
JuliusB



Joined: Jan 25, 2020
Posts: 2
Location: Berlin

PostPosted: Sun Jan 26, 2020 5:25 am    Post subject: Reply with quote  Mark this post and the followings unread

Ok i See thank you
I got some nanos and mcp4725 breakouts laying around I might just try with that a bit, and see how it sounds
Back to top
View user's profile Send private message
ixtern



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

PostPosted: Mon Jan 27, 2020 1:09 am    Post subject: Reply with quote  Mark this post and the followings unread

For pitch control voltage 12-bit resolution is minimum. More is better.
For envelopes controlling volume or filter frequency even 10 bits may do.

Notice that cheap 12-bit DACs like MCP4725, 4821/22, 4921/22 have high nonlinearity resulting in substantial errors and using them for pitch control voltage requires so called "calibration table". If you want example - look at MI CVpal source code which is open source.
Back to top
View user's profile Send private message
cslammy



Joined: Apr 27, 2018
Posts: 201
Location: USA
Audio files: 1

PostPosted: Wed Jul 01, 2020 1:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

JuliusB wrote:
Ok i See thank you
I got some nanos and mcp4725 breakouts laying around I might just try with that a bit, and see how it sounds


I use 4725s and nanos a lot for general CV applications.

A trick I use that I wish I had known earlier: set 2 digital pins to digitalWrite() and set one low and one high. Now use that to power the V+ and GND for the 4725. Use the other 2 adjacent pins to send data to the 4725. Now your nano has a decent "built in" D/A.

_________________
Visit my AUDIODIWHY blog and website
Back to top
View user's profile Send private message Visit poster's website
Electric Druid



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

PostPosted: Wed Jul 22, 2020 2:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

cslammy wrote:
JuliusB wrote:
Ok i See thank you
I got some nanos and mcp4725 breakouts laying around I might just try with that a bit, and see how it sounds


I use 4725s and nanos a lot for general CV applications.

A trick I use that I wish I had known earlier: set 2 digital pins to digitalWrite() and set one low and one high. Now use that to power the V+ and GND for the 4725. Use the other 2 adjacent pins to send data to the 4725. Now your nano has a decent "built in" D/A.


But why power the DAC from two Arduino pins? You've got a supply available, why not use it?

Tom

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



Joined: Nov 20, 2007
Posts: 1970
Location: West Red Spot, Jupiter
Audio files: 222

PostPosted: Wed Jul 22, 2020 2:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

I don't understand powering a DAC from an MPU data pin either. For one thing, the data pin could be noisy. And another pin for ground - more noise.

A regulated voltage from the PSU and the real ground is a much better idea and won't induce "I wonder if my power scheme is causing this weirdness?" thinking.

JMO

_________________
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
cslammy



Joined: Apr 27, 2018
Posts: 201
Location: USA
Audio files: 1

PostPosted: Wed Jul 22, 2020 4:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

Electric Druid wrote:


But why power the DAC from two Arduino pins? You've got a supply available, why not use it?


Sorry, I wasn't clear (at all). This only makes sense when using a breakout board.

most 4725 breakout boards I've seen are laid out to easily do this... eg
https://www.adafruit.com/product/935

For this I think you would lay the board out so SDA is 27, DCL is 28, Vin is 22 and GND is 19 on a nano--the pins should line up.

If it doesn't make sense for your project don't do it, put the 4725 on a breakboard or perf or strip or whatever and wire it the usual way, but for me, when experimenting at the bench/screwing around with parts it's nice to have a 12 bit DAC right there i can use right away. I also think (?) breakout board makers had this in mind when laying out their boards?

_________________
Visit my AUDIODIWHY blog and website

Last edited by cslammy on Thu Jul 23, 2020 8:27 am; edited 9 times in total
Back to top
View user's profile Send private message Visit poster's website
cslammy



Joined: Apr 27, 2018
Posts: 201
Location: USA
Audio files: 1

PostPosted: Wed Jul 22, 2020 4:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

JovianPyx wrote:
I don't understand powering a DAC from an MPU data pin either. For one thing, the data pin could be noisy. And another pin for ground -
JMO


I have not yet had severe issues with noise when using the breakout-on-your- nano scheme, but of course it depends on your application. My applicaitons, like most of my life, are usually not that demanding.

_________________
Visit my AUDIODIWHY blog and website
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic
Page 1 of 1 [9 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 » Arduino
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