Arduino STM32 – Fast PWM Audio Output

I was measuring the speed of the analogWrite() on an STM32 Black Pill on some PWM pins and I was getting a result of around 48697 samples per second. This is enough for one line of hifi data: but I wanted to provide at least 4 channels! This is not good enough: so I generated some new code with 4 PWM output pins using the STMCubeIDE and measured how many duty cycle updates we can Read more…

FFT Speed on Microcontrollers

In my Arduino AudioTools I am providing an easy API with different implementations for Fast Fourier Transform (FFT). This is a clever algorithm that can extracts the frequencies from an input signal. So far I never looked at the speed, so I thought it might be interesting to get to know the numbers. Setup I was using an ESP32 and an STM32F411 Black Pill for my tests. The FFT was executed for a length of Read more…

STM32: Creating an I2S Arduino Library using the Cube IDE

The STM32 Cube IDE supports all features of the STM32 microcontrollers, but it is quite difficult to use. The STM32duino is the official Arduino implementation from STM, which is easy to use – but provides only the basic functionality! I was missing I2S in Arduino, so I was wondering, what it takes to convert the code generated from Cube to an Arduino Library for my STM32F411 Black Pill. Unfortunately I did not find any guidance Read more…

Arduino Audio Tools – Creating A Multiuser Audio Webserver

Quite some time ago I was playing with the idea that it should be quite easy to implement a web server in Arduino that provides the same audio signal to multiple users. All that needs to be done is register new connections and close them when the user closes the browser window. Then we just need to copy the same data to all open connections. That’s how my TinyHttp (Audio) Server got started. This week Read more…

Arduino Audio Tools – Downloading Files from the Internet to a SD Card

Quite some time ago, I tried to use the functionality of the Arduino Audio Tools to download a file from an URL and store it on a SD card, but I was running into some problems. I finally found the time to investigate the issue and I have the functionality finally working now: #include “SD.h” #include “AudioTools.h” const char *ssid = “SSID”; const char *password = “password”; URLStream url(ssid, password); // Music Stream StreamCopy copier; Read more…

Arduino Audio Tools – Recording Sound to SPI RAM

The AudioKit and some ESP32 Processors have 4MB of SPI RAM that we can use e.g. to store recorded audio. I was playing with the idea to build some looping logic. Therefore I have added an additional DynamicMemoryStream class that can stores the audio data on the heap. With the help of the memory manager we can indicate that data chunks that are above a specified limit are stored in SPI RAM! Arduino Sketch To Read more…

Arduino Audio Tools – Input from the VS1053 Module

I added support for the VS1053 breakout boards to my Arduino Audio Tools project. Finally the recording of sound from the microphone or the aux input is working as well both for the VS1003 and VS1053 devices! Arduino Sketch It is working the same like any other input: #include “AudioTools.h” #include “AudioLibs/VS1053Stream.h” int channels = 1; VS1053Stream in; // Access VS1053/VS1003 as stream CsvStream<int16_t> csvStream(Serial, channels); StreamCopy copier(csvStream, in); // copy in to csvStream // Read more…

Arduino Audio Tools – VS1053 And Real Time MIDI

The VS1053 and VS1003 audio codecs support real time MIDI. While the VS1003 only provides a few instruments, the VS1053 has 128 melodic instruments and quite a few additional percussion instruments! When GPIO0 is low and GPIO1 is high during boot, real-time MIDI mode is activated. Unfortunately these pins are not available on most breakout boards. In this case a patch can be used to activate it. When real time MIDI is active, you can Read more…

Arduino Audio Tools – Output to the VS1053 Module

I added support for the VS1053 breakout boards to my Arduino Audio Tools project. This module is interesting if you have a microcontroller that does not support I2S because all communication is going via SPI. Some boards also include an SD drive. The major disadvantage is the number of pins that need to be connected and the fact that they might be named differently. Dependencies As a precondition you need to install the arduino-vs1053 driver Read more…

Symlinks and Git

I converted some Audio C++ libraries into Arduino Libraries and used symlinks which point to the original file locations to make sure that Arduino can find all relevant files. This approach was working fine in OSX and Linux. Unfortunately this seems to create problems in Windows, so I decided to change the approach a little bit and replace the symlinks just with regular files that contain a regular #include. To convert all files manually would Read more…