Project Guitar and Linux: Difference between revisions
Jump to navigation
Jump to search
Line 37: | Line 37: | ||
echo -e "power on\nquit" | bluetoothctl | echo -e "power on\nquit" | bluetoothctl | ||
while ! echo -e "show\nquit" | bluetoothctl | grep 'Powered: yes'; do | while ! echo -e "show\nquit" | bluetoothctl | grep 'Powered: yes'; do | ||
echo " | echo "Wait for power on" | ||
sleep 1 | sleep 1 | ||
done | done | ||
Line 44: | Line 44: | ||
try=0 | try=0 | ||
while ! pactl list sinks short | fgrep "$fender_sink"; do | while ! pactl list sinks short | fgrep "$fender_sink"; do | ||
echo " | echo "Wait for $fender_sink" | ||
try=$((try+1)) | try=$((try+1)) | ||
if [ $try -gt 5 ]; then | if [ $try -gt 5 ]; then | ||
echo -e "connect $fender_mac\nquit" | bluetoothctl | echo -e "connect $fender_mac\nquit" | bluetoothctl | ||
echo " | echo "Restart device?" | ||
fi | fi | ||
sleep 1 | sleep 1 | ||
done | done | ||
echo " | echo "Connect $fender_source to $fender_sink. Ctrl-C to end" | ||
pacat -r --latency-msec=1 -d "$fender_source" | \ | pacat -r --latency-msec=1 -d "$fender_source" | \ | ||
pacat -p --latency-msec=1 -d "$fender_sink" | pacat -p --latency-msec=1 -d "$fender_sink" |
Revision as of 16:47, 24 February 2022
Guitar and Linux
Chordsplay
Chordsplay is my application to play along my favorite songs with the guitar. It scans a given directory for mp3 files with metadata to search for chords and lyrics of these songs. The list of these songs can be filtered and shuffled to play them while the lyrics and chords are displayed.
Separate Linux and Guitar Amps
Old style: Just play the music with chordsplay over the linux amp and play along with the external amp.
- External Amp and Guitar can be connected wirelessly
- No earphones because audio mixing happens in the air ;)
Fender Mustang Micro Amp
- The small amp is plugged into the guitar
- Connect the amp via bluetooth to linux audio
- Chordsplay can send the music to the amp via A2DP protocol
pacat -r --latency-msec=1 -d 'alsa_output.usb-0ccd_USB_Audio-00.analog-surround-51.monitor' | \ pacat -p --latency-msec=1 -d 'bluez_sink.84_17_15_15_F0_20.a2dp_sink'
- Use headphones plugged into the fender amp to hear mixed chordsplay and guitar
- USB-C out of the amp can be connected to linux for using the linux amp and for recording, e.g. with audacity
- use pacat to do the connections
pacat -r --latency-msec=1 -d 'alsa_input.usb-FMIC_Fender_Mustang_Micro_396234823131-00.iec958-stereo' | \ pacat -p --latency-msec=1 -d 'alsa_output.usb-0ccd_USB_Audio-00.analog-surround-51'
Unfortunately it is not possible to use normal bluetooth headphones or earpods in this scenario. They have a too long delay. Maybe aptx-ll would be a solution for playing completely wireless?
Script to connect the Fender Mustang Micro to Job4 monitor
Bluetooth is such a pita...
fender_mac='84:17:15:15:F0:20' fender_sink="bluez_sink.${fender_mac//:/_}.a2dp_sink" fender_source="alsa_output.usb-0ccd_USB_Audio-00.analog-surround-51.monitor" echo -e "power on\nquit" | bluetoothctl while ! echo -e "show\nquit" | bluetoothctl | grep 'Powered: yes'; do echo "Wait for power on" sleep 1 done echo -e "connect $fender_mac\nquit" | bluetoothctl try=0 while ! pactl list sinks short | fgrep "$fender_sink"; do echo "Wait for $fender_sink" try=$((try+1)) if [ $try -gt 5 ]; then echo -e "connect $fender_mac\nquit" | bluetoothctl echo "Restart device?" fi sleep 1 done echo "Connect $fender_source to $fender_sink. Ctrl-C to end" pacat -r --latency-msec=1 -d "$fender_source" | \ pacat -p --latency-msec=1 -d "$fender_sink"