Code Monkey home page Code Monkey logo

Comments (5)

pschatzmann avatar pschatzmann commented on July 23, 2024

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.

pschatzmann avatar pschatzmann commented on July 23, 2024

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.

tomcombriat avatar tomcombriat commented on July 23, 2024

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.

tfry-git avatar tfry-git commented on July 23, 2024

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.

pschatzmann avatar pschatzmann commented on July 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.