5 ms·
It isn't exactly what you have in mind, but I use `play` as well as a terminal theme color change to tell me when I'm using one or another language's keyboard l
by hiAndrewQuinn 2y ago
It isn't exactly what you have in mind, but I use `play` as well as a terminal theme color change to tell me when I'm using one or another language's keyboard layout. If you put & in front of play, you can make chords.
Here's an example:
# Define notes for major seventh chord starting on A 440
A=440
C_SHARP=554.37
E=659.25
G_SHARP=830.61
if [[ "$layout" == "Finnish" ]]; then
# Play a major seventh chord ascending
kitty +kitten themes --reload-in=all Apprentice &
play -n synth 0.2 sine $A vol -30dB &
play -n synth 0.2 sine $C_SHARP vol -30dB &
sleep 0.2
play -n synth 0.2 sine $E vol -30dB &
play -n synth 0.2 sine $G_SHARP vol -30dB &
elif [[ "$layout" == "English (US)" ]]; then
kitty +kitten themes --reload-in=all Default &
play -n synth 0.2 sine $G_SHARP vol -30dB &
play -n synth 0.2 sine $E vol -30dB &
sleep 0.2
play -n synth 0.2 sine $C_SHARP vol -30dB &
play -n synth 0.2 sine $A vol -30dB &
fi
- Rygian 2y agoI used the same approach when programming my fridge. If the compressor was required because the temperature in the topmost shelf was too high, the tones would play in rising order. If it was due to the bottom shelf, then the tones would play in descending order. I ended up disabling the feature because it was always the bottom shelf.
- slig 2y agoIs your fridge on GH? Mine is outdated and I'd like to download a newer one.
- Rygian 2y agoShort answer: no. Was forced to move to a new place. Had to buy a secondhand fridge. Thermostat was out of whack. Instead of calling a technician, I decided to have fun, replaced the thermostat by an Arduino with a couple of thermometers (top shelf, bottom shelf), a relay driving a contactor, and a beeper. Firmware stayed in "beta version", never thought about publishing it. When I moved again to a new place I ditched the frankenfridge.
- darknavi 2y agoProjects line Frankenfridge are a blast until you want a product that "just works".
- AyyEye 2y agoMost of my longest lived and lowest maintenance things were frankenprojects and brazen hacks that somehow lasted years without me having to make any changes or fix anything.
- hooverd 2y agoThings work surprisingly well when you don't have an engineer or two figuring out how cheap you can go.
- vindex10 2y agoI bet it's written from an Apple device :)
- markhahn 2y agothat project deserves a permanent web presence, if only a blog post!
- ghostpepper 2y agoWhen I read that Finnish was a major seventh I was hoping that English would be a minor seventh or something even more subtly different. A minor 7th vs a minor 7 flat 5 etc. Would be funny to create an elaborate system of notification tones that are only discernible by a trained musician
- hiAndrewQuinn 2y agoForgive me Mr. Ghost Pepper. I didn't take the ear training seriously enough in AP Music Theory, and now I can scarcely tell my eleventh chords apart when I'm listening to Charles Mingus!
- left-struck 2y ago> Would be funny to create an elaborate system of notification tones that are only discernible by a trained musician Oh man, could this concept be turned into an esoteric programming language where to program you use a musical keyboard and all the symbols in your lang are different chords or intervals Absolutely no visual feedback for extra pain
- madcaptenor 2y agoThis reminds me of the conlang "solresol" (https://en.wikipedia.org/wiki/Solresol https://en.wikipedia.org/wiki/Solresol)
- hi-v-rocknroll 2y agoForking 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!