# Feather RP2350 Audio Reactive Video Synth

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/133/790/medium800thumb/feather_vidSynthHere.jpg?1732299590)

The Feather RP2350 with HSTX makes one of our project dreams come true: a CircuitPython-powered video synth! The Feather runs CircuitPython code that outputs graphics from HSTX to DVI. A PDM microphone takes in audio data to let the animations be audio reactive. There are three different animations to choose from. You can change which one is selected with the seesaw rotary encoder and control different parameters with the three analog potentiometers.

https://www.youtube.com/watch?v=wsJBoMUUIyQ

This video synth project makes adding reactive visuals to your music a breeze by using a PDM microphone to sample the incoming audio&nbsp;over time and analyze it with&nbsp;[fast Fourier transform (FFT)](https://en.wikipedia.org/wiki/Fast_Fourier_transform). This means that the three animations can visualize in real-time the amplitude and frequencies of your music.

![feather_soundOnOff.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/791/medium640thumb/feather_soundOnOff.jpg?1732300185)

The analog potentiometers are super responsive with the animations. Each animation has three different parameters that can be controlled. You can control things like the color of a shape...

![feather_colorControl.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/792/medium640thumb/feather_colorControl.jpg?1732300324)

...or the noise floor for the FFT calculations aka how sensitive the PDM mic is to incoming sound. This can be handy for quieter music or noisier spaces with a lot of background noise.

![feather_noiseFloor.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/793/medium640thumb/feather_noiseFloor.jpg?1732300403)

## Parts
Featured
### Adafruit Feather RP2350 with HSTX Port

[Adafruit Feather RP2350 with HSTX Port](https://www.adafruit.com/product/6000)
RP2350&nbsp;flies high with the&nbsp;Feather&nbsp;format - now you can use any FeatherWings with this battery-powered dev board. It comes with 8MB of flash, 22pin HSTX output port, Stemma QT, debug SWD, and optional PSRAM spot. It's our first RP2350 board and we crammed a ton of goodies...

In Stock
[Buy Now](https://www.adafruit.com/product/6000)
[Related Guides to the Product](https://learn.adafruit.com/products/6000/guides)
![Overhead shot of black, rectangular microcontroller with 22-pin FPC connector.](https://cdn-shop.adafruit.com/640x480/6000-07.jpg)

Featured
### Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays

[Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays](https://www.adafruit.com/product/6055)
You may have noticed that our [RP2350 Feather](https://www.adafruit.com/product/6000) has an FPC output connector on the end&nbsp;for accessing the HSTX (High Speed Transmission)&nbsp;peripheral. This new capability, not available on the RP2040, is specifically designed to allow the...

In Stock
[Buy Now](https://www.adafruit.com/product/6055)
[Related Guides to the Product](https://learn.adafruit.com/products/6055/guides)
![black, square-shaped breakout board with DVI and 22-pin FPC connectors connected to a black, rectangular microcontroller.](https://cdn-shop.adafruit.com/640x480/6055-01.jpg)

Featured
### Adafruit PDM Microphone Breakout with JST SH Connector

[Adafruit PDM Microphone Breakout with JST SH Connector](https://www.adafruit.com/product/4346)
An exotic new microphone has arrived in the Adafruit shop, a **PDM MEMS Microphone**! PDM is the 'third' kind of microphone you can integrate with electronics, apart from analog or I2S. These microphones are very commonly used in products, but are rarely seen in maker...

In Stock
[Buy Now](https://www.adafruit.com/product/4346)
[Related Guides to the Product](https://learn.adafruit.com/products/4346/guides)
![A small, square-shaped, PDM Microphone breakout with a JST-SH connector.](https://cdn-shop.adafruit.com/640x480/4346-08.jpg)

Featured
### Panel Mount 10K Log Potentiometer (Breadboard Friendly)

[Panel Mount 10K Log Potentiometer (Breadboard Friendly)](https://www.adafruit.com/product/3391)
This potentiometer is a two-in-one, good in a breadboard or with a panel. It's a **log taper** 10K ohm potentiometer, with a grippy shaft. It's smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2" apart...

In Stock
[Buy Now](https://www.adafruit.com/product/3391)
[Related Guides to the Product](https://learn.adafruit.com/products/3391/guides)
![Breadboard Friendly Panel Mount 10K potentiometer log.](https://cdn-shop.adafruit.com/640x480/3391-01.jpg)

Featured
### Adafruit I2C Stemma QT Rotary Encoder Breakout with Encoder

[Adafruit I2C Stemma QT Rotary Encoder Breakout with Encoder](https://www.adafruit.com/product/5880)
Rotary encoders are soooo much fun! Twist em this way, then twist them that way. Unlike potentiometers, they go all the way around and often have little detents for tactile feedback. But, if you've ever tried to add encoders to your project you know that they're a real challenge to...

In Stock
[Buy Now](https://www.adafruit.com/product/5880)
[Related Guides to the Product](https://learn.adafruit.com/products/5880/guides)
![Angled Shot of the I2C Stemma QT Rotary Encoder Breakout with Encoder.](https://cdn-shop.adafruit.com/640x480/5880-00.jpg)

Featured
### Clear Micro Potentiometer Knob - 4 pack

[Clear Micro Potentiometer Knob - 4 pack](https://www.adafruit.com/product/5676)
Have you found yourself in a maze of twisty-turny knobs, all alike? These micro potentiometer&nbsp;(or rotary encoder) knobs offer a rainbow burst of color to your synth or control panel. They are made of a hard plastic, with a grippy star shape. The shape is...

In Stock
[Buy Now](https://www.adafruit.com/product/5676)
[Related Guides to the Product](https://learn.adafruit.com/products/5676/guides)
![Clear micro pot knobs 4 pack](https://cdn-shop.adafruit.com/640x480/5676-00.jpg)

### 22-pin 0.5mm pitch FPC Flex Cable for DSI CSI or HSTX - 10cm

[22-pin 0.5mm pitch FPC Flex Cable for DSI CSI or HSTX - 10cm](https://www.adafruit.com/product/6035)
Connect this to that when a 22-pin FPC connector is needed. This 10 cm long cable is made of a flexible PCB. It's A-B style, meaning that pin one on one side will match with pin one on the other. How handy!

[We're stocking this to...](https://www.adafruit.com/category/360)

In Stock
[Buy Now](https://www.adafruit.com/product/6035)
[Related Guides to the Product](https://learn.adafruit.com/products/6035/guides)
![Angled shot of 10cm long 22-pin FPC cable.](https://cdn-shop.adafruit.com/640x480/6035-00.jpg)

### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert...

In Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)
![Angled Shot of the STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable.](https://cdn-shop.adafruit.com/640x480/4209-05.jpg)

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

### Silicone Cover Stranded-Core Wire - 30AWG in Various Colors

[Silicone Cover Stranded-Core Wire - 30AWG in Various Colors](https://www.adafruit.com/product/2051)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2051)
[Related Guides to the Product](https://learn.adafruit.com/products/2051/guides)
![Silicone Cover Stranded-Core Wire - 30AWG in Various Colors laid out beside each other. ](https://cdn-shop.adafruit.com/640x480/2051-01.jpg)

### Black Nylon Machine Screw and Stand-off Set – M2.5 Thread

[Black Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3299)
Totaling 380 pieces, this **M2.5 Screw Set** &nbsp;is a must-have for your workstation.&nbsp;You'll have enough screws, nuts, and hex standoffs to fuel your maker tendencies&nbsp;for days on end! M2.5 size screws fit almost all of the Adafruit breakout/dev board mounting holes...

In Stock
[Buy Now](https://www.adafruit.com/product/3299)
[Related Guides to the Product](https://learn.adafruit.com/products/3299/guides)
![Black Nylon Screw and Stand-off Set with M2.5 Threads, kit box](https://cdn-shop.adafruit.com/640x480/3299-00.jpg)

### Pink and Purple Woven USB A to USB C Cable - 2 meters long

[Pink and Purple Woven USB A to USB C Cable - 2 meters long](https://www.adafruit.com/product/5044)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers and more.&nbsp; [If you want something just like it but for Micro B, we have a B...](https://www.adafruit.com/product/4111)

Out of Stock
[Buy Now](https://www.adafruit.com/product/5044)
[Related Guides to the Product](https://learn.adafruit.com/products/5044/guides)
![Angled shot of a pink/purple woven USB cable plugged into a laptop port and a small dev board.](https://cdn-shop.adafruit.com/640x480/5044-04.jpg)

### 7" Display 1280x800 (720p) IPS + Speakers - HDMI/VGA/NTSC/PAL

[7" Display 1280x800 (720p) IPS + Speakers - HDMI/VGA/NTSC/PAL](https://www.adafruit.com/product/1667)
Yes, this is an adorable small HDMI television with incredibly high resolution **and built in 3W stereo speakers**! We tried to get the smallest possible HDMI/VGA display with high-res, high-contrast visibility. The visible display measures only 7" (17.8cm) diagonal, and the TFT comes...

In Stock
[Buy Now](https://www.adafruit.com/product/1667)
[Related Guides to the Product](https://learn.adafruit.com/products/1667/guides)
![Front view of assembled and powered on HDMI 4 Pi - 7" Display. The monitor displays a desktop background with a raspberry logo.](https://cdn-shop.adafruit.com/640x480/1667-00.jpg)

## Fastener Hardware

The following hardware screws and hex nuts will be needed to assemble the 3D printed enclosure

- 10x M2.5 x 6mm button head machine screws
- 2x M2.5 x 8mm button head machine screws
- 2x M2.5 hex nuts

# Feather RP2350 Audio Reactive Video Synth

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/133/691/medium800/feather_rp2350_video_synth_bb.png?1732050927)

### Potentiometers

- **Pot 1 wiper** to **Feather pin A1 (green wire)**
- **Pot 2 wiper** to **Feather pin A2 (yellow wire)**
- **Pot 3 wiper** to **Feather pin A3 (white wire)**
- **Pot 1, 2 and 3 positive pin** to **Feather 3.3V (red wire)**
- **Pot 1, 2 and 3 GND** to **Feather GND (black wire)**

### seesaw Rotary Encoder

- **Rotary encoder STEMMA QT port** to **Feather STEMMA QT port (STEMMA QT cable)**

### PDM Mic

- **Mic GND** to **Feather GND (black wire)**
- **Mic VDD** to **Feather 3.3V (red wire)**
- **Mic CLK** to **Feather pin D6 (yellow wire)**
- **Mic DAT** to **Feather pin D5 (blue wire)**

### HSTX to DVI

- **Feather HSTX port** to **DVI breakout HSTX port (FPC cable)**

# Feather RP2350 Audio Reactive Video Synth

## 3D Printing

![](https://cdn-learn.adafruit.com/assets/assets/000/133/704/medium800/feather_edited_P1450473.jpg?1732120772)

## 3D Printed Parts

STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print without any support material using PLA filament. Original design source may be downloaded using the links below.

![feather_cad-assembled.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/690/medium640/feather_cad-assembled.jpg?1732046873)

[Download CAD Source](https://cdn-learn.adafruit.com/assets/assets/000/133/688/original/CAD.zip?1732046749)
[Download STLs.zip](https://cdn-learn.adafruit.com/assets/assets/000/133/689/original/STLs.zip?1732046763)
## Build Volume

The parts require a 3D printer with a minimum build volume of:

- 100mm (X) x 68mm (Y) x 40mm (Z)

![feather_cura-slice.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/675/medium640/feather_cura-slice.jpg?1732032488)

## Design Source Files

The project assembly was designed in Fusion 360. This can be downloaded in different formats like STEP, STL and more.

Electronic components like Adafruit's boards, displays, connectors and more can be downloaded from the&nbsp;[Adafruit CAD parts GitHub Repo](https://github.com/adafruit/Adafruit_CAD_Parts/).

![feather_Adafruit-Feather-RP2350.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/676/medium640/feather_Adafruit-Feather-RP2350.jpg?1732032593)

# Feather RP2350 Audio Reactive Video Synth

## Install CircuitPython

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

## CircuitPython Quickstart

Follow this step-by-step to quickly get CircuitPython running on your board.

[Download the latest version of CircuitPython for this board via circuitpython.org](https://circuitpython.org/board/adafruit_feather_rp2350/)
 **Click the link above to download the latest CircuitPython UF2 file.**

Save it wherever is convenient for you.

![install_circuitpython_on_rp2040_RP2040_UF2_downloaded.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/655/medium640/install_circuitpython_on_rp2040_RP2040_UF2_downloaded.jpg?1618943202)

![](https://cdn-learn.adafruit.com/assets/assets/000/132/269/medium800/adafruit_products_reset_boot.jpg?1726082893)

To enter the bootloader, hold down the **BOOT/**** BOOTSEL button**(highlighted in red above), and while continuing to hold it (don't let go!), press and release the**reset button**(highlighted in red or blue above).&nbsp;**Continue to hold the BOOT/BOOTSEL button until the RP2350 drive appears!**

If the drive does not appear, release all the buttons, and then repeat the process above.

You can also start with your board unplugged from USB, press and hold the BOOTSEL button (highlighted in red above), continue to hold it while plugging it into USB, and wait for the drive to appear before releasing the button.

A lot of people end up using charge-only USB cables and it is very frustrating! **Make sure you have a USB cable you know is good for data sync.**

You will see a new disk drive appear called **RP2350**.

&nbsp;

Drag the **adafruit-circuitpython-_boardname_-_language_-_version_.uf2** file to **RP2350.**

![install_circuitpython_on_rp2350_Screenshot_2024-09-11_111518.png](https://cdn-learn.adafruit.com/assets/assets/000/132/253/medium640/install_circuitpython_on_rp2350_Screenshot_2024-09-11_111518.png?1726067809)

![install_circuitpython_on_rp2350_Screenshot_2024-09-11_111742.png](https://cdn-learn.adafruit.com/assets/assets/000/132/254/medium640/install_circuitpython_on_rp2350_Screenshot_2024-09-11_111742.png?1726067866)

The **RP2350** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

That's it, you're done! :)

![install_circuitpython_on_rp2350_Screenshot_2024-09-11_111843.png](https://cdn-learn.adafruit.com/assets/assets/000/132/255/medium640/install_circuitpython_on_rp2350_Screenshot_2024-09-11_111843.png?1726067932)

## Safe Mode

You want to edit your **code.py** or modify the files on your **CIRCUITPY** drive, but find that you can't. Perhaps your board has gotten into a state where **CIRCUITPY** is read-only. You may have turned off the **CIRCUITPY** drive altogether. Whatever the reason, safe mode can help.

Safe mode in CircuitPython does not run any user code on startup, and disables auto-reload. This means a few things. First, safe mode _bypasses any code in_ **boot.py** (where you can set **CIRCUITPY** read-only or turn it off completely). Second, _it does not run the code in_ **code.py**. And finally, _it does not automatically soft-reload when data is written to the_ **CIRCUITPY** _drive_.

Therefore, whatever you may have done to put your board in a non-interactive state, safe mode gives you the opportunity to correct it without losing all of the data on the **CIRCUITPY** drive.

### Entering Safe Mode
To enter safe mode when using CircuitPython, plug in your board or hit reset (highlighted in red above). Immediately after the board starts up or resets, it waits 1000ms. On some boards, the onboard status LED (highlighted in green above) will blink yellow during that time. If you press reset during that 1000ms, the board will start up in safe mode. It can be difficult to react to the yellow LED, so you may want to think of it simply as a slow double click of the reset button. (Remember, a fast double click of reset enters the bootloader.)

### In Safe Mode

If you successfully enter safe mode on CircuitPython, the LED will intermittently blink yellow three times.

If you connect to the serial console, you'll find the following message.

```terminal
Auto-reload is off.
Running in safe mode! Not running saved code.

CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.

Press any key to enter the REPL. Use CTRL-D to reload.
```

You can now edit the contents of the **CIRCUITPY** drive. Remember, _your code will not run until you press the reset button, or unplug and plug in your board, to get out of safe mode._

## Flash Resetting UF2

If your board ever gets into a really _weird_ state and CIRCUITPY doesn't show up as a disk drive after installing CircuitPython, try loading this 'nuke' UF2 to RP2350. which will do a 'deep clean' on your Flash Memory. **You will lose all the files on the board** , but at least you'll be able to revive it! After loading this UF2, follow the steps above to re-install CircuitPython.

[Download flash erasing "nuke" UF2 for RP2350](https://cdn-learn.adafruit.com/assets/assets/000/132/526/original/rp2350_flash_nuke.uf2)
# Feather RP2350 Audio Reactive Video Synth

## Code the Video Synth

Once you've finished setting up your Feather RP2350 with CircuitPython, you can access the code and necessary libraries by downloading the Project Bundle.

To do this, click on the **Download Project Bundle** button in the window below. It will download to your computer as a zipped folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/RP2350_HSTX_Video_Synth/code.py

## Upload the Code, Bitmap and Libraries to the Feather RP2350

After downloading the Project Bundle, plug your Feather RP2350 into the computer's USB port with a known good USB data+power cable. You should see a new flash drive appear in the computer's File Explorer or Finder (depending on your operating system) called **CIRCUITPY**. Unzip the folder and copy the following items to the Feather RP2350's **CIRCUITPY** drive.

- **lib** folder
- **code.py**
- **partyParrotsBig.bmp**

Your Feather RP2350 **CIRCUITPY** drive should look like this after copying the **lib** folder, bitmap and the **code.py** file.

![CIRCUITPY](https://adafruit.github.io/Adafruit_Learning_System_Guides/RP2350_HSTX_Video_Synth.png )

## Code Inspiration

The code for this project uses [fast Fourier transform (FFT)](https://en.wikipedia.org/wiki/Fast_Fourier_transform) to sample the incoming audio&nbsp;over time and turn the samples into a list of the different frequencies that are present in the sound. The foundation for the video synth was based on the [Mini LED Matrix Audio Visualizer project code by Phil B](https://learn.adafruit.com/mini-led-matrix-audio-visualizer/code-the-audio-spectrum-light-show)., which uses FFT for a bar graph audio visualizer on an LED matrix. This animation was ported to this project and laid the foundation for the bouncing circles animation and the party parrot animation.

### Mini LED Matrix Audio Visualizer - Code the Audio Spectrum Light Show

[Mini LED Matrix Audio Visualizer](https://learn.adafruit.com/mini-led-matrix-audio-visualizer)
[Code the Audio Spectrum Light Show](https://learn.adafruit.com/mini-led-matrix-audio-visualizer/code-the-audio-spectrum-light-show)
## How the Code Works

The three potentiometers are instantiated as analog inputs. The values from the potentiometers determine different visual parameters for each of the three animations (modes). These values are stored in lists called&nbsp;`mode#_values[]`. These three lists are then stored in the `mode_vals[]` list.

```python
# ------ POTENTIOMETER SETUP ------
pot1 = AnalogIn(board.A1)
pot2 = AnalogIn(board.A2)
pot3 = AnalogIn(board.A3)
read_pots = True
# ------ POTENTIOMETER MODE VALUES ------
mode0_values = [0, 0, 0]
mode1_values = [0, 0, 0]
mode2_values = [0, 0, 0]
mode_vals = [mode0_values, mode1_values, mode2_values]
# ------ POTENTIOMETER READ FUNCTION ------
def val(pin):
    return pin.value
```

## seesaw Rotary Encoder

The mode is changed with the seesaw rotary encoder. The button on the rotary encoder controls the state of&nbsp;`read_pots`. If `read_pots` is `True`, then the potentiometers control parameters in the animations. If its `False`, then the default parameters run and the potentiometers do not control any of the parameters.

```python
# ------ SEESAW ENCODER ------
i2c = board.STEMMA_I2C()
seesaw = seesaw.Seesaw(i2c, addr=0x36)
seesaw_product = (seesaw.get_version() >> 16) & 0xFFFF
print("Found product {}".format(seesaw_product))
if seesaw_product != 4991:
    print("Wrong firmware loaded?  Expected 4991")
seesaw.pin_mode(24, seesaw.INPUT_PULLUP)
button = digitalio.DigitalIO(seesaw, 24)
button_held = False
encoder = rotaryio.IncrementalEncoder(seesaw)
last_position = 0
```

## PicoDVI

The PicoDVI framebuffer is setup using the HSTX pins and the PDM mic is instantiated along with its recording buffer.

```python
# ------ PICODVI SETUP ------
displayio.release_displays()
fb = picodvi.Framebuffer(320, 240, clk_dp=board.CKP, clk_dn=board.CKN,
                         red_dp=board.D0P, red_dn=board.D0N,
                         green_dp=board.D1P, green_dn=board.D1N,
                         blue_dp=board.D2P, blue_dn=board.D2N,
                         color_depth=8)
display = framebufferio.FramebufferDisplay(fb, auto_refresh=False)

# ------ PDM MIC ------
mic = PDMIn(board.D5, board.D6, sample_rate=44100, bit_depth=16)
rec_buf = array("H", [0] * fft_size)
```

## Variables and States

A few shared variables are created that are used across all three animations.

```python
# ------ SHARED VARIABLES ------
fft_size = 512
low_bin = 15
high_bin = 75
low_band = (15, 75)
mid_band = (100, 120)
spectrum_size = fft_size // 2
spectrum_bits = log(spectrum_size, 2)
mode = 0
new_mode = True
states = {}
```

## The Animations

There are three animations: bars, bouncing circles and party parrots. Each animation has two associated functions: an initialization and the actual animation. The initialization is run once when the mode is changed to populate a dictionary with needed values. The actual animation function runs a single frame of the animation and runs during an associated mode. Mode 0 is bars, 1 is bouncing circles and 2 is party parrots.

## The Loop

In the loop, the rotary encoder is polled to control the value of `mode`. The value is set to either `0`, `1` or `2`.

```python
# ------ THE LOOP ------
while True:
    # read encoder - if value != then change mode
    position = -encoder.position
    if position != last_position:
        if position > last_position:
            mode = (mode + 1) % 3
        else:
            mode = (mode - 1) % 3
        new_mode = True
        last_position = position
```

The button on the rotary encoder controls the state of `read_pots`. This state affects whether the animations are controlled by the three analog potentiometers or if they use their default values.

```python
# encode button - switch between reading potentiometer
    # to control animations or using default values
    if not button.value and not button_held:
        button_held = True
        read_pots = not read_pots
        print("Button pressed")
    if button.value and button_held:
        button_held = False
        print("Button released")
```

If the rotary encoder selects a new mode, then the associated initialize function is run to start up the new animation.

```python
# if a new mode is selected, run init function
    if new_mode:
        new_mode = False
        print(f"switching modes! {mode}")
        del states
        gc.collect()
        display.refresh()
        if mode == 0:
            initialize_bars()
        if mode == 1:
            initialize_circles()
        if mode == 2:
            initialize_party()
```

While the `mode` is set, the associated animation runs. Each potentiometer is mapped to a specific set of values. The list of values and the state of `read_pots` is passed to each animation function.

```python
# mode 0 - bar graph visualizer
    if mode == 0:
        bars(mode0_values, read_pots)
        # pot 1 - control color of bouncing dot
        color = simpleio.map_range(val(pot1), 0, 65535, 0, 255)
        mode_vals[0][0] = color
        # pot 2 - raise/lower noise floor
        noise = simpleio.map_range(val(pot2), 0, 65535, 2.5, 4.5)
        mode_vals[0][1] = noise
        # pot 3 - smooth bar animation
        smooth = simpleio.map_range(val(pot3), 0, 65535, 0.5, 0.05)
        mode_vals[0][2] = smooth
    # mode 1 - bouncing circles visualizer
    if mode == 1:
        bouncing_circles(mode1_values, read_pots)
        # pot 1 - control color of center circle
        color = simpleio.map_range(val(pot1), 0, 65535, 0, 255)
        mode_vals[1][0] = color
        # pot 2 - raise/lower noise floor
        noise = simpleio.map_range(val(pot2), 0, 65535, 2.5, 4.5)
        mode_vals[1][1] = noise
        # pot 3 - smooth circle size change
        smooth = simpleio.map_range(val(pot3), 0, 65535, 0.8, 0.4)
        mode_vals[1][2] = smooth
    # mode 2 - party parrot synth wave
    if mode == 2:
        party_parrot(mode2_values, read_pots)
        # pot 1 - control color of side circles
        color = simpleio.map_range(val(pot1), 0, 65535, 0, 255)
        mode_vals[2][0] = color
        # pot 2 - mid & low end noise floor aka parrot sensitivity
        dynamic = simpleio.map_range(val(pot2), 0, 65535, 3.0, 6.0)
        mode_vals[2][1] = dynamic
        # pot 3 - size of side circles
        rad = simpleio.map_range(val(pot3), 0, 65535, 2, 12)
        mode_vals[2][2] = rad
```

# Feather RP2350 Audio Reactive Video Synth

## Wiring

![](https://cdn-learn.adafruit.com/assets/assets/000/133/717/medium800/feather_edited_P1450471.jpg?1732137395)

The potentiometers are soldered in the reverse order from how they will be mounted in the case, starting with potentiometer 3.

## Potentiometer 3
Cut, splice and tin three pieces of wire. Solder a piece of wire to the positive, wiper and GND pins on the potentiometer.

![feather_edited_P1450486.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/718/medium640/feather_edited_P1450486.jpg?1732137403)

Cut, splice and tin two more pieces of wire. Solder a piece to the positive pin and the other to the GND pin. These two wires will daisy chain the power and GND connections to the next potentiometer.

![feather_edited_P1450487.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/719/medium640/feather_edited_P1450487.jpg?1732137440)

Apply heat shrink to the three solder joints.

![feather_edited_P1450489.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/720/medium640/feather_edited_P1450489.jpg?1732137498)

## Potentiometer 2
1. Slide a piece of heat shrink onto the daisy chain GND and power wires **before** soldering them to potentiometer 2.
2. Then, solder the daisy chain GND wire to the GND pin and the power wire to the positive pin.
3. Solder a wire to the wiper pin.
4. Solder a new piece of wire to the positive pin and another new piece to the GND pin. These will bring power and ground to potentiometer 1.

![feather_edited_P1450493.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/721/medium640/feather_edited_P1450493.jpg?1732137541)

Slip the two new wires into the heat shrink for the positive and GND pins. Apply heat shrink to all three pins.

![feather_edited_P1450495.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/722/medium640/feather_edited_P1450495.jpg?1732137760)

## Potentiometer 1
1. Slide a piece of heat shrink onto the daisy chain GND and power wires&nbsp; **before** &nbsp;soldering them to potentiometer 1.
2. Solder the GND wire to the GND pin and the power wire to the positive pin.
3. Solder a wire to the wiper pin.
4. Apply heat shrink to all three pins.

![feather_edited_P1450499.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/723/medium640/feather_edited_P1450499.jpg?1732137865)

Your three potentiometers should look like the photo below with daisy chained power and ground connections between them.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/724/medium800/feather_edited_P1450501.jpg?1732137939)

## Potentiometers to Feather Wiring
1. Solder the power input wire from potentiometer 1 to 3.3V on the Feather (red wire).
2. Solder the GND input wire from potentiometer 1 to GND on the Feather (black wire).
3. Solder potentiometer 1 wiper pin to Feather pin A1 (green wire).
4. Solder potentiometer 2 wiper pin to Feather pin A2 (yellow wire).
5. Solder potentiometer 3 wiper pin to Feather pin A3 (white wire).

![feather_edited_P1450505.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/725/medium640/feather_edited_P1450505.jpg?1732137988)

## PDM STEMMA Cable
The PDM mic will connect to the Feather using a STEMMA QT to plug cable. **Note that the mic does not plug into the STEMMA port!**

![feather_edit4209-10.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/726/medium640/feather_edit4209-10.jpg?1732138586)

Solder the red plug wire from the STEMMA QT cable to the positive line on potentiometer 3. Solder the black plug wire from the STEMMA QT cable to the GND line on potentiometer 3. You can use the round solder pads as a solder point.

![feather_edited_P1450510.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/727/medium640/feather_edited_P1450510.jpg?1732138931)

Solder the yellow plug wire from the STEMMA QT cable to pin D6 on the Feather. Solder the blue plug wire from the STEMMA QT cable to pin D5 on the Feather.

![feather_edited_P1450511.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/728/medium640/feather_edited_P1450511.jpg?1732139129)

# Feather RP2350 Audio Reactive Video Synth

## Assembly

## Mount the Potentiometers
Mount the three potentiometers into the main body of the case. Potentiometer 1 should be mounted in the second hole from the left, potentiometer 2 in the third hole from the left and potentiometer 3 in the last hole on the right.

![feather_edited_P1450519.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/764/medium640/feather_edited_P1450519.jpg?1732221141)

![feather_edited_P1450520.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/765/medium640/feather_edited_P1450520.jpg?1732221147)

## Rotary Encoder
Add a nut to the rotary encoder shaft. This will act as a spacer when mounting it in the case so that it does not interfere with the potentiometer.

![feather_edited_P1450521.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/766/medium640/feather_edited_P1450521.jpg?1732221211)

Plug a STEMMA QT cable into the seesaw rotary encoder.

![feather_edited_P1450516.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/769/medium640/feather_edited_P1450516.jpg?1732221280)

Mount the rotary encoder into the remaining mounting hole on the case.

![feather_edited_P1450522.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/770/medium640/feather_edited_P1450522.jpg?1732221302)

Plug the rotary encoder STEMMA QT cable into the STEMMA port on the Feather.

![feather_edited_P1450524.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/771/medium640/feather_edited_P1450524.jpg?1732221328)

## Case Lid and Microphone Enclosure
Attach the microphone base to the case lid with two M2.5 screws and nuts.

![feather_edited_P1450530.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/772/medium640/feather_edited_P1450530.jpg?1732221349)

![feather_edited_P1450532.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/773/medium640/feather_edited_P1450532.jpg?1732221354)

Insert the microphone cover into the microphone case.

![feather_edited_P1450533.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/774/medium640/feather_edited_P1450533.jpg?1732221387)

Attach the microphone case to the microphone base by placing it over the notches and turning it so that it is facing out towards the longer edge of the case lid.

![feather_edited_P1450538.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/775/medium640/feather_edited_P1450538.jpg?1732221408)

Feed the microphone STEMMA cable up through the microphone base and plug it into the PDM mic.

![feather_edited_P1450542.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/776/medium640/feather_edited_P1450542.jpg?1732221473)

## HSTX to DVI Breakout
Attach the HSTX to DVI breakout to the Feather with the 22-pin FPC flex cable. The breakout end of the cable should have the blue side facing up. The Feather end of the cable should have the blue side facing down.

![feather_edited_P1450554.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/777/medium640/feather_edited_P1450554.jpg?1732221516)

Attach the HSTX to DVI breakout into the standoffs on the lid of the case with four M2.5 screws.

![feather_edited_P1450548.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/778/medium640/feather_edited_P1450548.jpg?1732221657)

Attach the Feather to the mounting holes on the bottom lid of the case with four M2.5 screws.

![feather_edited_P1450558.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/779/medium640/feather_edited_P1450558.jpg?1732221699)

## PDM Mic
Attach the PDM mic to the back lid of the microphone enclosure with two M2.5 screws. Close the microphone enclosure by snapping in the back lid.

![feather_edited_P1450559.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/780/medium640/feather_edited_P1450559.jpg?1732221726)

![feather_edited_P1450561.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/781/medium640/feather_edited_P1450561.jpg?1732221732)

## Final Touches
Finish up the assembly by adding some potentiometer knobs to the rotary encoder and potentiometers.

![feather_edited_P1450565.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/782/medium640/feather_edited_P1450565.jpg?1732221765)

# Feather RP2350 Audio Reactive Video Synth

## Use

![](https://cdn-learn.adafruit.com/assets/assets/000/133/789/medium800/feather_edited_P1450569.jpg?1732299336)

After assembly, power the Feather via the USB input and plug the DVI output into a DVI/HDMI monitor with an HDMI cable. When it powers up, you should see the bouncing bar animation on the display.

https://www.youtube.com/watch?v=CbIOWOS7l7U

Use the rotary encoder to change between the three animation modes.

![feather_vidSynthHere.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/788/medium640thumb/feather_vidSynthHere.jpg?1732298788)

The bouncing bar animation is an audio EQ visualizer. The 16 bars are associated with 16 different frequency bands.

The first potentiometer changes the color of the bouncing dot at the top of the bars. The second potentiometer controls the noise floor aka the minimum amplitude that reads an an input with the PDM mic. The third potentiometer smooths the animation. You can have the bars be very jumpy as they react to the audio or do more of a slide.

![feather_barAnimation.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/785/medium640thumb/feather_barAnimation.jpg?1732296913)

The bouncing circles animation builds on the bouncing bar animation. 16 circles bounce around the display. Each circle is assigned to an audio frequency. When that frequency is read, the circle increases in size depending on how loud it is. The circle in the center changes size depending on the overall amplitude.

The first potentiometer changes the color of the center circle. The second potentiometer controls the noise floor threshold for the animation. The third potentiometer affects how quickly the circles go back to their default small size.

![feather_circles.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/786/medium640thumb/feather_circles.jpg?1732298001)

The third and final animation is the party parrot synthwave vibe. A party parrot sits atop a scrolling synthwave inspired grid landscape. In the upper corners, two circles change shape depending on the overall amplitude of the incoming audio. The party parrot has a twist: it advances frames when a midband and/or low end frequency are registered. These two frequencies are often where snare drums and bass drums sit in a music mix. As a result, the party parrot dances with the percussion.

The first potentiometer changes the color of the corner circles. The second potentiometer controls the noise floor threshold for the party parrot frequencies. If you turn it all the way down, the party parrot will automatically advance frames and basically play as an animated sprite. The third potentiometer affects the maximum size of the corner circles.

![feather_party.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/787/medium640thumb/feather_party.jpg?1732298474)

https://www.youtube.com/watch?v=CbIOWOS7l7U


## Guide Products

### Adafruit Feather RP2350 with HSTX Port

[Adafruit Feather RP2350 with HSTX Port](https://www.adafruit.com/product/6000)
RP2350&nbsp;flies high with the&nbsp;Feather&nbsp;format - now you can use any FeatherWings with this battery-powered dev board. It comes with 8MB of flash, 22pin HSTX output port, Stemma QT, debug SWD, and optional PSRAM spot. It's our first RP2350 board and we crammed a ton of goodies...

In Stock
[Buy Now](https://www.adafruit.com/product/6000)
[Related Guides to the Product](https://learn.adafruit.com/products/6000/guides)
### Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays

[Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays](https://www.adafruit.com/product/6055)
You may have noticed that our [RP2350 Feather](https://www.adafruit.com/product/6000) has an FPC output connector on the end&nbsp;for accessing the HSTX (High Speed Transmission)&nbsp;peripheral. This new capability, not available on the RP2040, is specifically designed to allow the...

In Stock
[Buy Now](https://www.adafruit.com/product/6055)
[Related Guides to the Product](https://learn.adafruit.com/products/6055/guides)
### Adafruit PDM Microphone Breakout with JST SH Connector

[Adafruit PDM Microphone Breakout with JST SH Connector](https://www.adafruit.com/product/4346)
An exotic new microphone has arrived in the Adafruit shop, a **PDM MEMS Microphone**! PDM is the 'third' kind of microphone you can integrate with electronics, apart from analog or I2S. These microphones are very commonly used in products, but are rarely seen in maker...

In Stock
[Buy Now](https://www.adafruit.com/product/4346)
[Related Guides to the Product](https://learn.adafruit.com/products/4346/guides)
### Panel Mount 10K Log Potentiometer (Breadboard Friendly)

[Panel Mount 10K Log Potentiometer (Breadboard Friendly)](https://www.adafruit.com/product/3391)
This potentiometer is a two-in-one, good in a breadboard or with a panel. It's a **log taper** 10K ohm potentiometer, with a grippy shaft. It's smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2" apart...

In Stock
[Buy Now](https://www.adafruit.com/product/3391)
[Related Guides to the Product](https://learn.adafruit.com/products/3391/guides)
### Adafruit I2C Stemma QT Rotary Encoder Breakout with Encoder

[Adafruit I2C Stemma QT Rotary Encoder Breakout with Encoder](https://www.adafruit.com/product/5880)
Rotary encoders are soooo much fun! Twist em this way, then twist them that way. Unlike potentiometers, they go all the way around and often have little detents for tactile feedback. But, if you've ever tried to add encoders to your project you know that they're a real challenge to...

In Stock
[Buy Now](https://www.adafruit.com/product/5880)
[Related Guides to the Product](https://learn.adafruit.com/products/5880/guides)
### Clear Micro Potentiometer Knob - 4 pack

[Clear Micro Potentiometer Knob - 4 pack](https://www.adafruit.com/product/5676)
Have you found yourself in a maze of twisty-turny knobs, all alike? These micro potentiometer&nbsp;(or rotary encoder) knobs offer a rainbow burst of color to your synth or control panel. They are made of a hard plastic, with a grippy star shape. The shape is...

In Stock
[Buy Now](https://www.adafruit.com/product/5676)
[Related Guides to the Product](https://learn.adafruit.com/products/5676/guides)
### 22-pin 0.5mm pitch FPC Flex Cable for DSI CSI or HSTX - 10cm

[22-pin 0.5mm pitch FPC Flex Cable for DSI CSI or HSTX - 10cm](https://www.adafruit.com/product/6035)
Connect this to that when a 22-pin FPC connector is needed. This 10 cm long cable is made of a flexible PCB. It's A-B style, meaning that pin one on one side will match with pin one on the other. How handy!

[We're stocking this to...](https://www.adafruit.com/category/360)

In Stock
[Buy Now](https://www.adafruit.com/product/6035)
[Related Guides to the Product](https://learn.adafruit.com/products/6035/guides)
### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert...

In Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)

## Related Guides

- [Adafruit I2C QT Rotary Encoder](https://learn.adafruit.com/adafruit-i2c-qt-rotary-encoder.md)
- [Adafruit Feather RP2350 with HSTX](https://learn.adafruit.com/adafruit-feather-rp2350.md)
- [Adafruit RP2350 22-pin FPC HSTX to DVI Adapter](https://learn.adafruit.com/adafruit-rp2350-22-pin-fpc-hstx-to-dvi-adapter.md)
- [Solderless Robot Toy Xylophone](https://learn.adafruit.com/solderless-robot-toy-xylophone.md)
- [CircuitPython OctoPrint Controller and Monitor](https://learn.adafruit.com/circuitpython-octoprint-controller-and-monitor.md)
- [Fruit Jam, Zork and the Z Machine](https://learn.adafruit.com/zork-and-the-z-machine.md)
- [JOY Controller for Adafruit Feather](https://learn.adafruit.com/joy-controller-feather.md)
- [Square NeoPixel Display with Black LED Acrylic](https://learn.adafruit.com/sqaure-neopixel-display-with-black-led-acrylic.md)
- [Wireless ESP32-S2 Touch Screen Controller for Pure Data](https://learn.adafruit.com/wireless-esp32-s2-controller-for-pure-data.md)
- [PyPortal Titano Weather Station](https://learn.adafruit.com/pyportal-titano-weather-station.md)
- [ItsyBitsy ESP32 wFL case](https://learn.adafruit.com/itsybitsy-esp32-wfl-case.md)
- [PyPortal Pet Planter with Adafruit IO](https://learn.adafruit.com/pyportal-pet-planter-with-adafruit-io.md)
- [CYBERDECK Bonnet and HAT for Raspberry Pi 400](https://learn.adafruit.com/cyberdeck-bonnet-and-hat.md)
- [Adafruit Wii Nunchuck Breakout Adapter](https://learn.adafruit.com/adafruit-wii-nunchuck-breakout-adapter.md)
- [Temperature and Humidity Sensing in Home Assistant with CircuitPython](https://learn.adafruit.com/temperature-and-humidity-sensing-in-home-assistant-with-circuitpython.md)
- [Adafruit ESP32-S3 TFT Feather](https://learn.adafruit.com/adafruit-esp32-s3-tft-feather.md)
- [Circle of Fifths Euclidean Synth with synthio and CircuitPython](https://learn.adafruit.com/circle-of-fifths-euclidean-synth-with-synthio-and-circuitpython.md)
- [No-Code IoT Humidity and Temperature Sensor with Adafruit IO WipperSnapper](https://learn.adafruit.com/no-code-humidity-and-temp-tracker.md)
