Skip to main content
Version: ACS CC

Rusty Musician

Sound processor for electric musical instruments

info

Author: Petru-Cristian NANIA
GitHub Project Link: repository

Description

The device can be connected between an electric musical instrument and an amplifier.
It can apply sound effects to the signal generated by the instrument.
It can also function as a looping station (it records sequences of sound and plays them back repeatedly).

Motivation

I have a passion for music and I've always wanted such a device.
I think it's more fun to make it myself than to buy one.
I also don't always have and entire musical band with me when I want to entertain my friends and a looping station would be awesome.

Architecture

Architecture

Log

Week 5 - 11 May

I connected all the debug wires and managed to run the lab skeleton code on my Pico, printing "Hello, World!" to the debug console.

I did not stop there! I had a first test where I connected the 6.3mm jack sockets and the DAC to the breadboard and wrote some simple code to test if the audio signal from my electric guitar can be easily read by the Pico's ADC, copied to the DAC's register, and sent to the amplifier. It actually worked -- The 12-bit resolution of both the on-board ADC and the external DAC is not great, but the sound quite clearly has the timbre of an electric guitar!

Here is the first recording I made that night:

I've experimented with passive filters and noticed that there is some strange noise that I can't get rid of. I suspect it's a problem with my amplifier. I've even tried filtering out all the frequencies above 5Hz and that just meant the guitar couldn't be heard anymore, but the background noise was still there.

Week 12 - 18 May

Quite hard to focus on the project this week. The weather has been so nice lately that I wanted to spend time outside as much as possible (and even learn rollerblading). The anxiety about the presidential election on Sunday and the recent breakup I'm still going though have also impeded my progress.

Nevertheless, I was able to connect all the other pieces from the schematic. They even work, but I still need to write some proper code for them next week.

More details in the "hardware" section below (with images).

Also here is an updated recording of the hardware working:

As you can see, I was watching the vote count live :)

Week 19 - 25 May

I've had problems with the original crate I had chosen (lcd1602-rs), which was quite old and incompatible with my project. I was able to find a new one (ag-lcd) which was compatible.

The LCD still did not work, but no errors were showing up. Turns out I had problems with the wiring of the potentiometer used for the screen contrast. Now the screen works.

I've added a new task called menu_task in the executor which handles button presses and changes the effect added to the audio.

I've also been researching and implementing a couple of commonly used audio effects.

Hope I'll finish by the deadline... I'm greatful it's been extended by a day!

Hardware

Overview

For videos of the project, look at the logs above.

An electric guitar pickup is just a coil with magnets (the magnetized strings) vibrating around it. These vibrations induce in the coil an electrical current which is normally conducted though an audio cable to an amplifier.

In my project, the aim is to take that current, send it to Rusty Musician device, and do funky stuff with it before sending it to the amplifier.

First of all, the input is be preprocessed with a passive low-pass filter that has a threshold as high as the highest note on the guitar. This ensures the signal is as clean as possible before sending it to the ADC on the Raspberry Pi Pico 2 and processing it using software written in Rust for the RP2350 MCU.

Multiple buttons (with pull-up resistors) are used to select options from the menu (cycle between live effects or select the loop station function). The options are shown on an LCD screen.

For certain effects and for looping, storage space is needed. This is achieved by using an external microSD module.

The processed signal is sent to an external DAC module, filtered again, and ultimately sent to the amplifier.

Hardware

Here are the components from the image:

  • the two Picos are the green rectangles (left for debug, right for project)
  • the DAC is the red square in the middle of the image
  • the microSD is in my hand, at the top of the image
  • the audio jack sockets with cables plugged in can be seen on the left side
  • the buttons for menu selection in the bottom-right corner
  • the potentiometer is to the right of the buttons
  • the 1602A LCD is on a separate breadboard, glowing a bright blue shade

Detailed look

The challenge of designing the hardware comes from the multitude of communication methods with the components:

  • the DAC uses the I2C protocol
  • the microSD card adapter uses the SPI protocol
  • the audio signal si an analog one and must use the on-board ADC
  • the 1602A LCD requires a specialized driver to send the information directly to the data lines

Schematics

Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller39.66 RON
A second Raspberry Pi Pico 2WThe debugger39.66 RON
MCP4725 with I2C interfaceDAC module for generating the output signal24.99 RON
LCD 1602AFor the effects menu9.82 RON
Three pin headers - 2.54mm with 40 pinsFor the two dev boards and the LCD3 × 0.99 RON
At least two MF1401 6.3mm jack socketsConnecting the instrument and the amplifier tot the Rusty Musician device2 × 2.00 RON
Audio cableAn extra one is needed to connect the Rusty Musician device and the amp29.00 RON
ButtonsTo select options from the menu4 × 0.36 RON
PotentiometerChange LCD contrast1.49 RON
Breadboard + Jump wires + Stabilized power sourceMounting, connecting and powering everything22.00 RON
BreadboardFor development, an extra one is needed since the project is quite large16.50 RON
Breadboard 33mm x 46mmFor mounting the 1602A LCD separately14.00 RON
Micro USB cablePowering the dev board and uploading the code3.99 RON
MicroSD card module with SPI interfaceLoop recording and playback4.39 RON
Soundking AL 103 FootswitchStarting and stopping loop recording/playback11.90 RON
Total-225.81 RON

Software

Software diagram

Software

Crates used in the project

LibraryDescriptionUsage
embassy-rpRust + async ❤️ embeddedNext-generation framework for embedded applications
cortex-m-rtStartup code and minimal runtime for Cortex-M microcontrollersPretty much everything else needs this
ag-lcdDriver for 1602 LCD which uses embedded-halShow menu on LCD screen
embedded-sdmmcRead/write files on a FAT formatted SD cardStoring samples of the signal on SD card for looping
  1. Inspiration: Ed Sheeran
  2. 1602A LCD connected to Pico
  3. Looper for Linux written in Rust
  4. PWM & ADC lab
  5. SPI lab
  6. I2C lab