-
Check out as ~/whistle-synth
-
Install dependencies:
sudo apt install portaudio19-dev python3-evdev python3-mido python3-rtmidi
-
Build it:
make zeros-linux
It will detect pitches and generate audio.
To run on boot, /etc/systemd/system/whistle-synth.service
should have:
[Unit]
Description=Pitch Detection and Synthesis
[Service]
ExecStart=/home/jeffkaufman/whistle-synth/zeros-linux /home/jeffkaufman/whistle-synth/device-index /home/jeffkaufman/whistle-synth/current-voice /home/jeffkaufman/whistle-synth/current-volume /home/jeffkaufman/whistle-synth/current-gate
Restart=always
KillSignal=SIGQUIT
Type=simple
[Install]
WantedBy=multi-user.target
To support changing voices while headless,
/etc/systemd/system/whistle-synth-kbd.service
should have:
[Unit]
Description=Keyboard Control for Pitch Synthesis
[Service]
ExecStart=/usr/bin/python3 /home/jeffkaufman/whistle-synth/kbd.py
Restart=always
KillSignal=SIGQUIT
Type=simple
[Install]
WantedBy=multi-user.target
Then:
sudo systemctl enable whistle-synth-kbd
sudo systemctl enable whistle-synth
sudo systemctl daemon-reload
Set levels for consistency:
$ alsamixer
> F6 select "USB Audio Device"
> F5 [All]
> Speaker: 100
> Mic: 100
> Capture: 100
-
Put on headphones, use a directional mic, or otherwise avoid letting the output of this program mix with the input.
-
Run it and whistle:
make run-linux
Or
make run-mac
It will generate audio.
Keys 0-8 on the keypad should select voices. Voices 0 through 6 expect whistling; 7 and 8 singing.
-
Works best with a directional microphone with a windscreen (vocal mics like the E835 or SM58 have one built in).
-
I use a Sennheiser E835 with an xlr to 3.5mm adapter into a USB sound card. This isn't how the microphone is designed to be used (it wants a pre-amp) but it works well enough and it's nice not to have another piece of hardware.
-
You want to be as close to the microphone as you can bear.
- Install Raspberry Pi Os Lite (we don't want the desktop environment)
sudo apt-get update && sudo apt-get upgrade
sudo raspi-config
- "Interface Options"
- "Enable SSH"
- "Localisation Options"
- "WLAN Country"
- "System Options"
- "Wireless LAN"
- "Interface Options"
- Add regular public key to
~/.ssh/authorized_keys
- Change default password (
passwd
) sudo apt install git emacs
- https://www.jefftk.com/p/you-should-be-logging-shell-history
alsamixer
- select sound card "USB Audio Device"
- Set Speaker, Mic, and Capture to 100% volume
Look into low-latency options. See http://tedfelix.com/linux/linux-midi.html and https://wiki.linuxaudio.org/wiki/raspberrypi