Pages: [1]   Go Down
Author Topic: analog audio in to PWM audio out  (Read 4266 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 2
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i just finished an arduino sketch that allows decent audio processing with just a few resistors and capacitors.  the arduino sketch is up here:

http://wiki.openmusiclabs.com/wiki/PWMDAC

it takes in audio on ADC0 and uses a dual pwm to create 16b audio out.  you can process the audio in-between and make a low-fi effects pedal.  it can be used for just analog out as well, and is much higher quality than using analogwrite (although more complicated too).

there is a much more in-depth tutorial on pwm in general up here:

http://www.openmusiclabs.com/learning/digital/pwm-dac/
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
I have tried your code on my  Arduino Mega2560, it doesn't work.
Are the code for Atmega328 and Atmega2560 different?
Any hint to convert the code to Arduino Mega2560?
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the ports are different between the mega and uno (what pins map to what functions), so those need to be changed.
Logged

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1249
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI.. (sorry for being thick headed here)  smiley

but would this be used for AUDIO playback?  (like a .wav file?)  or just for use like, say.... a voice changer/voice effects type of project?

thanks!
Logged


Offline Offline
Jr. Member
**
Karma: 2
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it can output .wav, but there isnt an SD card reader setup for it yet.  so if you have something that can read SD cards, you can use the PWM to output it.  this is what the simpleSD does.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 217
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is interesting. What might you use this for? Are there audio examples?
Logged

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1249
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI-

SimpleSD.. as in the SimpleSDAudio library?

(I have played with that before)

I guess Im missing a 'purpose' this can be used for then??

Was a wrong to assume it could be used for some sort of real-time voice changer/FX platform??

Logged


Offline Offline
Jr. Member
**
Karma: 2
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, its primarily for doing guitar/voice effects on the cheap.  but, the pwm side is just a generic setup routine to configure the pwm for various data rates and bit depths, so that can be used for any audio application.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 217
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would be nice to see a full sketch that does some audio effects.

Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i have a sketch up here:
http://wiki.openmusiclabs.com/wiki/MiniArDSP

sorry, no sound samples yet.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is nice sketch.. http://wiki.openmusiclabs.com/wiki/PWMDAC smiley but how could i do the circuit for guitar signal?
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

if you take a look at the circuit here:
http://wiki.openmusiclabs.com/wiki/MiniArDSP

you just need to put a guitar preamp before it.  a simple opamp circuit with gain of 100 would be fine.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have this sketch bread boarded with the analogue in circuit from instructable here.Thank you GUest, Brilliant!

All working a bit noisy but I am fine tuning resistor values and caps.
http://www.instructables.com/id/Arduino-Audio-Input/?ALLSTEPS

This is the project I am working on to use it with,



Just going to do a quick video and then ´´once more unto the breach´´
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AdC/DaC highway to ped(Hell)



Update on the hardware side of this project.
Links to all the helpfull and informative information sourced so far.

http://www.instructables.com/id/Arduino-Guitar-Pedal/?ALLSTEPS

http://www.instructables.com/id/Arduino-Audio-Input/?ALLSTEPS

http://wiki.openmusiclabs.com/wiki/MiniArDSP

http://provideyourown.com/2011/analogwrite-convert-pwm-to-voltage/

http://www.instructables.com/id/Lo-fi-Arduino-Guitar-Pedal/

https://github.com/telamon/ArduinoDSP

http://www.openmusiclabs.com/projects/codec-shield/

http://www.planetz.com/intro-to-diy-pedal-building/#more-1883

http://www.planetz.com/building-an-idevice-guitar-interface-cable/

I need to address the Resistor Values and also the reference ground voltage and also one of the capacitor values in this circuit.

I am encouraged with progress to date the next stage of the project is interfacing the guitar signal with Pure Data and adding additional controls as set out in the first video
so some more reading on Pduino.

These are really just bench notes again on progress to date still unresolved are the 5 way selector switch hack for the Pickup replacer selection so very much a work in progress.
Logged

Pages: [1]   Go Up
Jump to: