Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 14 of 14

Thread: Audio Adaptor Board to manipulate cv signal

  1. #1
    Junior Member
    Join Date
    Apr 2015
    Location
    toulouse, france
    Posts
    18

    Audio Adaptor Board to manipulate cv signal

    Hello to all.
    I would like to build a synthetiser module with a teensy brain.
    I was looking for informations about high definition DAC and ADC and I came across the Audio Adaptor Board. I saw the schematics and I was wondering if someone know if it would be possible to bypass the 1uF input capacitors (and output too). I can adapt the input signal in order to be within the analog input voltage range (which should be 2.83 Vpp max) but I don't know if the adc can process it. The main idea would be to be able to read dc voltages from control voltages or gate signals.
    I have read some topics here and there talking about noise issues etc etc.
    Any help is welcomed
    did

  2. #2
    Senior Member
    Join Date
    Feb 2013
    Posts
    528
    when you say "high definition", are you after resolution or sample rates? or both? what for? why? at any rate, while this might/should be possible (i haven't tried with this particular codec or set-up), generally speaking, i doubt it's the best way to go about it. a/the codec is designed for audio signals, not DC, while the audio board doesn't provide the sort of interface (buffers) you'd typically see on a module, so it'll only get you so far.

    fwiw, there's 16+ bit DAC and ADC devices geared toward DC applications, but those tend to be more expensive. external parts would be preferred for performance/noise/etc reasons, but then it's not trivial to make full use of them and most certainly you don't need them for gate signals. why don't you use the onboard adc and see where it gets you? for gates, "high definition" is fairly irrelevant, you can simply use any GPIO.

    there's a few open source teensy-based modules already out there, ... which might help?

  3. #3
    Junior Member
    Join Date
    Apr 2015
    Location
    toulouse, france
    Posts
    18
    hi, thanks for the answer.
    I am looking after a little bit of both. I was (and still am) planning to do something using the teensy ADC to convert CV signals (0-5v). Something over 12 bits is enough for me and the teensy 3.1 adc seems to be above 12 bits. When I found the audio board I just thought that I could be able to manipulate CV as well as Gates as well as Audio signals. It could be sweet
    Moneywise, I don't want to spend 40$ in a single dac or adc chip and this 15$ board, already soldered etc etc was an attractive solution.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,135
    The audio ADC will probably not give good DC performance. If you short the capacitor and level shift your signal to its range, expect about 7 to 8 bit accuracy at DC. You may get better short-term performance, but over time the DC reference is likely to drift. Those chips simply aren't designed for long-term stable DC measurement.

    If 12 to 13 bits is good enough, I'd go with the Teensy built-in ADC. Teensy 3.1 has an on-chip 1.2V reference which is decent. But if you want all 12 bits to be highly DC accurate over long-term stability, you'll need a voltage reference chip with extremely low drift. That's expensive!

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,135
    This question comes up so often... I finally wrote a quick blog article. Hope this helps?

    http://dorkbotpdx.org/blog/paul/cont...alog_input_pin

  6. #6
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,067
    Paul, the circuit in your blog assumes a +5 to -5V range which is indeed common for bipolar CV (the other frequently found ranges are 0 to 5V unipolar CV, 0 to 8V for gates, and anywhere between -10 and +10 for pitch CV; the latter is not a good for for the Teensy built-in ADC if good tuning accuracy is required).

    However, the actual voltage may be on occasion (in particular, at startup) anywhere between +/- 12V (for Eurorack) or +/- 15V (for the larger formats) so I would have expected to see some Schottky diodes (BAT42 seems to be a common choice) to 0V and the power rail, to limit these occasional high voltages.

    The input impedance of 32k is also lower than would typically be used. Many modules have (for legacy reasons which no longer apply) an output impedance of 1k and it is common therefore to use an input impedance of 100k so that the voltage drop is kept to 1%. (Better modules, especially those for pitch CV, have much lower output impedance, but 1k is still annoyingly common). And yes, loss of 1% in a voltage divider means that absolute voltage accuracy is only 7 bits. Relative voltage accuracy is in many cases more important, so 12 to 14 bits is typically desirable.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,135
    Yeah, I considered writing a lengthy blog post about impedances.

    I'm pretty sure the 27K series resistor will prevent damage to Teensy if those higher voltage ranges are used. The input protection diodes are rated for up to 10 mA, which would be quite a lot of voltage across 27.4K resistance!

    I also considered making an interactive javascript-based calculator for different input voltage and output voltage ranges, different pullup voltage and input/output impedance.

  8. #8
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,067
    Either of those blog topics would be welcome. Certainly, seeing the limiting factor as the current rating of a protection diode vs. a voltage rating on a pin is different to how I see most input circuits designed (thinking here of the input circuitry on the Teensy 3.1-based Orgone Accumulator, Radio Music, and what I can figure out of the EuroTrash). Since 240V is less than 274V I could put bare mains wires across your input circuit with no ill effect?

  9. #9
    Senior Member
    Join Date
    Feb 2013
    Posts
    528
    being a non-EE, i only have a vague understanding about the Theory behind all this, but i'd agree with nantonos. while voltage dividers presumably would work, what generally seems to go as 'good practice' with digital modules is to use op amps. that's partly because of the mentioned 1k/100k convention but also (i thought) because ADCs typically would want to see a low impedance source. voltage dividers make it difficult to balance those two requirements.

    because there's easy access to +/- 12V or +/- 15V power rails, there's no good excuse not to use op amps. (though another thing you'd see is to use op amps like mcp6002/4 which would be run off 0/3v3, in which case there's no need for the clamping diodes; it tends to be easier to layout, too)

    i couldn't tell whether the diodes are really needed, i typically use bat54s, they're small. (btw, @ nantonos: to figure out the input circuitry of eurotrash, there's a drawing on github, it's just a plain old inverting op amp (mixer) followed by said (fairly) usual series resistor, diodes, and cap)

  10. #10
    Junior Member
    Join Date
    Jan 2016
    Posts
    2
    Hello everybody.

    I was planning to build a midi to cv interface to control a modular synth using Teensy 3.1 and the Audio Adaptor Board. My main goal was to obtain a good resolution cv output to control the frequency of a VCO. I'm not an expert in the field and I was unaware of the troubles there might be with DC output. If I've understood well, since the DAC of the audio adaptor board is meant for AC output, you can't expect much stability for DC or very low frequencies. Since the value of the CV is only going to matter during the event of note on-off, maybe a little drift isn't that relevant for this specific purpose? Is this going to be an upgrade from obtaining the CV signal with PWM + low pass filter? Also, around which frequency does the DAC start to be unstable? If not for the pitch, maybe I could use the audio board to output a LFO signal with the lowest frequency set to this critical frequency.

    At last, it doesn't matter that much to me the accuracy of the final result, I care more about finding which is my best option using teensy and then actually finishing something and hearing the result myself. Any help, comments or advice will be greatly appreciated

  11. #11
    Senior Member adrian's Avatar
    Join Date
    Oct 2015
    Location
    Wellington, NZ
    Posts
    504
    Holy hijack batman ...didn't mortonkopf do a midi to cv project ?? .... I don't know about using the teensy 3.x onboard dac for CV (I don't know very much about cv at all ..my modular synths all seem to be vsti , but it seems reasonable to think the onboard dac will get you some of the way ...I think mortonkopf used an external dac, so ... ???

    The midi part is easy...
    Last edited by adrian; 01-07-2016 at 03:22 AM.

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,135
    Quote Originally Posted by fix View Post
    ... you can't expect much stability for DC or very low frequencies.
    Since the audio board has AC coupled (capacitor in series) signals, you can't exect *any* DC performance. The capacitors completely block DC.

    Probably the simplest thing would be to use the DAC/A14 pin on Teensy 3.2. It's DC coupled. Just use analogWrite(A14, number) to control it.

  13. #13
    Senior Member
    Join Date
    Feb 2013
    Posts
    528
    Quote Originally Posted by fix View Post
    Hello everybody.

    I was planning to build a midi to cv interface to control a modular synth using Teensy 3.1 and the Audio Adaptor Board. My main goal was to obtain a good resolution cv output to control the frequency of a VCO. I'm not an expert in the field and I was unaware of the troubles there might be with DC output. If I've understood well, since the DAC of the audio adaptor board is meant for AC output, you can't expect much stability for DC or very low frequencies. Since the value of the CV is only going to matter during the event of note on-off, maybe a little drift isn't that relevant for this specific purpose? Is this going to be an upgrade from obtaining the CV signal with PWM + low pass filter? Also, around which frequency does the DAC start to be unstable? If not for the pitch, maybe I could use the audio board to output a LFO signal with the lowest frequency set to this critical frequency.

    At last, it doesn't matter that much to me the accuracy of the final result, I care more about finding which is my best option using teensy and then actually finishing something and hearing the result myself. Any help, comments or advice will be greatly appreciated
    fwiw, there's been a few threads on this; see for example here

    or poke around on muffwiggler.com, which has a DIY sub-forum with plenty of threads covering this kind of thing.

    the gist being, i suppose, is that if you want decent performance (accuracy _is_ important for pitch?), you'd not want to use a audio codec or filtered PWM; the onboard DAC might work alright, but then it's just one channel. so typically you'd use an external DAC (preferably, SPI). invariably, basically any midi-to-CV module of note features one.

    for example: take a look here: http://mutable-instruments.net/stati.../Yarns-v03.pdf

    this is using a 16 bit DAC (DAC8564), which aren't cheap and they're SMD; but then basically any DAC is SMD. NB: Yarns also has the correct type of output buffer ("in the loop" compensated), which doesn't result in pitch error (downstream modules typically have a 100k input impedance, so you don't want to put a/the series resistor at the output, as is often seen).

    you can do similar things with teensy, of course: for example; if you're not enthusiastic about SMD, the go-to through-hole DAC seems to be MCP4922; you can use several, depending on how many CV channels you need.

  14. #14
    Junior Member
    Join Date
    Jan 2016
    Posts
    2
    Quote Originally Posted by adrian View Post
    Holy hijack batman ...didn't mortonkopf do a midi to cv project ??
    Didn't find that on my search, sorry. That was very helpful thanks!

    Quote Originally Posted by PaulStoffregen View Post
    Since the audio board has AC coupled (capacitor in series) signals, you can't exect *any* DC performance. The capacitors completely block DC.

    Probably the simplest thing would be to use the DAC/A14 pin on Teensy 3.2. It's DC coupled. Just use analogWrite(A14, number) to control it.
    Ok, so I'm going to forget about the audio board for this specific project. Now I realize that for audio purposes, you precisely want to remove any dc component, didn't think about that . I will start by using the onboard DAC then. Thanks a lot for your answer!


    Quote Originally Posted by mxxx View Post
    fwiw, there's been a few threads on this; see for example here

    or poke around on muffwiggler.com, which has a DIY sub-forum with plenty of threads covering this kind of thing.

    the gist being, i suppose, is that if you want decent performance (accuracy _is_ important for pitch?), you'd not want to use a audio codec or filtered PWM; the onboard DAC might work alright, but then it's just one channel. so typically you'd use an external DAC (preferably, SPI). invariably, basically any midi-to-CV module of note features one.

    for example: take a look here: http://mutable-instruments.net/stati.../Yarns-v03.pdf

    this is using a 16 bit DAC (DAC8564), which aren't cheap and they're SMD; but then basically any DAC is SMD. NB: Yarns also has the correct type of output buffer ("in the loop" compensated), which doesn't result in pitch error (downstream modules typically have a 100k input impedance, so you don't want to put a/the series resistor at the output, as is often seen).

    you can do similar things with teensy, of course: for example; if you're not enthusiastic about SMD, the go-to through-hole DAC seems to be MCP4922; you can use several, depending on how many CV channels you need.
    Thank you for the links, I'll look around there. As you all suggest, I'm going to use the onboard DAC first to output a pitch cv. Once I have finished that and have the full circuit working (I still haven't gotten into the cv out part very far), I will have it nicely prepared for including many things. Apart from triggers and gates of course, it would be nice to add some pots and make an ADSR envelope cv out, already synced with the note on event, LFO, etc. When I get to this point, I will look at the dac's you suggest. That last link is very helpful! That Yarns looks very nice too.

    Again, thank you all for your anwers, they helped a lot. I will surely post it when I finally have it!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •