Comments (5)
I was playing around with ADS1015. These two boards are very similar, differing only in resolution and speed. The ADS1115 has higher resolution and the ADS1015 has a higher sample rate.
However the ADS1015 is much too slow for audio, so you don't have a chance with the ADS1115!
see https://www.pschatzmann.ch/home/2021/11/12/the-big-ads1015-audio-failiure/
If you use a proper ADC or the built in ADC via I2S you would still need to extend this library a bit because the getADCReading() method is currently not implemented in MozziGuts_impl_ESP32.hpp
from mozzi.
I was conidering to add the following implementations for the getADCReading() method:
- get data from the internal DAC via I2S
- get data from an external DAC via I2S
At first sight this seems to be something very easy to do, so I was wondering if I miss anything ? After all there must be a reason why this does not exist yet...
from mozzi.
Hi @pschatzmann ,
Feel free to try! I personally do not have a ESP32 to play around to try to implement that, so I do not know if there is a caveat or not ;)
from mozzi.
I think analog input, and audio rate analog input in particular has simply been a bit of a step child, so far...
I suppose the main difficulty will be to wrap your mind around the convoluted analog read logic. Essentially all this is designed around the need to allow for a non-blocking round-robin sampling on the Arduino Uno. That may prove to be a bit of a burden, when trying to implement something new, at least when trying to support input from more than one channel. I wouldn't mind a redesign of the internals, here, if you happen to have a clever plan for that. The only functions intended for end use are mozziAnalogRead(), and getAudioInput(), as far as I am aware.
from mozzi.
mozziAnalogRead() is currently not on my radar and I mainly target the getAudioInput()
My gut feeling is that the big work has already been done by Espressif and most of the time the call will be non blocking because there is data in the I2S buffer. I have a first DRAFT implementation ready which the following options:
// Audio IO options
#define INTERNAL_DAC 1 // output using internal DAC via I2S, output on pin 26 & 27
#define PT8211_DAC 2 // OBSOLETE: use I2S_DAC instead
#define PDM_VIA_I2S 3 // output PDM coded sample on the I2S data pin (pin 33, by default, configurable, below)
#define I2S_DAC 2 // output using an external DAC via I2S
#define I2S_DAC_AND_INTERNAL_ADC 4 // output using an external DAC via I2S and input via internal ADC
#define I2S_DAC_AND_I2S_ADC 5 // output using an external DAC , input with exteran ADC - both via I2S
#define INTERNAL_DAC_AND_I2S_ADC 6 // output using internal DAC via I2S, output on pin 26, input via external ADC
One final question ? Does getAudioInput(); need to return values in the range of 0-1023 of am I free to return the same data format that is used on the output side ?
The scenario that I have in mind is a I2S based Guitar Effects pedal that gets the data as signed 16 bits and provides the output with signed 16 bits
from mozzi.
Related Issues (20)
- Compilation errors when including both WaveFolder.h and ResonantFilter.h HOT 3
- Unable to compile for Atmega328PB with Arduino IDE HOT 3
- Sample example not working on UNO R4 HOT 11
- Arduino Nano 33 IoT tested and works with the output on DAC0, which is also called A0 HOT 2
- Output frequency 0.25% off on AVRs HOT 1
- RFC: Mozzi 2.0 part 1: Single compilation unit HOT 7
- RFC: Mozzi 2.0 part 2 - Configuration restructuring HOT 7
- Improving fixMath HOT 5
- Please Change Mozzi's License HOT 10
- Using Mozzi and I2C library for LCD HOT 14
- RFC: Mozzi 2.0 part 3 - Miscellanious
- UNO R4 port broken HOT 2
- Compatability/Compilation Issues w/ Nano 33 BLE Sense HOT 5
- Apparent frequency drops when amplitude increased beyond 8 bits on AVR HOT 3
- mozzi_rand cannot go full range HOT 7
- AVR PWM range is not actually 0-488 ("8.5 bit"), but effectively 0-400 HOT 6
- Minor / infrastructure: Avoid duplicate workflow runs on pushes to PRs HOT 1
- I2S dac with a nano. HOT 12
- VS10XX as DAC HOT 38
- RFC: Analog input scaling - what's the best approach HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mozzi.