Music generation and spectrum visualization on RP2040 with CMSIS-Stream and CMSIS-DSP.
The demo is made of 2 CMSIS-Stream graphs. Core0 is running an audio graph.
Core1 is running an LCD graph.
The audio graph is synthesizing the sound and sending it to the PWM driver and Core 1.
The LCD graph is reading the audio data and generating a framebuffer to display a spectrum, amplitude and texture background (with some animation and blending).
Arm-2D is not yet integrated.
pico.mp4
The transistor is a NPN 2222A
Speaker has a resistance of 4 Ω
The LCD is https://www.waveshare.com/wiki/Pico-LCD-1.3
And we are using a https://www.waveshare.com/pico-quad-expander.htm to connect the LCD
First, you need to be able to build the Pico examples and have the pico-extra since the demo is using audio drivers from pico-extra. Refer to the Pico documentation to know what to install.
mkdir build.tmp
cd build.tmp
cmake -DDSP=/root/CMSIS-DSP \
-DSTREAM=/root/CMSIS-Stream \
-DCMSISCORE=/root/CMSIS_5/CMSIS/Core \
..
make
Where root
is the path where you have installed the CMSIS libraries.
You can clone the CMSIS libraries with:
git clone https://github.com/ARM-software/CMSIS-DSP.git
git clone https://github.com/ARM-software/CMSIS-Stream.git
git clone https://github.com/ARM-software/CMSIS_5.git
The MIDI part is coming from the Playtune_synth project Copyright (C) 2016, Len Shustek
The Playtune_synth files have been strongly modified and refactored to be integrated in the CMSIS-Stream framework. They are clearly identified (always inside a Playtune_synth folder) and Copyright (C) 2016, Len Shustek.
Playtune_synth files are covered by their original MIT license.
The LCD Node is based upon an example of PIO driver from the Pico examples. The example has been modified to be integrated in CMSIS-Stream.
It is Copyright (c) 2020 Raspberry Pi (Trading) Ltd and covered by a BSD-3 license.
The PWM node is based upon a Pico playground audio example using the drivers from pico-extra.The example has been modified to be integrated in CMSIS-Stream.
It is Copyright (c) 2020 Raspberry Pi (Trading) Ltd and covered by a BSD-3 license.
Other files are covered by an Apache licence and have been developped by Arm.