RNBO Raspberry pi I2C adc audio input
Hello, I was working with RNBO and raspberry with the idea to make a pedal. I tried to use the i2C DAC WCMCU-1334 and it is working with no particular problem (just some tuning time as always with raspberry). I was wondering if it is possible to do the same with an I2C ADC, I wanted to try the ads1015 but I just founded tutorials for use them via osc for reading potentiometer. I'd like to not use the blokas pisound (no offence) and, because it is a pedal, I don't want to use a usb interface. Am I missing some tutorial or some content? Seems pretty silent about incoming audio signal wit raspberry and RNBO.
Thanks
Hello Matteo,
It seems to me there are two different things mixed up in your question. The DAC WCMCU-1334 is an Audio DAC (digital to analog converter) using the I2S protocol. This is a protocol for audio streaming between devices. With the appropriate driver it will show up as an audio interface to Jack on the the RaspPi and hence RNBO can send audio to it.
The ADS1015 family of chips is a different thing. It is an ADC for translating voltage changes into a digital signal. (Hence it's called analog to digital converter). It doesn't deal with audio and it doesn't use the I2S protocol but the I2C. Similar name, entirely different thing. I2C is a general purpose serial protocol for different chips to exchange informations. It is used for example for sensor modules to talk to a micro controller. You can't do platform programming with RNBO, so there is no way to connect directly.
The RaspPi has GPIO pins that can be used with I2C. So you would need to create a separate program (Python, Java,/C++ or whatever language you prefer) to read out the data form the ADS1015, parsing and formating them and then, this program can send those values via OSC (localhost/172:0.0.1) to RNBO to control a parameter.
I was/am working on a hardware controller project for RNBO. It is currently dormant, not well documented and definitely not plug a play (and a bit in a messy state) . The hardware modules read the ADC and send the data via serial/UART to the Raspberry Pi.
https://github.com/janmech/RainPotsProject
On the boards I also use ADS1x15 family chips and Raspberry PICOs. In case you like to go for a Raspberry PICO to read the ADS1015 here you'll find a quick and dirty port from the Adafruit Arduino library for the ADS1X15 chips:
https://github.com/janmech/RainPotsProject/tree/main/RaspberryPiPico/source_files/ADS1X15
There is also a Python program from where you might have a look on how I parse the serial data to OSC:
Hello Jan,
thank you for the patience you used in this answer.
Ok, now I understand better why I cannot get audio from that!(lol)
The controller you sent me seems super interesting but I think I'm kind of okay on the external control side via GPIO and OSC using a python script for read and send the data to max. It is also quite documented. My interest was more about to sample audio in input. The goal is to have one raspberry PI analysing the audio input. I wanted to have a cheap board sound interface with just an ADC (like the WCMCU-1334 but with just input instead with just output).
Thank you for sharing this!
Hi Jan,
your answer is really helpful.
It looks like you could help me with my problem.
I am using RNBO on RasPi 4 and would like to use it with DSP adau1701 via I2S audio interface. I installed the driver for the I2S and it worked as an audio output.
https://github.com/MKSounds/ADAU1701-I2S-Audio-Driver-for-Raspberry-Pi
But unfortunately, when I tried to compile in Max a RNBO patch with this driver as an audio output, I got an error message:
rnbo cmd response error: {"code":5,"message":"cannot activate audio"}
I saw some notes that it's better to use a USB device, but I'm wondering if I can still somehow stay with the I2S.
Or should I try to compile the C++ code directly on Raspberry via CMake?
Thanks