A Man, A Plan, A Clam … er …

CLAMS live coding Raspberry Pi Pico Raspberry Pi Debug Probe Pimoroni Pico Audio Pack Waveshare Electronics Audio Expansion Module zeptoforth project status

Preliminary plan for CLAMS


Author

Affiliation

M. Edward (Ed) Borasky

 

Published

Feb. 26, 2023

Citation

Borasky, 2023


"In the beginning, there was a plan,
And then came the assumptions,
And the assumptions were without form,
And the plan without substance,

"And the darkness was upon the face of the workers,
And they spoke among themselves saying, ..."

- unknown NSFW cubicle worker

Building CLAMS - Preliminary Road Map

I have a preliminary road map to share with you. The plan is very preliminary for two reasons:

  1. I have two other projects that compete with this one for attention. Normally my optimum active project count is two, since it’s rare that both will be blocked at the same time.
  2. This project involves hardware, and component availability is … well … challenging.

This second reason is why I have inserted a proof-of-concept phase up front. I have a pretty good idea of what I would do if someone handed me working Raspberry Pi Pico audio hardware and well-documented sample code. That is not the starting point for CLAMS.

I’m not a hardware hacker by any stretch of the imagination. I don’t even have a soldering station! CLAMS is open source. The code is licensed GPL-3. The documentation and any media I produce with CLAMS is licensed Creative Commons Attribution / Share-Alike. If someone wants to build CLAMS gizmos and sell them, that’s fine with me as long as they give me credit and give their users a copy of what I’m providing with CLAMS.

Hardware for the proof of concept

Raspberry Pi Pico H and Raspberry Pi Debug Probe

First of all you will need a Raspberry Pi Pico H. This is the Raspberry Pi branded board with headers and a serial wire debug (SWD) connector pre-soldered onto the board. Here’s the link for the store locator:

https://www.raspberrypi.com/products/raspberry-pi-pico/

Important! You need the one without wireless and with headers!

You will also need a Raspberry Pi Debug Probe. Here’s the store locator link:

https://www.raspberrypi.com/products/debug-probe/

This is newly-announced and I don’t know about availablilty. I have four on order that I expect to be here next week. If you can’t get them, there is a workaround, which I’ll publish in a separate post.

The reason you need this is that zeptoforth communicates with a host computer via a serial connection, not USB. The debug probe connects a USB port on the host computer with a Raspberry Pi Pico serial port and translates the signals. The host computer sees a serial port over USB.

Pimoroni Pico Audio Pack and (Pico Omnibus or Pico Decker)

I am testing two audio boards for CLAMS. The first one is the Pimoroni Pico Audio Pack:

Pimoroni Pico Audio Pack

The store is in the United Kingdom but I’ve had good luck with their shipping.

Because the debug probe needs to connect directly to the serial pins on the Pico, you will also need either a Pico Omnibus or a Pico Decker.

The Omnibus has two expansion slots. The audio pack will take up one, and you will need to leave the other one unused. That’s where you’ll connect the debug probe to the Pico serial port pins. I’ll post a picture as soon as the debug probes get here.

The Decker has four expansion slots. The audio pack takes up one and you need to reserve one for the debug probe connections. But you can put two other packs on the remaining slots, so feel free to explore the Pico universe!

Waveshare Electronics Audio Expansion Module for Raspberry Pi Pico

The second audio board I’m testing is the Waveshare Electronics Audio Expansion Module. The store is in China, so availability may be a challenge. I have some on order, so I can’t give much more data.

The Waveshare Electonics add-on appears to be more convenient than the Pimoroni pack. The documentation is better, it comes with speakers, and the hardware interface with the Pico leaves a full set of open Pico male header pins. This last part means you can use an ordinary breadboard to connect the serial port pins to the debug probe; you don’t need an expander.

Software for the proof of concept

The primary goal of the proof of concept is to make a sound - at least a 440 hz sine wave - with just a Raspberry Pi Pico running zeptoforth and the Pimoroni audio pack. A large part of this effor is finding out where the performance constraints are going to be for synthesizing audio in real time with a Raspberry Pi Pico.

Initially, I want to know how much audio I can make in real time with 24-bit samples at 48 kHz using a single Pico. I can’t rule out dropping back to 16-bit / 44.1 kHz audio, multi-Pico configurations or both without this testing.

The planned audio software includes:

At this early stage I probably won’t need a real-time operating system capability.

Target date for proof of concept

I’m calling the proof of concept release v0.2.5. I’ve set the due date to March 17, 2023. I expect to have Waveshare devices here but the software for them probably won’t be done by then.

Once I know what the audio constraints on a single Pico are, I’ll re-scope the project. I’d strongly prefer a one-to-one ratio of performers to Picos. There is no hardware “Pico cluster” available as far as I know. Interconnecting multiple Picos adds complexity to the breadboarding process and printed circuit board design is way above my pay grade.

But here’s what I plan to build after the proof of concept …

Given that all of this could change after the proof of concept, here’s the rest of the plan.

First release (v0.5.0) - Software (low-level infrastructure)

Second release (v0.7.5) (mid-level user interface)

Full release (v0.9.0+) (high-level user interface)

Footnotes

    References

    Bochkarev, D. N., I. V. Ryabov, I. V. Strelnikov, and N. V. Degtyarev. 2019. “Direct Digital Synthesizers of Frequency and Phase-Modulated Signals.” In 2019 Systems of Signal Synchronization, Generating and Processing in Telecommunications (SYNCHROINFO), 1–4. https://doi.org/10.1109/SYNCHROINFO.2019.8814244.
    Cordesses, Lionel. 2004a. “Direct Digital Synthesis: A Tool for Periodic Wave Generation (Part 1).” IEEE Signal Processing Magazine 21 (4): 50–54.
    ———. 2004b. “Direct Digital Synthesis: A Tool for Periodic Wave Generation (Part 2).” IEEE Signal Processing Magazine 21 (5): 110–12.

    Reuse

    Text and figures are licensed under Creative Commons Attribution CC BY-SA 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

    Citation

    For attribution, please cite this work as

    Borasky (2023, Feb. 26). AlgoCompSynth by znmeb: A Man, A Plan, A Clam ... er .... Retrieved from https://www.algocompsynth.com/posts/2023-02-26-proof-of-concept-plan/

    BibTeX citation

    @misc{borasky2023a,
      author = {Borasky, M. Edward (Ed)},
      title = {AlgoCompSynth by znmeb: A Man, A Plan, A Clam ... er ...},
      url = {https://www.algocompsynth.com/posts/2023-02-26-proof-of-concept-plan/},
      year = {2023}
    }