On the bench / Setup guide
First boot.
First checks.
Prepare a 64-bit Raspberry Pi installation, enable SSH and check Yamaha USB MIDI and audio.
For Raspberry Pi 5, 4 GB. For everyday controls, recording and shutdown, use the SynthNerd playing guide.
Check the parts and your work area
On the workbench
Begin with the Pi and a network connection. Leave the Pico, breadboard and touch display disconnected for the first boot.
- Have the Pi 5, Active Cooler, 32 GB microSD, a card reader for your Mac and a suitable USB-C power supply ready. Back up anything you need from the card before writing it.
- Check the supply label. Raspberry Pi recommends its 27 W USB-C supply for Pi 5; our existing supply still needs checking, particularly for USB peripherals. Do not assume every USB-C phone charger is equivalent.
- Prepare Wi-Fi or Ethernet on the same local network as your Mac. Have a USB-A to USB-B data cable for the Yamaha ready; the Pico micro-USB cable is for a later chapter.
- Place the unpowered Pi on a stable, non-conductive surface. Keep loose components away from the board.
You can identify every part needed for the first boot. Nothing is powered yet.
If this does not work
If the supply rating or cable is unclear, record it and resolve that before testing audio. The display and electronics can wait.
Power supply model/rating, card size, missing items and any order differences.
Write Raspberry Pi OS to the card
On your Mac · Raspberry Pi Imager
Our first setup uses Raspberry Pi OS Lite (64-bit). Lite has no graphical desktop; that is intentional for the first audio tests.
- Install Raspberry Pi Imager from the official download page. Select Raspberry Pi 5 and the current Raspberry Pi OS Lite (64-bit) image offered for it. Menu wording may vary by Imager version.
- Choose the microSD card carefully: writing the image erases the selected card.
- Configure hostname synthnerd, your own username and password, Europe/Copenhagen timezone and the appropriate keyboard layout. For Wi-Fi, enter your network details and Denmark as the wireless country.
- Enable SSH in Imager. Use your existing SSH public key if you already use keys, or password authentication for this local setup. Keep your chosen credentials available for the next steps.
- Write the image, allow verification to finish, and eject the card. Record the image name and release date shown in Imager.
Imager completes writing and verification. The card is safely ejected from your Mac.
If this does not work
If verification fails, retry with a reliable card reader or another card. Do not continue with a failed write.
Imager version, exact OS image/release, hostname and username. Keep passwords out of these notes.
Fit the cooler and boot the Pi
On the workbench · power disconnected
Make the physical assembly before attaching USB-C power.
- Follow the Active Cooler installation sheet: remove the protective film from its thermal pads, align the cooler and secure the clips. Its fan lead goes to the dedicated FAN connector on Pi 5, not the GPIO header.
- Insert the prepared microSD card. Connect Ethernet if using a wired network. Leave the Yamaha and the other boards disconnected.
- Connect power and allow several minutes for the initial boot. The fan is temperature-controlled; a stopped fan while the Pi is cool does not by itself mean a fault.
The Pi powers on and has time to join your network. The next step will confirm a working boot over SSH.
If this does not work
For repeated restarts or no network connection, check the supply, card image and network settings. Avoid repeated power removal during the initial boot.
First boot observations and whether Ethernet or Wi-Fi is being used.
Connect from your Mac
Mac Terminal
SSH opens a terminal on the Pi. The website continues to run on your Mac; it is not the synth or the Pi operating system.
- Replace YOUR_USERNAME with the account you created in Imager, then run the SSH command below. There is no assumed default pi account.
- On your first connection, confirm the device identity when SSH asks, then authenticate. Password typing is invisible in Terminal.
- After login, commands marked “Pi terminal” run inside this SSH session. Commands marked “Mac Terminal” run on your Mac.
ssh YOUR_USERNAME@synthnerd.localYou reach a shell prompt on synthnerd. You can now run commands on the Pi.
If this does not work
If .local does not resolve, find the Pi in your router’s device list and use ssh YOUR_USERNAME@PI_IP_ADDRESS instead. For connection refused, check SSH was enabled. For a timeout, check the network and allow the first boot to finish.
Connection method and any SSH/network issue. Keep credentials private.
Update and install the first tools
Pi terminal · over SSH
Use the normal OS package updates. We are establishing a baseline, before real-time tuning or custom firmware.
- Refresh the package list and review the full-upgrade prompt before accepting. Let it finish.
- Install the audio/MIDI utilities and development tools. Reboot, wait for the Pi to return, then reconnect from your Mac using the previous step.
- Use this APT route for stable OS and firmware updates; do not use rpi-update for this baseline.
sudo apt update
sudo apt full-upgradesudo apt install alsa-utils usbutils python3 build-essential cmake git pkg-config libasound2-dev
sudo rebootPackage installation finishes, and you can reconnect after the reboot. The SSH disconnection during reboot is expected.
If this does not work
For package download failures, check the Pi’s internet connection. If APT reports another process holding its lock, let that process finish rather than deleting lock files.
Update date and any installation errors.
Save a baseline before adding hardware
Pi terminal
Keep a small record that lets us compare future problems with the original working setup.
- Run this block after reconnecting. It creates a project area on the Pi and writes a timestamped baseline log.
mkdir -p ~/synthnerd/logs ~/synthnerd/tests
{
date -Is
cat /etc/os-release
uname -a
getconf LONG_BIT
df -h /
vcgencmd measure_temp
vcgencmd get_throttled
} | tee ~/synthnerd/logs/baseline-$(date +%Y%m%d-%H%M%S).txtThe log is saved and the architecture check prints 64. A non-zero get_throttled result needs interpretation before a latency experiment; it can include historical flags.
If this does not work
If temperature, throttling or supply warnings appear, record them and check cooling/power first. Do not treat a boot success as proof of stability under DSP load.
OS release, kernel, free disk space, temperature and exact throttling value. Attach the baseline log when we review the setup.
Discover the Yamaha USB interfaces
Pi terminal + Yamaha
This is our first compatibility check on the actual YDP-165. Do not assume that MIDI detection also proves audio playback.
- With no audio application running, use a USB-A to USB-B data cable from the Pi to Yamaha’s USB TO HOST port. Follow Yamaha’s connection precautions; use an AB cable shorter than 3 m. Turn on the piano.
- Run the discovery commands. Find the Yamaha in the USB list, a MIDI input port in aseqdump, and a playback device in aplay.
- Record the actual MIDI client:port, ALSA card ID and playback device number. These values come from your Pi; the guide does not assume fixed card numbers.
lsusb
aseqdump -l
aplay -l
aplay -L
cat /proc/asound/cardsYou can identify Yamaha USB, MIDI and playback entries separately. Save the output even if one is missing.
If this does not work
If nothing changes, check piano power, its USB TO HOST port and the data cable. If only MIDI appears, stop the audio path here and share the output; do not mark USB audio as working.
USB entry, MIDI port, ALSA card ID/device and any missing interface.
Watch notes and sustain arrive
Pi terminal + Yamaha keys
A note-event test comes before writing a synth engine.
- Replace CLIENT:PORT with the input port reported by aseqdump -l. Run the command, play and release a few notes, then press and release the sustain pedal.
- Look for note events and sustain controller events (CC 64). Press Ctrl+C to stop. This test prints data; it does not generate sound.
- For later synth-only listening, use Local Control Off as described in the Yamaha MIDI Reference. Check the manual’s key diagram before changing it; this is separate from the USB audio test.
aseqdump -p 'CLIENT:PORT'Playing, releasing and using sustain produce corresponding MIDI events.
If this does not work
No events: recheck the chosen input port and cable. Piano sound alone proves only the internal piano is playing.
Port used, note-on/off result, sustain result and any unusual messages.
Silence the internal piano with Local Control Off
On the Yamaha · synth stopped
The keys should send MIDI to our synth without also playing Yamaha’s internal piano. Local Control Off separates the keyboard from that internal sound engine.
- Hold DEMO/SONG and PIANO/VOICE together, press B3, then release the buttons. Yamaha calls middle C “C3”: its B3 is MIDI note 71, the B natural just below the C one octave above middle C. In Danish, B natural is H. Identify note 71 with aseqdump first if unsure, then use that same key for the toggle.
- This is a toggle, not a dedicated Off command. With our synth stopped and no MIDI return routing active, play a key: the internal piano should now be silent. If it still sounds, repeat the combination once and check again.
- Confirm MIDI note events still arrive with aseqdump. Incoming USB audio should still be audible when we run the synth; Local Control Off is not the master volume.
- To return to normal piano playing afterwards, stop our synth, repeat the same button/key combination and verify the piano sound returns.
With the synth stopped: silent keys, but MIDI notes still arrive. Record the observed state; do not infer it merely from pressing the toggle.
If this does not work
If keys still sound, confirm B3 on the manual diagram and check no other software is returning MIDI notes. Turning master volume to zero would hide our synth too, so it is not a substitute.
Whether the internal voice became silent, MIDI still arrived, and whether normal piano sound was restored afterwards.
Play a quiet test tone through the piano
Pi terminal + Yamaha speakers
Generate a two-second 440 Hz stereo WAV at a low digital level. This checks playback, not latency or MIDI-to-sound synthesis.
- Turn the piano volume down first and disconnect headphones. Keep the test at a comfortable listening level.
- Create the quiet WAV using the first block. Then check that CARD=ARIUS and DEV=0 match the Yamaha card ID and device number you discovered.
- Our observed ARIUS stream exposes 44100 Hz, S24_3LE and two channels. This WAV uses packed 24-bit samples to match it directly. On our Pi the card ID is ARIUS and the device is 0; verify those on your own machine.
- Run playback once, raising piano volume gently if needed. Do not route captured piano audio back to its output in this first test.
python3 - <<'PY'
import math
import wave
from pathlib import Path
rate = 44100
frames = rate * 2
path = Path.home() / 'synthnerd/tests/quiet-tone-24bit.wav'
path.parent.mkdir(parents=True, exist_ok=True)
with wave.open(str(path), 'wb') as audio:
audio.setparams((2, 3, rate, 0, 'NONE', 'not compressed'))
for i in range(frames):
fade = max(0.0, min(1.0, i / 882, (frames - 1 - i) / 882))
sample = round((2**23 - 1) * 0.02 * fade * math.sin(2 * math.pi * 440 * i / rate))
audio.writeframesraw(sample.to_bytes(3, 'little', signed=True) * 2)
print(path)
PYaplay -D 'hw:CARD=ARIUS,DEV=0' ~/synthnerd/tests/quiet-tone-24bit.wavThe two-second tone plays through Yamaha’s speakers. Record whether both channels are audible and whether there are clicks or dropouts.
If this does not work
No sound: check the selected playback device, volume and headphones. “Device or resource busy” means another application may own the device. Record format errors rather than guessing raw sample formats. Ctrl+C stops playback.
Full command/device, playback result, channel behaviour and any errors. Save USB format information from /proc/asound/cardN/stream0 if present (replace N with the Yamaha card number).
Play the first synth and inspect the timing report
Pi terminal · Yamaha connected and Local Control Off
Use the current 128-frame configuration as the starting point. Physical key-to-speaker latency has not been measured.
- Confirm the source checkout and binary are present in ~/synthnerd. Start with piano volume low and run the first 60-second session. The default audio/MIDI names select ARIUS, not HDMI.
- Play single notes, a chord, short repeated notes and sustain. You should hear a sine synth rather than the internal piano. Sustain is on/off in this version; half-pedal, sostenuto and soft pedal are not implemented yet.
- The process stops after 60 seconds, or press Ctrl+C earlier. Copy its startup and final report into the notes: actual period/buffer, underruns (xruns), render work, note-event submission timing and queued audio.
- Keep 128-frame periods and three periods. Recheck xruns while adding waveforms, filter and the instrument UI.
- Buffer capacity and software timings are not measured key-to-speaker delay. They omit key scanning, USB MIDI arrival, speaker processing, and the effect of the 5 ms attack. We still need a physical timing test before claiming the under-10-ms goal.
cd ~/synthnerd
./synth-engine/build/synthnerd --period 128 --periods 3 --seconds 60cd ~/Documents/SynthNerd
sh scripts/start-instrument.sh
# Open http://127.0.0.1:8765; Ctrl+C stops the session.Notes and sustain control the sine synth, all notes release correctly, and the timing report is saved. Short real Yamaha sessions completed with zero xruns; repeat with the expanded sound engine and UI.
If this does not work
If ARIUS is missing, turn on/connect the piano and rerun discovery. If the device is busy, stop the other audio process. For clicks or dropouts, save the report and return to 128 frames. Stop immediately for unexpected sound; no autostart is installed.
Period, buffer, xruns, subjective feel, note/pedal behaviour and the full timing report. Label any physical latency estimate with its measurement method.
Add the Touch Display 2 after the baseline
Workbench · Pi fully shut down and unplugged
Optional for the first audio test. Add the display separately so a wiring issue does not obscure a working headless setup.
- Shut down with sudo poweroff, wait for shutdown and unplug USB-C power before connecting anything.
- Use the supplied 22-way to 15-way cable for Pi 5. Follow the official illustrated instructions for connector position and exposed-contact orientation; open the clips gently and seat the cable straight.
- The display’s supplied power cable connects J1 to the Pi header: red to physical pin 2 (5 V), black to physical pin 6 (GND). These are physical header positions, not BCM GPIO numbers. Check the official diagram before applying power.
- Boot and confirm SSH still works. Lite has no desktop, so do not expect a graphical synth UI or touch interaction yet. A desktop/touch test and landscape configuration will be a separate guide in stage 3, after simulator design and physical-control integration. Only the product-display region will appear on the physical screen; virtual hardware controls remain in the development simulator. The next physical-input guide is at /controls/ and the first V1 proposal is at /product/.
The display is wired according to the official diagram and the Pi still boots. A console may be visible; a working graphical touch UI is not a completion requirement for this guide.
If this does not work
For a blank display, power off and recheck the cable and power connector against the diagram. Never reseat the ribbon or GPIO power cable while powered.
Display connection, boot result and screen behaviour. Leave this step unchecked if deferring the display.
Save the results and shut down cleanly
Pi terminal, then this guide
The first session is successful when we know what works and have a useful record of what does not.
- Add the actual results to each step’s notes, including any blocker. Export your checklist and notes with the button above before changing browser or computer.
- Keep the baseline and interface output for our next review. Mark MIDI and audio tests complete only after you have observed their expected results.
- When finished, run sudo poweroff and wait for shutdown before unplugging. For the next session, we will use these findings to build a MIDI-controlled oscillator and then measure latency.
sudo poweroffResults are recorded, your progress is backed up, and the Pi is shut down.
If this does not work
A successful aseqdump test plus a successful WAV playback test are two separate checks. They do not yet prove simultaneous low-latency MIDI-to-sound operation.
What passed, what blocked you and which experiment should come next.
Next chapter / After these checks
Make MIDI turn into sound.
The first MIDI-controlled oscillator is ready for a real playing test. Next, measure the complete key-to-speaker delay and improve stability before adding Pico controls or a graphical interface.
Keep the findings in the build log →