Hello.
What am I missing? Is there a library for this? Any documentation?
I can see that someone put lot of effort making an example with what I can only assume is some kind of musical sequence. Looks amazing.
How do I compile it?
I’ve installed the pico-extras and added the path to the vscode settings.json
Now I get this error:
cmake] No project() command is present. The top-level CMakeLists.txt file must
[cmake] contain a literal, direct call to the project() command. Add a line of
[cmake] code such as
[cmake]
[cmake] project(ProjectName)
[cmake]
[cmake] near the top of the file, but after cmake_minimum_required().
Why are all the example programs for all the products part of one giant repo that needs to be compiled together? How do I disentangle the examples I want to study?
Thanks for making the fancy example but I’d be hours ahead by now if it was just a standalone example that compiles with the given instructions and just spits out random samples in stereo.
Thanks.
The problem is that the pico-sdk just needs cmake. And that is a problem for many people. cmake is a makefile generator, it pulls in all of the dependencies that you need to build a specific project. Doing this manually is terrible.
So you have to spend some time learning about building c++ examples for the Pico. There is a lot of stuff available on the net. The good news is that for simple projects the CMakeList.txt
files are simple (these files describe what to build and what to pull in).
I get that.
This is the CMakeLists.txt provided in the example:
if (TARGET pico_audio_i2s)
# You must supply the Pico Extras path to build this example
# -DPICO_SDK_POST_LIST_DIRS=/path/to/pico-extras
# You can use “cmake.configureSettings” in VSCode settings.json
# Grab the extra libraries here: GitHub - raspberrypi/pico-extras
add_executable(
audio
demo.cpp
synth.cpp
)
# Pull in pico libraries that we need
target_link_libraries(audio pico_stdlib pico_audio_i2s)
target_compile_definitions(audio PRIVATE
# compile time configuration of I2S
PICO_AUDIO_I2S_MONO_INPUT=1
#define for our example code
USE_AUDIO_I2S=1
)
# create map/bin/hex file etc.
pico_add_extra_outputs(audio)
endif()
What I’m guessing is that this file is pulled in as part of compiling the whole repo. I’ve followed the instructions to build the whole repo and it successfully builds what appears to be most of the examples (I have a stellar unicorn and the examples it builds for that work fine). It does not build the pico_audio examples.
Edit:
I’ve managed to compile the playground examples and set the PICO_AUDIO_I2S_DATA_PIN=9 and
PICO_AUDIO_I2S_CLOCK_PIN_BASE=10
Uploaded the sine_wave_i2s.uf2 and no sign of a sin wave.