The String
2872 0 1 0 4 262 23 0 1 262 22 0 2 262 14 0 2 293 7 0 1 330 22 0 2 330 14 0 2 293 6 0 2 330 14 0 2 349 6 0 2 392 46 0 2 523 7 0 1 523 7 0 1 523 7 0 1 392 7 0 1 392 7 0 1 392 7 0 1 330 7 0 1 330 7 0 1 330 7 0 1 262 7 0 1 262 7 0 1 262 7 0 1 392 14 0 2 349 7 0 1 330 14 0 2 293 7 0 1 262 46 0 2
Format
GRUB_INIT_TUNE format: tempo freq duration [ freq duration freq duration…]
tempo: The number of electronic beats in one minute. See the notes at the end for more ideas.
freq: The frequency in Hertz of the tone. 262Hz is “C4”, that is, is a Middle C. 0Hz means “silence”.
duration: The number of electronic beats that the tone should sound.
This is discussed in greater detail at the end of this post.
Links
A GRUB_INIT_TUNE tester (web site) is here.
Some more tunes are done by @l4zerface and available free at https://github.com/l4zerface.
L4zerFace describes themself as “Just a super low level hobbyist Linux user who is obsessed with music … The only “real” nerd skill I have is building and calibrating analog & digital DIY eurorack synthesizer modules, also at hobbyist level. Love those Open Source hardware projects!”
Thanks for the tunes!
For music note frequencies, please see the table at https://pages.mtu.edu/~suits/notefreqs.html or derive the frequency from these formulae. The theory behind these charts is here. Thank-you Michigan Technological University for making this information available. Good things come from the Yooper, hey?
Details
GRUB control file is located at /etc/default/grub. Edit this file to change GRUB_INIT_TUNE=”480 440 1″ to have whatever tune you wish. Be certain to remove the # at the start of the line to uncomment the line first.
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE=”480 440 1″
For the Row, Row, Row, Your Boat tune this would become
# Uncomment to get a beep at grub start
GRUB_INIT_TUNE=”2872 0 1 0 4 262 23 0 1 262 22 0 2 262 14 0 2 293 7 0 1 330 22 0 2 330 14 0 2 293 6 0 2 330 14 0 2 349 6 0 2 392 46 0 2 523 7 0 1 523 7 0 1 523 7 0 1 392 7 0 1 392 7 0 1 392 7 0 1 330 7 0 1 330 7 0 1 330 7 0 1 262 7 0 1 262 7 0 1 262 7 0 1 392 14 0 2 349 7 0 1 330 14 0 2 293 7 0 1 262 46 0 2″
You can save old tunes by commenting out the line with an initial #. Example:
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE=”480 440 1″
#Row, Row, Row, Your Boat
GRUB_INIT_TUNE=”2872 0 1 0 4 262 23 0 1 262 22 0 2 262 14 0 2 293 7 0 1 330 22 0 2 330 14 0 2 293 6 0 2 330 14 0 2 349 6 0 2 392 46 0 2 523 7 0 1 523 7 0 1 523 7 0 1 392 7 0 1 392 7 0 1 392 7 0 1 330 7 0 1 330 7 0 1 330 7 0 1 262 7 0 1 262 7 0 1 262 7 0 1 392 14 0 2 349 7 0 1 330 14 0 2 293 7 0 1 262 46 0 2″
#Super Mario
#GRUB_INIT_TUNE=”1000 334 1 334 1 0 1 334 1 0 1 261 1 334 1 0 1 392 2 0 4 196 2″
#Super Mario – Coin
#GRUB_INIT_TUNE=”600 988 1 1319 8″
#Close Encounters
#GRUB_INIT_TUNE=”220 900 2 1000 2 800 2 400 2 600 3″
For More Tunes look in the GRUB_INIT_TUNE Necropolis
Installation
Shell to root:
$ su –
Password:
# nano /etc/default/grub
Find the line that contains #GRUB_INIT_TUNE=”480 440 1″.
If you use a different text editor than nano, just use that with which you are familiar.
The FOSS Rant
By the Way, this web site is running on a little $25 RaspberryPi v4b. GNU/Linux & Apache were free. Free as in Free to Use. Think about that the next time you are paying some corporation $30/month for web hosting. Free Open Source Software (FOSS) is an important part of building and maintaining reliable, cost-effective, information technology systems. The guy who is charging you $30/month is using FOSS, for free, and charging you $30. Jus’ sayin’.
And the SSL Keys are Free, as in Free to Use, thanks to the Let’s Encrypt Project. Their program CertBot is easy to install and automagically keeps your full, legit, SSL keys up to date for Free. If you have cPanel you can also use their cPanel plugin. Think about that the next time your $30/month web hosting company tells you that you must donate $89 to them for one SSL key for one domain for one year.
Finish the edit, save and exit
Delete the # at the start of the line and change the 480 440 1 to whatever tune you desire. Copy / Paste.
Save and exit.
Update GRUB
Run update-grub:
# update-grub
Sourcing file `/etc/default/grub’
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg’
Sourcing file `/etc/default/grub.d/init-select.cfg’
Generating grub configuration file …
Found linux image: /boot/vmlinuz-5.4.0-126-generic
Found initrd image: /boot/initrd.img-5.4.0-126-generic
Found linux image: /boot/vmlinuz-5.4.0-125-generic
Found initrd image: /boot/initrd.img-5.4.0-125-generic
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
/dev/sdd: open failed: No medium found
/dev/sde: open failed: No medium found
/dev/sdf: open failed: No medium found
/dev/sdg: open failed: No medium found
/dev/sdd: open failed: No medium found
/dev/sde: open failed: No medium found
/dev/sdf: open failed: No medium found
/dev/sdg: open failed: No medium found
Found Windows 10 on /dev/nvme0n1p1
done
#
You can also “sudo nano /etc/defaults/grub” and “sudo update-grub” if you feel better about doing it that way. Find your happy place. Enjoy.
When you restart your computer you should hear your new tune signalling you that GRUB is loaded and waiting for your input. The screen will be blank until grub finishes the tune and loads the boot menu. If your precious tune sounds more like a funeral dirge than a boot up melody, just up the number in Tempo until you like it.
Comments
One space, only one space, must separate numbers.
A frequency of Zero (0) means silent.
I padded notes with a brief silence to separate the notes. This is equivalent to tonguing each note when you play on the field in a large stadium, and for the same reason: it separates the notes so you can hear one stop and the next begin: otherwise they are all slurred together.
There is a lag between the time the music starts to play and the time the audio hardware actually is initialized and begins outputting sound. I started and ended with a short silence to let the computer audio get started – the silence is not noticeable to the ear but allows the hardware time to start. Without the initial silence the first note may be incorrect, that is, too short, and the sound may be clipped.
I made the Tempo high enough that the silent spaces between notes made the tune sound acceptable. A higher Tempo means greater detail in the sound. It is a mistake to try to use this as you would when writing a musical score – the electronic Tempo needs to be at least 8 times the real-life musical tempo per the denominator of the time signature. 480 is a fair starting point.
Tempo is the number of electronic beats in one (1) minute. Tempo of 60 beats per minute means one beat sounds for one second. Tempo of 120 beats per minute means one beat sounds for one-half of one second. This is much too slow unless you want the tune to sound like it is being played by a GW Basic program running on an Atari 400.
I tweak Tempo after my tune is typed in and I am testing it in the on-line tool here. I like to write the tune from the score and then come back to Tempo to make it sound perfect. Decide how many electronic beats should represent one eighth note and write out the score accordingly. If you decide an eighth note should be 16 electronic beats, then a sixteenth note is eight electronic beats and a half note is thirty-two electronic beats. Tweak Tempo later, after you have written the score, until it sounds right.
A NOTE is two numbers, the frequency and the duration of the note.
Frequency is the frequency in Hertz of the note. 262Hz is “C4“, that is, is a Middle C. See the table at https://pages.mtu.edu/~suits/notefreqs.html or derive the frequency from these formulae. The theory behind these charts is here. Thank-you Michigan Technological University for making this information available.
Duration is how many electronic beats the note shall sound. If you specify a Tempo of 60 beats per minute then one beat lasts one (1) second. If you specify a Tempo of 480 beats per minute then there are 480 divided by 60 equals 8 beats per second: that is, one beat lasts 1/8th second or 0.125 seconds.
The GRUB manual is at https://www.gnu.org/software/grub/manual/grub/grub.html.