# Computer Perfection Synthesizer

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/121/495/medium800/hacks_compperf-2036.jpg?1685678994)

![](https://cdn-learn.adafruit.com/assets/assets/000/121/437/medium800/hacks_compperf-3315.jpg?1685546688)

https://youtu.be/PmIr5AsGhzI

When PT [discovered this beautiful artifact from 1979](https://www.youtube.com/watch?v=v-xNzPhSHjU), the Computer Perfection electronic memory game, we knew we had to transform it into a sci-fi drone synthesizer!

Luckily, this coincided with Jepler's work on the CircuitPython `synthio` library and the release of the Metro M7 -- a perfect confluence of events!

This project takes the Computer Perfection and reuses its buttons and switches to trigger a polyphonic, multi-timbral wavetable synthesizer for all your spacey jam sessions. It includes ADSR envelopes and LFO modulation for a beautiful, other-worldly sound.

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

## Parts
### Adafruit Metro M7 with AirLift - Featuring NXP iMX RT1011

[Adafruit Metro M7 with AirLift - Featuring NXP iMX RT1011](https://www.adafruit.com/product/4950)
Get ready for our fastest Metro ever - the NXP iMX RT1011 microcontroller powers this board with a 500 MHz ARM Cortex M7 processor. There's 8 MB of execute-in-place QSPI for firmware + disk storage and 128KB of SRAM in-chip, plus a WiFi co-processor using an on-board&nbsp;ESP32...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4950)
[Related Guides to the Product](https://learn.adafruit.com/products/4950/guides)
![Adafruit Metro M7 with AirLift - Featuring NXP iMX RT1011.](https://cdn-shop.adafruit.com/640x480/4950-08.jpg)

### Ultra Skinny NeoPixel 1515 LED Strip 4mm wide

[Ultra Skinny NeoPixel 1515 LED Strip 4mm wide](https://www.adafruit.com/product/4368)
We have all&nbsp;sorts of LED strips for a wide range of needs. [_Chonky_](https://www.adafruit.com/product/3869) strips? We got those! [Strips with alligator clips](https://www.adafruit.com/?q=neopixel%20alligator%20clips%20stripping%20wires) that are easy-peasy...

In Stock
[Buy Now](https://www.adafruit.com/product/4368)
[Related Guides to the Product](https://learn.adafruit.com/products/4368/guides)
![Curved NeoPixel LED strip wired to arduino, with each LED changing to a different color in the rainbow](https://cdn-shop.adafruit.com/product-videos/640x480/4368-07.jpg)

### Proto-Screwshield (Wingshield) R3 Kit for Arduino

[Proto-Screwshield (Wingshield) R3 Kit for Arduino](https://www.adafruit.com/product/196)
The next generation Proto-ScrewShield is a dual-purpose prototyping shield. Not&nbsp;only does it have a large 0.1" grid prototyping area but it also extends the Arduino pins to sturdy, secure, and dependable screw terminal blocks. You even get a few bonus terminals for extra GND and four...

Out of Stock
[Buy Now](https://www.adafruit.com/product/196)
[Related Guides to the Product](https://learn.adafruit.com/products/196/guides)
![Angled shot of Proto-Screwshield (Wingshield) R3 Kit.](https://cdn-shop.adafruit.com/640x480/196-00.jpg)

### Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A

[Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A](https://www.adafruit.com/product/3006)
Listen to this good news - we now have an all in one digital audio amp breakout board that works incredibly well with the&nbsp;[Raspberry Pi](https://www.adafruit.com/category/105)! If you're looking for an easy and low cost way to get your digital sound files...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3006)
[Related Guides to the Product](https://learn.adafruit.com/products/3006/guides)
![Angled shot of blue, square-shaped, amplifier breakout with a pre-soldered terminal block.](https://cdn-shop.adafruit.com/640x480/3006-04.jpg)

### Mono Enclosed Speaker with Plain Wires - 3W 4 Ohm

[Mono Enclosed Speaker with Plain Wires - 3W 4 Ohm](https://www.adafruit.com/product/4445)
Listen up! This single&nbsp; 2.8" x 1.2" speaker&nbsp;is&nbsp;the perfect addition to any audio project where you need 4 ohm impedance and 3W or less of power. We particularly like these speakers as they are small and enclosed for good audio volume and quality. This speaker _does..._

In Stock
[Buy Now](https://www.adafruit.com/product/4445)
[Related Guides to the Product](https://learn.adafruit.com/products/4445/guides)
![Enclosed Speaker with wires](https://cdn-shop.adafruit.com/640x480/4445-01.jpg)

### [28-position DIP Connector](https://www.digikey.com/en/products/detail/harting/09170289622/4335498)

You'll use this to wire the buttons and switches to the Metro M7 using the original DIP socket.

![hacks_Screenshot_2023-05-30_at_4.33.34_PM.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/324/medium640/hacks_Screenshot_2023-05-30_at_4.33.34_PM.jpg?1685489650)

### Part: DIY USB Cable Parts - Straight Type C Plug
quantity: 1
DIY USB Cable Parts
[DIY USB Cable Parts - Straight Type C Plug](https://www.adafruit.com/product/4108)

### Part: DIY USB Cable Parts 
quantity: 1
Straight Micro B Jack
[DIY USB Cable Parts ](https://www.adafruit.com/product/4107)

### Part: DIY USB or HDMI Cable Parts
quantity: 1
20 cm Ribbon Cable
[DIY USB or HDMI Cable Parts](https://www.adafruit.com/product/3561)

### Part: Woven USB A Cable with Magnetic Tips
quantity: 1
Micro B, Type C, and iOS
[Woven USB A Cable with Magnetic Tips](https://www.adafruit.com/product/5652)

### Part: Clear Adhesive Squares
quantity: 1
6 pack
[Clear Adhesive Squares](https://www.adafruit.com/product/4813)

### Part: Thick Double-Sided Rectangle Foam Tape
quantity: 1
2 pieces
[Thick Double-Sided Rectangle Foam Tape](https://www.adafruit.com/product/5019)

# Computer Perfection Synthesizer

## 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/metro_m7_1011/)
 **Click the link above to download the latest CircuitPython UF2 file.**

Save it wherever is convenient for you.

![install_circuitpython_on_most_boards_CircuitPython_downloaded.jpg](https://cdn-learn.adafruit.com/assets/assets/000/102/129/medium640/install_circuitpython_on_most_boards_CircuitPython_downloaded.jpg?1620922559)

![](https://cdn-learn.adafruit.com/assets/assets/000/119/384/medium800/adafruit_products_resetWithNeo.jpg?1678478725)

Plug your board into your computer, using a known-good data-sync cable, directly, or via an adapter if needed.

Click the **reset** button once (highlighted in red above), and then click it again when you see the **RGB status LED(s)** (highlighted in green above) turn purple (approximately half a second later). Sometimes it helps to think of it as a "slow double-click" of the reset button.

If you do not see the LED turning purple, you will need to reinstall the UF2 bootloader. See the&nbsp; **Factory Reset** &nbsp;page in this guide for details.

On some very old versions of the UF2 bootloader, the status LED turns red instead of purple.

Once successful, you will see the **RGB status LED(s)** turn green (highlighted in green above), and a disk drive ending in " **...BOOT**" should appear on your host computer. If you see red, try another port, or if you're using an adapter or hub, try without the hub, or different adapter or hub.

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

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 **METROM7BOOT**.

&nbsp;

Drag the&nbsp; **adafruit\_circuitpython\_etc.uf2** &nbsp;file to **METROM7BOOT**.

![adafruit_products_metroboot.jpg](https://cdn-learn.adafruit.com/assets/assets/000/119/388/medium640/adafruit_products_metroboot.jpg?1678479294)

![adafruit_products_copyinguf2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/119/389/medium640/adafruit_products_copyinguf2.jpg?1678479527)

Copy or drag the UF2 file you downloaded to the **BOOT** drive.

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

That's it!

![install_circuitpython_on_most_boards_CIRCUITPY.jpg](https://cdn-learn.adafruit.com/assets/assets/000/102/130/medium640/install_circuitpython_on_most_boards_CIRCUITPY.jpg?1620923145)

# Computer Perfection Synthesizer

## Code the Computer Perfection Synth

## Text Editor

Adafruit recommends using the&nbsp; **Mu** &nbsp;editor for editing your CircuitPython code. You can get more info in&nbsp;[this guide](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Alternatively, you can use any text editor that saves simple text files.

## Download the Project Bundle

Your project will use a specific set of CircuitPython libraries, and the&nbsp; **code.py** &nbsp;file. To get everything you need, click on the&nbsp; **Download Project Bundle** &nbsp;link below, and uncompress the .zip file.

Connect your computer to the M7 board via a known good USB power+data cable. A new flash drive should show up as **CIRCUITPY**.

Drag the contents of the uncompressed bundle directory onto your board's&nbsp; **CIRCUITPY** &nbsp;drive, replacing any existing files or directories with the same names, and adding any new ones that are necessary.

![media](https://adafruit.github.io/Adafruit_Learning_System_Guides/Computer_Perfection_Synth.png )

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

## How it Works
## Libraries

First, we import the required libraries:

```auto
import time
import random
import board
import audiobusio
import audiomixer
import synthio
import ulab.numpy as np
import neopixel
import keypad
```

## NeoPixels

Next we initialize the NeoPixel strip with 34 pixels connected to pin **D11** on the board.

We also set up a list of the physical pixels that correspond to the game panel's 0-9 locations.

```auto
# NeoPixel setup
num_pixels = 34
pixels = neopixel.NeoPixel(board.D11, num_pixels, brightness=0.7, auto_write=False)
pixels.fill(0x0)
pixels.show()
time.sleep(0.25)
pix_map = [26, 23, 19, 16, 13, 10, 7, 4, 32, 29]  # map the LEDs to the numbered panel sections 0-9
for p in range(len(pix_map)):
    pixels[pix_map[p]] = 0xff0000
    pixels.show()
    time.sleep(0.1)
```

## Keypad

We'll use the keypad library to read the ten note buttons, two modifier buttons, and two switches.

```auto
note_buttons = keypad.Keys(
                            (board.D0, board.D1, board.D2, board.D3, board.D4,
                             board.D5, board.D6, board.D7, board.D8, board.A5),
                            value_when_pressed=False,
                            pull=True
)
switches = keypad.Keys(
                        (board.A1, board.A0),
                        value_when_pressed=False,
                        pull=True
)

mod_buttons = keypad.Keys(
                            (board.A4, board.A3),  # SET and SCORE buttons
                            value_when_pressed=False,
                            pull=True
)
```

## Notes

The synthio library can use MIDI note numbers or frequency to specify a note to play. In this project we'll use MIDI note numbers as they're easier to adjust for interval/scale choices.

This `note_list` contains the ten notes we'll play, and the `octave` variable specifies which octave to play them in.

```auto
octave = 3  # octave multiplier
note_list = (0, 4, 6, 7, 9, 12, 16, 18, 19, 21)  # Lydian scale
```

## I2S Amp

The I2S amp is set up on three pins of the Metro M7 (this can vary for other boards).

```auto
lck_pin, bck_pin, dat_pin = board.D9, board.D10, board.D12
```

## Synth Setup

The `synthio` object is set up with the sample rate, sample size, volume, initial waveform, and audiobus/audiomixer objects.

```auto
SAMPLE_RATE = 48000  # clicks @ 36kHz &amp; 48kHz on rp2040
SAMPLE_SIZE = 200
VOLUME = 12000

# synth engine setup
waveform = np.zeros(SAMPLE_SIZE, dtype=np.int16)  # intially all zeros (silence)

amp_env = synthio.Envelope(  # default (0.1, 0.05, 0.2, 1, 0.8)
                            attack_time=1.0,
                            decay_time=0.05,
                            release_time=3.0,
                            attack_level=1.0,
                            sustain_level=0.8
)

synth = synthio.Synthesizer(sample_rate=SAMPLE_RATE, waveform=waveform, envelope=amp_env)
audio = audiobusio.I2SOut(bit_clock=bck_pin, word_select=lck_pin, data=dat_pin)
mixer = audiomixer.Mixer(voice_count=1, sample_rate=SAMPLE_RATE, channel_count=1,
                         bits_per_sample=16, samples_signed=True, buffer_size=8192)
audio.play(mixer)
mixer.voice[0].level = 0.55
mixer.voice[0].play(synth)
```

## Waveforms

Different waveforms have different harmonics, which is what provides the "character" or timbre of an instrument. We'll use `sine`, `saw`, and the `weird1` wavetable, and noise waveforms, which can be mixed between using the LFO modulator.

All of these waveforms are defined mathematically, except for the `weird1` which is defined with an array of discreet points.

```auto
# waveforms setup
wave_sine = np.array(np.sin(np.linspace(0, 2*np.pi, SAMPLE_SIZE, endpoint=False)) * VOLUME,
            dtype=np.int16)
wave_saw = np.linspace(VOLUME, -VOLUME, num=SAMPLE_SIZE, dtype=np.int16)
wave_weird1 = np.array((198,2776,5441,8031,10454,12653,14609,16333,17824,19130,20260,21227,22043,
                        22721,23269,23699,24019,24243,24385,24461,18630,-26956,-28048,-29175,-30249,
                        -31227,-32073,-32631,-32359,-31817,-30941,-29663,-27900,-25596,-22591,
                        -18834,-14291,-9016,-3212,2794,8624,13943,18544,22353,25408,27780,29553,
                        30855,31751,32315,32611,32687,32593,32351,31983,31491,30871,30097,28895,
                        -28240,-30489,-31343,-31975,-32431,-32697,-32767,-32615,-32217,-31525,
                        -30489,-29035,-27090,-24519,-21237,-17178,-12339,-6829,-902,5081,10748,
                        15805,20102,23615,26396,28510,30109,31245,31995,31955,31437,30729,29887,
                        28943,27908,26784,25560,24077,22781,-22207,-22735,-22709,-22471,-22065,
                        -21497,-20773,-19896,-18872,-17698,-16361,-14857,-13141,-11206,-9054,-6717,
                        -4259,-1796,522,2548,4167,5339,6079,6445,6503,6319,5949,5449,4847,4183,
                        3480,2756,2028,1304,590,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-478,-1168,-1882,-2596,
                        -3336,-4074,-4795,-5487,-6119,-6669,-7095,-7357,-7399,-7157,-6559,-5543,
                        -4076,-2132,), dtype=np.int16)
wave_noise = np.array([random.randint(-VOLUME, VOLUME) for i in range(SAMPLE_SIZE)], dtype=np.int16)

waveform[:] = wave_saw
wave_mix = 0.0
```

## Low Frequency Oscillator

A low frequency oscillator, or LFO, is a waveform with a frequency below the audible threshold. LFOs are often used to modulate other synthesizer parameters, such as the pitch or amplitude of an audio oscillator's waveform.

We'll run an LFO at different rates by pressing the SET button to cycle among them in the `lfo_rates` list.

The `lfo1` object is created with a rate and waveshape, in this case a `sine`, but this could be any shape you like, such as a triangle or saw.

```auto
lfo_rates = (0.1, 0.5, 0.8, 1.5, 3.0, 6.0, 7.0, 8.0)
lfo_index = 0
lfo1 = synthio.LFO(rate=(lfo_rates[lfo_index]), waveform=wave_sine)  # rate is in Hz
synth.lfos.append(lfo1)
```

## Helper Functions

We create a number of helper functions to control NeoPixels when buttons are pressed, remap and clamp values, and provide linear interpolation (lerp) between values.

```auto
# map s range a1-a2 to b1-b2
def map_range(s, a1, a2, b1, b2):
    return b1 + ((s - a1) * (b2 - b1) / (a2 - a1))

# mix between values a and b, works with numpy arrays too, t ranges 0-1
def lerp(a, b, t):
    return (1-t)*a + t*b

def light_button_pixels(button_number):
    pixels[pix_map[button_number]+1] = 0xFF0000
    pixels[pix_map[button_number]-1] = 0xFF0000
    pixels.show()

def reset_button_pixels(button_number):
    pixels[pix_map[button_number]+1] = 0x000000
    pixels[pix_map[button_number]-1] = 0x000000
    pixels.show()

def clamp(v, low, high):
    return min(max(v, low), high)
```

## Main Loop

The main loop of the program checks for button presses and switch events.

When a note button is pressed a corresponding synth note is played (and the NeoPixels surrounding the button position light up). You'll notice the notes have a short attack and a long release, thanks to the ADSR envelope values we created initially.

If the SCORE button is held, the note buttons will also play a unison note one octave down.

Pressing the SET button increments the LFO rate, while a long press decrements it.

Flipping the MODE switch changes the waveform pair that's mixed between.

When the SKILL switch is in the center position, all pressed notes will sustain indefinitely -- perfect for nice drone chords! In the non-center positions the notes will release when the note buttons are released.

```auto
# watch for mod buttons to be pressed
    mod_button_event = mod_buttons.events.get()
    if mod_button_event:
        mod_key = mod_button_event.key_number
        if mod_button_event.pressed:
            if mod_key == 0:  # SET switch
                last_mod_button_event_time = time.monotonic()

            if mod_key == 1:  # enable octaves
                octaves = True

        if mod_button_event.released:
            if last_mod_button_event_time and mod_key == 0:  # short press-release increase LFO rate
                lfo_index = clamp(lfo_index+1, 0, len(lfo_rates)-1)
                print(lfo_index)
                lfo_rate = lfo_rates[lfo_index]
                lfo1.rate = lfo_rate
                last_mod_button_event_time = 0
            if mod_key == 1:  # disable octaves
                octaves = False
    # long press slows the LFO rate
    if last_mod_button_event_time != 0 and time.monotonic() - last_mod_button_event_time &gt; 1.0:
        last_mod_button_event_time = 0
        lfo_index = clamp(lfo_index-1, 0, len(lfo_rates)-1)
        lfo_rate = lfo_rates[lfo_index]
        lfo1.rate = lfo_rate

    # watch for note buttons to be pressed
    note_button_event = note_buttons.events.get()
    if note_button_event:
        i = note_button_event.key_number
        if note_button_event.pressed:
            if octaves:
                synth.press((note_list[i]+(octave*12), note_list[i]+(octave*12)-12))
            else:
                synth.press((note_list[i]+(octave*12),))
            light_button_pixels(i)
        if note_button_event.released:
            if not hold:
                reset_button_pixels(i)
                synth.release((note_list[i]+(octave*12), note_list[i]+(octave*12)-12))
                reset_button_pixels(i)

    # watch for switches to be changed
    switch_event = switches.events.get()
    if switch_event:
        sw = switch_event.key_number
        if switch_event.pressed:
            if sw == 0:  # MODE toggle right
                mixer.voice[0].level = 0.45
                # wave_mix = 0.5
                waveset = 0
            if sw == 1:  # SKILL toggle center
                hold = True

        if switch_event.released:
            if sw == 0:  # MODE toggle center
                mixer.voice[0].level = 0.95
                waveset = 1
            if sw == 1:  # SKILL toggle right or left
                hold = False
                for r in range(len(note_list)):  # turn off all notes
                    # if octaves:
                    synth.release((note_list[r]+(octave*12), note_list[r]+(octave*12)-12))
                for h in range(len(pix_map)):  # turn off held pixels
                    reset_button_pixels(h)

    lfo_val_for_lerp = map_range(lfo1.value, -1, 1, 0, 1)
    if waveset == 0:
        waveform[:] = lerp(wave_sine, wave_weird1, lfo_val_for_lerp)
    else:
        waveform[:] = lerp(wave_saw, wave_noise, lfo_val_for_lerp)
```

# Computer Perfection Synthesizer

## Assemble the Computer Perfection Synth

## Open the Panel

Remove the two screws at the bottom of the top panel, then pivot the panel open.

![hacks_compperf-2039.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/325/medium640/hacks_compperf-2039.jpg?1685492799)

![hacks_compperf-2041.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/326/medium640/hacks_compperf-2041.jpg?1685492808)

![hacks_compperf-2042.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/327/medium640/hacks_compperf-2042.jpg?1685492815)

![hacks_compperf-2043.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/328/medium640/hacks_compperf-2043.jpg?1685492826)

## Remove PCB

Unscrew the four screws holding the game PCB in place.

![hacks_compperf-2045.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/329/medium640/hacks_compperf-2045.jpg?1685492917)

![hacks_compperf-2046.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/330/medium640/hacks_compperf-2046.jpg?1685492939)

## Desolder Wires

Desolder the two lid switch wires, as well as the two piezo buzzer wires.

![hacks_compperf-2051.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/331/medium640/hacks_compperf-2051.jpg?1685492982)

![hacks_compperf-2052.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/332/medium640/hacks_compperf-2052.jpg?1685492989)

## Remove Microcontroller

The Computer Perfection game ran on a 4-bit microcontroller, the Matsushita MN1400ML.

Carefully pry it up to remove it from the DIP socket. We won't be re-using the chip, but we will use the socket to connect all of the buttons and switches to our Metro M7. A rather large upgrade!

![hacks_compperf-2053.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/333/medium640/hacks_compperf-2053.jpg?1685493050)

![](https://cdn-learn.adafruit.com/assets/assets/000/121/339/medium800/hacks_compperf-3101.jpg?1685493192)

## Wiring Diagram

The Fritzing diagram and schematic below show the connections we'll make to use the Computer Perfection game's buttons and switches as GPIO inputs on the Metro M7.

You can also see the connections to the I2S amplifier and NeoPixels.

![](https://cdn-learn.adafruit.com/assets/assets/000/121/492/medium800/hacks_cp_breadboard.jpg?1685670595)

![](https://cdn-learn.adafruit.com/assets/assets/000/121/493/medium800/hacks_cp_schematic.jpg?1685670611)

## DIP Header Wiring

Rather than tediously solder wires to the underside of the board, we'll use this super cool DIP header that [Jan Goolsbey](https://learn.adafruit.com/u/cgrover) suggested.

These are designed to clamp down on flat ribbon wires, but in this case we'll use silicone sheathed wire for the necessary flexibility and low profile that'll allow the wire bundle to be routed out and under the board.

A pair of tweezers works well for pressing each wire into its pin slot -- no need to remove insulation, the pin does the work for you.

Using the Fritzing diagram as a guide, run each wire to its respective pad on the Proto-Screwshield.

![hacks_compperf-3102.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/344/medium640/hacks_compperf-3102.jpg?1685493200)

![hacks_compperf-3104.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/345/medium640/hacks_compperf-3104.jpg?1685493403)

![hacks_compperf-3110.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/361/medium640/hacks_compperf-3110.jpg?1685499564)

![](https://cdn-learn.adafruit.com/assets/assets/000/121/359/medium800/hacks_compperf-3113b.jpg?1685499304)

## Cap

Press the connector's cap into place.&nbsp;

![hacks_compperf-3117.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/363/medium640/hacks_compperf-3117.jpg?1685499804)

## Socket Connection

Paying attention to the orientation, place the DIN connector in the DIP socket, being careful to seat each leg so that nothing is misaligned or bent.

![hacks_compperf-3118.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/362/medium640/hacks_compperf-3118.jpg?1685499678)

Use tape to neatly dress the wiring off to the left side of the board.

![](https://cdn-learn.adafruit.com/assets/assets/000/121/365/medium800/hacks_compperf-3134.jpg?1685499850)

## Wiring Length

Remount the PCB to the Computer Perfection top panel so you can pull the wires to even length in the Proto-Screwshield.

Remove a bit of the insulation and solder each wire.

![hacks_compperf-3120.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/368/medium640/hacks_compperf-3120.jpg?1685499951)

![hacks_compperf-3121.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/369/medium640/hacks_compperf-3121.jpg?1685499970)

![hacks_compperf-3122.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/370/medium640/hacks_compperf-3122.jpg?1685500110)

![hacks_compperf-3123.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/371/medium640/hacks_compperf-3123.jpg?1685500125)

![](https://cdn-learn.adafruit.com/assets/assets/000/121/376/medium800/hacks_compperf-3125.jpg?1685500305)

## I2S Amp

To prep the I2S amp, first solder the header strip and terminal block [as shown here.](https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/assembly)

Solder a 7-pin section of socket header pins to the proto area of the Proto-Screwshield.

Run wires to pins D9, D10, D12, GND, and 3.3V as shown to correspond with the pins of the amplifier, connecting them to their respective pins on the headers.

Feed the speaker wires through the base and screw them into the terminal block.

Plug the amplifier into the board.

![hacks_compperf-3132.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/377/medium640/hacks_compperf-3132.jpg?1685500894)

![hacks_compperf-3133.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/378/medium640/hacks_compperf-3133.jpg?1685500912)

![hacks_compperf-3131.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/379/medium640/hacks_compperf-3131.jpg?1685500922)

![hacks_compperf-3140.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/380/medium640/hacks_compperf-3140.jpg?1685504561)

## Mount Speaker

Use a piece of double-stick foam tape to mount the speaker in the base as shown.

![hacks_compperf-3142.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/381/medium640/hacks_compperf-3142.jpg?1685545181)

![hacks_compperf-3143.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/382/medium640/hacks_compperf-3143.jpg?1685504636)

## NeoPixel Wiring

We can't re-use the existing LEDs on the board easily because they are wired to the same pins as the input buttons -- the original microcontroller pins toggled quickly between input and output to perform both functions -- so we'll upgrade the Computer Perfection with a strip of NeoPixels!

Solder terminal blocks to the Proto-Screwshield to accommodate the NeoPixel wiring to pin D11, GND, and 3.3V.

![hacks_compperf-3240.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/383/medium640/hacks_compperf-3240.jpg?1685545305)

![hacks_compperf-3247.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/384/medium640/hacks_compperf-3247.jpg?1685545394)

## LED Placement

Remove the PCB and test fit the NeoPixel strip, then cut off the excess as shown.

Use the uGlu dashes or other adhesive to affix the NeoPixels, running the wiring to the side as shown.

Put the PCB back onto the top panel.

![hacks_compperf-3284.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/385/medium640/hacks_compperf-3284.jpg?1685545709)

![hacks_compperf-3285.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/386/medium640/hacks_compperf-3285.jpg?1685545709)

![hacks_compperf-3288.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/387/medium640/hacks_compperf-3288.jpg?1685545807)

![hacks_compperf-3290.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/388/medium640/hacks_compperf-3290.jpg?1685545703)

![](https://cdn-learn.adafruit.com/assets/assets/000/121/389/medium800/hacks_compperf-3293.jpg?1685545868)

Screw the NeoPixel wires into their blocks and then you can plug the Proto Screwshield into the Metro M7.

![](https://cdn-learn.adafruit.com/assets/assets/000/121/399/medium800/hacks_compperf-3300.jpg?1685545973)

## USB Cable

Assemble the DIY USB cable USB-C end to the ribbon cable and plug it into the Metro M7.

Run the ribbon through the base as shown, then attach the micro-B socket.&nbsp;

![hacks_compperf-3294.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/400/medium640/hacks_compperf-3294.jpg?1685546142)

![hacks_compperf-3295.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/401/medium640/hacks_compperf-3295.jpg?1685546011)

![hacks_compperf-3296.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/402/medium640/hacks_compperf-3296.jpg?1685545807)

![hacks_compperf-3297.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/403/medium640/hacks_compperf-3297.jpg?1685546004)

![hacks_compperf-3311.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/404/medium640/hacks_compperf-3311.jpg?1685546177)

## Metro Placement

Use double-stick foam tape to adhere the Metro M7 to the inner base, then screw the top panel into place.

![hacks_compperf-3303.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/405/medium640/hacks_compperf-3303.jpg?1685546327)

![hacks_compperf-3301.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/406/medium640/hacks_compperf-3301.jpg?1685546216)

![hacks_compperf-3304.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/407/medium640/hacks_compperf-3304.jpg?1685546159)

## Magnetic USB Cable

You can optionally use a magnetic tipped USB cable to make the connections a bit easier.

![hacks_compperf-3312.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/408/medium640/hacks_compperf-3312.jpg?1685546189)

![hacks_compperf-3313.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/409/medium640/hacks_compperf-3313.jpg?1685546239)

![hacks_compperf-3314.jpg](https://cdn-learn.adafruit.com/assets/assets/000/121/410/medium640/hacks_compperf-3314.jpg?1685546287)

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

# Computer Perfection Synthesizer

## Play the Computer Perfection Synth

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

![](https://cdn-learn.adafruit.com/assets/assets/000/121/494/medium800/hacks_cp_usage.jpg?1685671466)

Playing the Computer Perfection synthesizer is satisfying and simple! There are just a few options to know about:

- Press any blue button to play a note. You can play multiple notes at once to create chords.
- If the Sustain (SKILL) switch is in position 3 or 1, the note will only sustain as long as you hold the button or buttons.
- Move the Sustain (SKILL) switch to the center position marked 2 and any new notes will drone indefinitely until you move the switch to the left or right.
- Hold the Sub-Octave (SCORE) button to add an additional note one octave below any new notes you play.
- Press and release the green LFO (SET) button to increase the LFO rate by one step in the rate list. Long-press (about a second) it to decrease the LFO rate by one step.
- Set the Waveform (MODE) switch to the center for one waveset or to the right for the other -- the wavesets contain two mixed waveforms that the LFO modulates between.
- Leave the GAME switch in the left-most position otherwise the other switches and buttons will misbehave.


## Featured Products

### Adafruit Metro M7 with AirLift - Featuring NXP iMX RT1011

[Adafruit Metro M7 with AirLift - Featuring NXP iMX RT1011](https://www.adafruit.com/product/4950)
Get ready for our fastest Metro ever - the NXP iMX RT1011 microcontroller powers this board with a 500 MHz ARM Cortex M7 processor. There's 8 MB of execute-in-place QSPI for firmware + disk storage and 128KB of SRAM in-chip, plus a WiFi co-processor using an on-board&nbsp;ESP32...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4950)
[Related Guides to the Product](https://learn.adafruit.com/products/4950/guides)
### Ultra Skinny NeoPixel 1515 LED Strip 4mm wide

[Ultra Skinny NeoPixel 1515 LED Strip 4mm wide](https://www.adafruit.com/product/4368)
We have all&nbsp;sorts of LED strips for a wide range of needs. [_Chonky_](https://www.adafruit.com/product/3869) strips? We got those! [Strips with alligator clips](https://www.adafruit.com/?q=neopixel%20alligator%20clips%20stripping%20wires) that are easy-peasy...

In Stock
[Buy Now](https://www.adafruit.com/product/4368)
[Related Guides to the Product](https://learn.adafruit.com/products/4368/guides)
### Proto-Screwshield (Wingshield) R3 Kit for Arduino

[Proto-Screwshield (Wingshield) R3 Kit for Arduino](https://www.adafruit.com/product/196)
The next generation Proto-ScrewShield is a dual-purpose prototyping shield. Not&nbsp;only does it have a large 0.1" grid prototyping area but it also extends the Arduino pins to sturdy, secure, and dependable screw terminal blocks. You even get a few bonus terminals for extra GND and four...

Out of Stock
[Buy Now](https://www.adafruit.com/product/196)
[Related Guides to the Product](https://learn.adafruit.com/products/196/guides)
### Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A

[Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A](https://www.adafruit.com/product/3006)
Listen to this good news - we now have an all in one digital audio amp breakout board that works incredibly well with the&nbsp;[Raspberry Pi](https://www.adafruit.com/category/105)! If you're looking for an easy and low cost way to get your digital sound files...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3006)
[Related Guides to the Product](https://learn.adafruit.com/products/3006/guides)
### DIY USB Cable Parts - Straight Type C Plug

[DIY USB Cable Parts - Straight Type C Plug](https://www.adafruit.com/product/4108)
If you love DIY cable-rigging, then these USB adapters are right up your alley! Making custom USB cables has never been easier. Just grab one of our [ribbon cables](https://www.adafruit.com/?q=diy%20usb%20ribbon), then swap and switch any of our USB adapters on each end using the...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4108)
[Related Guides to the Product](https://learn.adafruit.com/products/4108/guides)
### DIY USB or HDMI Cable Parts - 20 cm Ribbon Cable

[DIY USB or HDMI Cable Parts - 20 cm Ribbon Cable](https://www.adafruit.com/product/3561)
If you're looking to make a custom cable with any two of our USB or HDMI adapters, then you'll need to have these flex cables handy!&nbsp;Making custom cables has never been easier. Just grab one of these cables, then swap and switch any of the plug or socket adapters on each end using...

In Stock
[Buy Now](https://www.adafruit.com/product/3561)
[Related Guides to the Product](https://learn.adafruit.com/products/3561/guides)
### DIY USB Cable Parts - Straight Micro B Jack

[DIY USB Cable Parts - Straight Micro B Jack](https://www.adafruit.com/product/4107)
If you love DIY cable-rigging, then these USB adapters are right up your alley! Making custom USB cables has never been easier. Just grab one of our [ribbon cables](https://www.adafruit.com/?q=diy%20usb%20ribbon), then swap and switch any of our USB adapters on each end using the...

In Stock
[Buy Now](https://www.adafruit.com/product/4107)
[Related Guides to the Product](https://learn.adafruit.com/products/4107/guides)
### Woven USB A Cable with Magnetic Tips - Micro B, Type C, and iOS

[Woven USB A Cable with Magnetic Tips - Micro B, Type C, and iOS](https://www.adafruit.com/product/5652)
Some days we're feeling extra fancy here at the 'fruit warehouse, and we have a big soft spot for woven fabric cables. Like, peep&nbsp;[this fully reversible pink/purple Blinka-inspired cable](https://www.adafruit.com/product/4111)&nbsp;or&nbsp;<a...></a...>

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

## Related Guides

- [Adafruit MAX98357 I2S Class-D Mono Amp](https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp.md)
- [Adafruit Metro M7 1011 with AirLift](https://learn.adafruit.com/adafruit-metro-m7-with-airlift.md)
- [Raspberry Pi Zero NPR One Radio](https://learn.adafruit.com/raspberry-pi-zero-npr-one-radio.md)
- [Adafruit Feather RP2040 with DVI Output Port](https://learn.adafruit.com/adafruit-feather-rp2040-dvi.md)
- [Sous-vide controller powered by Arduino - The SousViduino!](https://learn.adafruit.com/sous-vide-powered-by-arduino-the-sous-viduino.md)
- [ESP-NOW Walkie Talkies](https://learn.adafruit.com/esp-now-walkie-talkies.md)
- [Ninja Timer: Giant 7-Segment Display](https://learn.adafruit.com/ninja-timer-giant-7-segment-display.md)
- [ Analog IC Insights On-the-Go by Maxim Integrated](https://learn.adafruit.com/maxim-app.md)
- [Neon LED Signs](https://learn.adafruit.com/led-neon-signs.md)
- [Ambient Sound Machine](https://learn.adafruit.com/ambient-machine.md)
- [Circle of Fifths Euclidean Synth with synthio and CircuitPython](https://learn.adafruit.com/circle-of-fifths-euclidean-synth-with-synthio-and-circuitpython.md)
- [Bluetooth Restroom Key Proximity Tracker](https://learn.adafruit.com/bluetooth-restroom-key-proximity-tracker.md)
- [Robotic AI Bear using ChatGPT](https://learn.adafruit.com/robotic-ai-bear-using-chatgpt.md)
- [Bluefruit Ouija Board](https://learn.adafruit.com/bluefruit-ouija-board.md)
- [Installing TinyUF2 bootloader on RT10xx Microcontrollers](https://learn.adafruit.com/installing-the-uf2-bootloader-on-nxp-imx-rt10xx-microcontrollers.md)
