Grub 2 Startup Sound.

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
hexdef101
Level 4
Level 4
Posts: 357
Joined: Sat Oct 09, 2010 5:43 pm

Grub 2 Startup Sound.

Post by hexdef101 » Sun Aug 03, 2014 12:52 pm

I wanted My Laptop to make a Startup Chime Like the Macintosh does, So i did a little research and found the info. Figured I would post it here. Along with a few other "Tunes" that I found. My Startup Chime sounds similar b ut unfortunately I suck at music coding so its not perfact. If someone Can post the Real ones (at least the ones above the old quadra) you would be a real help. Also If anyone wants to take a stab at writing a good tune for this, please post it here. anyway here is how you do it.


Terminal:
gksudo gedit /etc/default/grub

at the line that says

# Uncomment to get a beep at grub start
# GRUB_INIT_TUNE=

Uncomment that line and add one of the following Tune Sets

Example Tune
"2000 400 4 0 1 500 4 0 1 600 4 0 1 800 6"

SMB
"1000 334 1 334 1 0 1 334 1 0 1 261 1 334 1 0 1 392 2 0 4 196 2"

SMB Alternate
"480 165 2 165 2 165 3 554 1 587 1 554 2 370 1 554 1 523 2 349 1 523 1 494 3 165 2 165 2 165 2"

Imperial Death March
"480 440 4 440 4 440 4 349 3 523 1 440 4 349 3 523 1 440 8 659 4 659 4 659 4 698 3 523 1 415 4 349 3 523 1 440 8"

4-note arpeggio of A, F#m, D, E.
"480 220 1 277 1 330 1 440 1 185 1 220 1 277 1 370 1 294 1 370 1 440 1 587 1 330 1 415 1 494 1 659 1"

My Attempt at a Startup Sound (vaguely similar to the Macintosh sound, but not correct)
"1000 277 3 329 3 392 3 440 8"

Alternate

"1000 265 3 334 3 397 3 446 8"

For those who are composers... The First number is Tempo, after that is Pitch and then Duration

"Tempo Pitch Duration Pitch Duration Pitch Duration Pitch Duration" like so

After you save and close gedit

type this into terminal

sudo update-grub2

after it finishes you can restart your system to hear it. be forwarned that if you use multiboot with the graphical menu turned on. the menu will not show up until the music has finished
Last edited by hexdef101 on Sun Aug 03, 2014 1:03 pm, edited 1 time in total.
Image

User avatar
hexdef101
Level 4
Level 4
Posts: 357
Joined: Sat Oct 09, 2010 5:43 pm

Re: Grub 2 Startup Sound.

Post by hexdef101 » Sun Aug 03, 2014 1:03 pm

oh i forgot to post the music scale. here is the link

http://www.phy.mtu.edu/~suits/notefreq446.html


Oh and round those notes to the nearest whole number..... grub don't like the decimal values
Image

User avatar
hexdef101
Level 4
Level 4
Posts: 357
Joined: Sat Oct 09, 2010 5:43 pm

Re: Grub 2 Startup Sound.

Post by hexdef101 » Sun Aug 03, 2014 4:32 pm

I am posting a new version of the playtune. It actually sounds alot more like it, though I wish I could do chords.

"1600 586 3 630 5 841 8 1001 8 1121 13"
Image

User avatar
hexdef101
Level 4
Level 4
Posts: 357
Joined: Sat Oct 09, 2010 5:43 pm

Re: Grub 2 Startup Sound.

Post by hexdef101 » Tue Aug 12, 2014 11:44 pm

ok this one will make you smile.....
Close Encounters

"220 900 2 1000 2 800 2 400 2 600 3"
Image

seanonymous
Level 1
Level 1
Posts: 1
Joined: Wed Nov 09, 2016 7:33 pm

Re: Grub 2 Startup Sound.

Post by seanonymous » Wed Nov 09, 2016 7:43 pm

You'll know it when you hear it...I hope

"480 494 1 523 1 587 2 494 2 523 2 440 2 494 2 392 2 440 4"

Pairs nicely with either of these two images as the Grub 2

http://www.vpro.nl/.imaging/stk/vpronl/ ... 86532.jpeg

http://i.cbc.ca/1.1647521.1379074319!/h ... outube.jpg

GreenSmurf
Level 1
Level 1
Posts: 1
Joined: Tue Aug 21, 2018 11:15 am

Re: Grub 2 Startup Sound.

Post by GreenSmurf » Tue Aug 21, 2018 11:18 am

I've converted the Jurassic Park theme for private usage and thought I'd post it here:

Jurassic Park (long)
240 1047 1 988 1 1047 2 784 1 698 1 0 1 1047 1 988 1 1047 2 784 1 698 1 0 1 1047 1 988 1 1047 2 1175 1 1175 2 1397 1 1397 2 1319 2 1319 1 1047 1 1175 2 988 1 784 1 0 1 1319 1 1047 1 1175 2 988 1 784 1 0 1 1568 1 1047 1 1397 2 1319 1 1319 2 1175 1 1175 2

Jurassic Park
240 1047 1 988 1 1047 2 784 1 698 1 0 1 1047 1 988 1 1047 2 784 1 698 1 0 1 1047 1 988 1 1047 2 1175 1 1175 2 1397 1 1397 2

Jurassic Park (short)
240 1047 1 988 1 1047 2 784 1 698 1 0 1 1047 1 988 1 1047 2 784 1 698 1 0 1 1047 1 988 1 1047 2 1175 1 1175 2 1397 1 1397 2

Jurassic Park (lower pitch)
240 523 1 494 1 523 2 392 1 349 1 0 1 523 1 494 1 523 2 392 1 349 1 0 1 523 1 494 1 523 2 587 1 587 2 698 1 698 2 659 2 659 1 523 1 587 2 494 1 392 1 0 1 659 1 523 1 587 2 494 1 392 1 0 1 784 1 523 1 698 2 659 1 659 2 587 1 587 2

User avatar
BG405
Level 7
Level 7
Posts: 1563
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Grub 2 Startup Sound.

Post by BG405 » Mon Aug 27, 2018 11:40 am

Is it possible to play these with something without rebooting? I'd like to experiment. :D
Dell Inspiron 1525 - LM17.3 CE 64-------------------Acer D255E 2GB - Manjaro KDE, LM17.3 KDE 32
Toshiba NB305 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Dell PII 350 64MB - Puppy 4.3 & Win98-SE

hegpetz
Level 1
Level 1
Posts: 1
Joined: Fri Oct 26, 2018 11:16 am

Re: Grub 2 Startup Sound.

Post by hegpetz » Fri Oct 26, 2018 11:21 am

@BG405, yes it is possible. There are a few scripts floating around but the one that worked well for me was found at https://askubuntu.com/a/875855/561689.

For posterity, here is the script "grub-playtune.sh"

Code: Select all

#!/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 2> /dev/null
done

play -q -c1 -r 8000 $tmpdir/grubtune.ul

rm -r $tmpdir
and I ran into an error

Code: Select all

play WARN alsa: can't encode 0-bit Unknown or not applicable
and had to modify it to have

Code: Select all

export AUDIODRIVER=alsa
to fix it.

User avatar
BG405
Level 7
Level 7
Posts: 1563
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Grub 2 Startup Sound.

Post by BG405 » Fri Oct 26, 2018 12:24 pm

hegpetz wrote:
Fri Oct 26, 2018 11:21 am
For posterity, here is the script "grub-playtune.sh"
Excellent! Thanks very much for posting that (& the fix). :D
Dell Inspiron 1525 - LM17.3 CE 64-------------------Acer D255E 2GB - Manjaro KDE, LM17.3 KDE 32
Toshiba NB305 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Dell PII 350 64MB - Puppy 4.3 & Win98-SE

Post Reply

Return to “Tutorials”