3 ms·
Forking each sox command to the background causes samples to play non-deterministically and step over each other. Here's a better way: # Define notes for m
by hi-v-rocknroll 2y ago
Forking each sox command to the background causes samples to play non-deterministically and step over each other. Here's a better way:
# Define notes for major seventh chord starting on A 440
A=440
C_SHARP=554.37
E=659.25
G_SHARP=830.61
case "$layout" in
Finnish)
kitty +kitten themes --reload-in=all Apprentice &
play "|sox -np synth 0.2 sine $A" \
"|sox -np synth 0.2 sine $C_SHARP" \
"|sox -np synth 0.2 sine $E" \
"|sox -np synth 0.2 sine $G_SHARP" \
vol -30dB 2>&- &
;;
'English (US)')
kitty +kitten themes --reload-in=all Default &
play "|sox -np synth 0.2 sine $G_SHARP" \
"|sox -np synth 0.2 sine $E" \
"|sox -np synth 0.2 sine $C_SHARP" \
"|sox -np synth 0.2 sine $A" \
vol -30dB 2>&- &
;;
*) echo >&2 'Invalid $layout - must be "Finnish" or "English (US)"'; exit 1
esac
- memco 2y agoRelatedly, I once saw someone realize that the sound they played at the end of their build was running synchronously so they were blocking themselves from a faster feedback loop and reporting unusually long builds in their profiling. Properly backgrounding the sound fixed their issues.
- hiAndrewQuinn 2y agoStepping over each other was the point! :) But very good to know if I ever want to encode a little melody instead!