This Grub Init Tune will make your computer sound like a Super Mushroom every time you turn it on! This only works for the Grub bootloader - this generally means you need to have Linux (or other Grub-based OS) installed.
Here's the code, which goes in your /etc/default/grub
file:
GRUB_INIT_TUNE="1750 523 1 392 1 523 1 659 1 784 1 1047 1 784 1 415 1 523 1 622 1 831 1 622 1 831 1 1046 1 1244 1 1661 1 1244 1 466 1 587 1 698 1 932 1 1195 1 1397 1 1865 1 1397 1"
Instructions adapted from http://www.iavit.org/~john/debian/grub.html:
-
Edit the file /etc/default/grub. At the end there are lines like the following:
# Uncomment to get a beep at grub start
# GRUB_INIT_TUNE="480 440 1"
-
Replace the
# GRUB_INIT_TUNE="480 440 1"
line with the new GRUB_INIT_TUNE line at the top of this document (make sure to remove the "#" from the beginning of the line, as well). Save the file and exit your text editor. Open a terminal window and issue the following command:sudo update-grub
-
Reboot. You should hear the init tune when the grub menu appears.
Script lightly modified from http://ubuntuforums.org/showthread.php?t=1739495 You need the low weight packages sox and play.
#!/bin/dash
if [ $# -lt 3 ]; then
echo "Usage: $0 tempo freq dur [freq dur freq dur...]" >&2
exit 1
fi
tempo=$1; shift
tmpdir=$(mktemp -d)
while [ -n "$*" ]; do
freq=$1; shift
dur=$1; shift
dur=$(echo "$dur*(60/$tempo)"|bc -l)
sox -e mu-law -r 8000 -n -t raw - synth $dur sine $freq >>$tmpdir/grubtune.ul
done
play -q -c1 -r 8000 $tmpdir/grubtune.ul
rm -r $tmpdir
###Try the mario init tune
./script_above 1750 523 1 392 1 523 1 659 1 784 1 1047 1 784 1 415 1 523 1 622 1 831 1 622 1 831 1 1046 1 1244 1 1661 1 1244 1 466 1 587 1 698 1 932 1 1195 1 1397 1 1865 1 1397 1