Revisiting the Tinley Park Lights
175 strangers filed independent reports about the same thing. 96% agreed on the color. 100% agreed on the sound. I ran the data on the Tinley Park Lights.
This guide will walk you through setting up a sophisticated multi-layer audio signal generator that runs as a service on your Raspberry Pi and outputs sound to a Bluetooth speaker. The system includes three main components: an audio generator script, a player service, and a systemd configuration to automatically run at startup.
The setup consists of:
Before starting, you'll need:
You'll also need to install some Python libraries:
bash
sudo apt-get update
sudo apt-get install -y python3-pip libportaudio2 libportaudio-dev portaudio19-dev
sudo pip3 install numpy scipy sounddeviceMove the service file to the systemd directory:bash
sudo mv uap3-player.service /etc/systemd/system/Place the Python scripts in your home directory:bash
# Move the Python scripts to the home directory
mv uap3-generator.py /home/pi/
mv uap3-player.py /home/pi/bash
chmod +x /home/pi/uap3-generator.py
chmod +x /home/pi/uap3-player.pyRun the audio generator script to create the WAV file (this may take some time on a Raspberry Pi):
bash
python3 /home/pi/uap3-generator.pyThis will generate a 1-hour WAV file (uap3_output.wav) in your home directory.
View the logs to ensure everything is working:bash
cat /home/pi/uap3-player.logCheck that the service is running:bash
sudo systemctl status uap3-player.serviceStart the service immediately:bash
sudo systemctl start uap3-player.serviceEnable the service to start automatically on boot:bash
sudo systemctl enable uap3-player.serviceReload the systemd daemon to recognize the new service:bash
sudo systemctl daemon-reloadBefore the player service will work, you need to pair and connect your Bluetooth speaker:
Exit Bluetooth control:
exitTrust your speaker so it automatically connects:
trust XX:XX:XX:XX:XX:XXConnect to your speaker:
connect XX:XX:XX:XX:XX:XXPair with your speaker (replace XX:XX:XX:XX:XXwith your speaker's MAC address):
pair XX:XX:XX:XX:XX:XXScan for devices:
scan onStart Bluetooth control:bash
bluetoothctlIf you encounter issues:
Verify Bluetooth connection:bash
bluetoothctl infoTest audio playback manually:bash
aplay /home/pi/uap3_output.wavCheck the player log:bash
cat /home/pi/uap3-player.logView detailed logs:bash
sudo journalctl -u uap3-player.service -n 50Check service status:bash
sudo systemctl status uap3-player.serviceThe generated audio contains six distinct layers:
To customize the audio parameters, you can modify the frequency values, amplitudes, or other parameters in the uap3-generator.py script. After making changes, regenerate the WAV file, and the player service will automatically use the new file.