Skip to content

Instantly share code, notes, and snippets.

@podratz
Last active February 16, 2022 22:20
Show Gist options
  • Save podratz/d3d55af49b7e45fefe2c7b87b998ddcc to your computer and use it in GitHub Desktop.
Save podratz/d3d55af49b7e45fefe2c7b87b998ddcc to your computer and use it in GitHub Desktop.
Retune music from 440 Hz to desired frequency (by changing playback speed)
#!/bin/sh
# Prequisite: Using Mac OS and having VLC Media Player installed
# Usage: `freq 432 /path/to/song`
vlc () { /Applications/VLC.app/Contents/MacOS/VLC -I rc "$@" ;}
LC_NUMERIC="en_US.UTF-8" \
rate=$(printf "%0.6f\n" $(bc -q <<< scale=6\;$1/440))
vlc -Irc --rate "$rate" "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment