Created
October 23, 2013 19:10
-
-
Save penguin2716/7124741 to your computer and use it in GitHub Desktop.
Gradus Ad Parnassum by Debussy (with beep command)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Gradus Ad Parnassum by Debussy (with beep command) | |
if [ $USER != 'root' ]; then | |
echo "beep command requires root permission!" | |
exit 1 | |
fi | |
modprobe pcspkr | |
A1=55.0 | |
Bb1=58.270470189761156 | |
B1=61.73541265701542 | |
C1=65.40639132514957 | |
Db1=69.29565774421793 | |
D1=73.4161919793518 | |
Eb1=77.78174593052012 | |
E1=82.40688922821738 | |
F1=87.30705785825087 | |
Gb1=92.4986056779085 | |
G1=97.99885899543722 | |
Ab1=103.82617439498618 | |
A2=110.0 | |
Bb2=116.54094037952237 | |
B2=123.4708253140309 | |
C2=130.8127826502992 | |
Db2=138.59131548843592 | |
D2=146.83238395870364 | |
Eb2=155.56349186104035 | |
E2=164.81377845643485 | |
F2=174.61411571650183 | |
Gb2=184.9972113558171 | |
G2=195.99771799087452 | |
Ab2=207.65234878997245 | |
A3=220.0 | |
Bb3=233.08188075904488 | |
B3=246.94165062806198 | |
C3=261.6255653005985 | |
Db3=277.182630976872 | |
D3=293.66476791740746 | |
Eb3=311.1269837220808 | |
E3=329.62755691286986 | |
F3=349.2282314330038 | |
Gb3=369.99442271163434 | |
G3=391.99543598174927 | |
Ab3=415.3046975799451 | |
A4=440.0 | |
Bb4=466.1637615180899 | |
B4=493.8833012561241 | |
C4=523.2511306011974 | |
Db4=554.3652619537443 | |
D4=587.3295358348153 | |
Eb4=622.253967444162 | |
E4=659.2551138257401 | |
F4=698.456462866008 | |
Gb4=739.988845423269 | |
G4=783.990871963499 | |
Ab4=830.6093951598907 | |
A5=880.0000000000003 | |
Bb5=932.3275230361803 | |
B5=987.7666025122488 | |
C5=1046.5022612023952 | |
Db5=1108.7305239074892 | |
D5=1174.659071669631 | |
Eb5=1244.5079348883246 | |
E5=1318.5102276514808 | |
F5=1396.912925732017 | |
Gb5=1479.977690846539 | |
G5=1567.9817439269987 | |
Ab5=1661.218790319782 | |
A6=1760.000000000002 | |
Bb6=1864.6550460723618 | |
B6=1975.5332050244986 | |
C6=2093.0045224047913 | |
Db6=2217.4610478149793 | |
D6=2349.3181433392633 | |
Eb6=2489.0158697766506 | |
E6=2637.020455302963 | |
F6=2793.8258514640347 | |
Gb6=2959.9553816930793 | |
G6=3135.963487853999 | |
Ab6=3322.437580639566 | |
A7=3520.0000000000055 | |
Bb7=3729.310092144725 | |
B7=3951.0664100489994 | |
C7=4186.009044809585 | |
Db7=4434.922095629961 | |
D7=4698.636286678529 | |
Eb7=4978.031739553304 | |
E7=5274.040910605929 | |
F7=5587.651702928073 | |
Gb7=5919.910763386162 | |
G7=6271.926975708001 | |
Ab7=6644.875161279136 | |
A8=7040.000000000014 | |
Bb8=7458.620184289454 | |
B8=7902.132820098003 | |
C8=8372.018089619174 | |
tempo=160 | |
length4=`ruby -e "print 60.0 / $tempo * 1000"` | |
note4=`ruby -e "print 60.0 / $tempo * 1000 * 0.9"` | |
rest4=`ruby -e "print 60.0 / $tempo * 0.1"` | |
length1=`ruby -e "print $length4 * 4"` | |
note1=`ruby -e "print $note4 * 4"` | |
rest1=`ruby -e "print $rest4 * 4"` | |
length2=`ruby -e "print $length4 * 2"` | |
note2=`ruby -e "print $note4 * 2"` | |
rest2=`ruby -e "print $rest4 * 2"` | |
length8=`ruby -e "print $length4 / 2"` | |
note8=`ruby -e "print $note4 / 2"` | |
rest8=`ruby -e "print $rest4 / 2"` | |
length16=`ruby -e "print $length4 / 4"` | |
note16=`ruby -e "print $note4 / 4"` | |
rest16=`ruby -e "print $rest4 / 4"` | |
function note1 { | |
beep -f $1 -l $note1 | |
sleep $rest1 | |
} | |
function note2 { | |
beep -f $1 -l $note2 | |
sleep $rest2 | |
} | |
function note4 { | |
beep -f $1 -l $note4 | |
sleep $rest4 | |
} | |
function note8 { | |
beep -f $1 -l $note8 | |
sleep $rest8 | |
} | |
function note16 { | |
beep -f $1 -l $note16 | |
sleep $rest8 | |
} | |
function rest4 { | |
sleep $length4 | |
} | |
function rest8 { | |
sleep $length8 | |
} | |
function rest16 { | |
sleep $length16 | |
} | |
note16 $C3 | |
note16 $G3 | |
note16 $C4 | |
note16 $D4 | |
note16 $E4 | |
note16 $G3 | |
note16 $C4 | |
note16 $E4 | |
note16 $D4 | |
note16 $F3 | |
note16 $C4 | |
note16 $D4 | |
note16 $F4 | |
note16 $A4 | |
note16 $B4 | |
note16 $F4 | |
note16 $E4 | |
note16 $G3 | |
note16 $C4 | |
note16 $E4 | |
note16 $G4 | |
note16 $B4 | |
note16 $C4 | |
note16 $G4 | |
note16 $F4 | |
note16 $A4 | |
note16 $C4 | |
note16 $F4 | |
note16 $A5 | |
note16 $B4 | |
note16 $F4 | |
note16 $A5 | |
note16 $G4 | |
note16 $C4 | |
note16 $E4 | |
note16 $G4 | |
note16 $C5 | |
note16 $E4 | |
note16 $G4 | |
note16 $C5 | |
note16 $D5 | |
note16 $E4 | |
note16 $G4 | |
note16 $D5 | |
note16 $C5 | |
note16 $E4 | |
note16 $G4 | |
note16 $C5 | |
note16 $B5 | |
note16 $E4 | |
note16 $G4 | |
note16 $B5 | |
note16 $A5 | |
note16 $E4 | |
note16 $G4 | |
note16 $A5 | |
note16 $G4 | |
note16 $C4 | |
note16 $E4 | |
note16 $G4 | |
note16 $F4 | |
note16 $C4 | |
note16 $E4 | |
note16 $F4 | |
note16 $E4 | |
note16 $B4 | |
note16 $C4 | |
note16 $E4 | |
note16 $D4 | |
note16 $A4 | |
note16 $C4 | |
note16 $D4 | |
note16 $G4 | |
note16 $B4 | |
note16 $E4 | |
note16 $G4 | |
note16 $A5 | |
note16 $C4 | |
note16 $E4 | |
note16 $A5 | |
note16 $E4 | |
note16 $A4 | |
note16 $C4 | |
note16 $E4 | |
note16 $D4 | |
note16 $A4 | |
note16 $C4 | |
note16 $D4 | |
note16 $C4 | |
note16 $G3 | |
note16 $A4 | |
note16 $C4 | |
note16 $B4 | |
note16 $F3 | |
note16 $G3 | |
note16 $B4 | |
note16 $F2 | |
note16 $C3 | |
note16 $D3 | |
note16 $E3 | |
note16 $F3 | |
note16 $A4 | |
note16 $C4 | |
note16 $D4 | |
note16 $E4 | |
note16 $D4 | |
note16 $C4 | |
note16 $A4 | |
note16 $F3 | |
note16 $E3 | |
note16 $D3 | |
note16 $C3 | |
note16 $F2 | |
note16 $C3 | |
note16 $D3 | |
note16 $E3 | |
note16 $F3 | |
note16 $A4 | |
note16 $C4 | |
note16 $D4 | |
note16 $E4 | |
note16 $D4 | |
note16 $C4 | |
note16 $B4 | |
note16 $A4 | |
note16 $E3 | |
note16 $D3 | |
note16 $C3 | |
note16 $F2 | |
note16 $C3 | |
note16 $D3 | |
note16 $E3 | |
note16 $F3 | |
note16 $Ab3 | |
note16 $C4 | |
note16 $D4 | |
note16 $E4 | |
note16 $D4 | |
note16 $C4 | |
note16 $A4 | |
note16 $F3 | |
note16 $E3 | |
note16 $D3 | |
note16 $C3 | |
note16 $F2 | |
note16 $C3 | |
note16 $D3 | |
note16 $E3 | |
note16 $F3 | |
note16 $Ab3 | |
note16 $C4 | |
note16 $D4 | |
note16 $E4 | |
note16 $D4 | |
note16 $C4 | |
note16 $Bb4 | |
note16 $A4 | |
note16 $E3 | |
note16 $D3 | |
note16 $C3 | |
note16 $E2 | |
note16 $B3 | |
note16 $E3 | |
note16 $Ab3 | |
note16 $B3 | |
note16 $E3 | |
note16 $Ab3 | |
note16 $B4 | |
note16 $E3 | |
note16 $Ab3 | |
note16 $B4 | |
note16 $E4 | |
note16 $Ab3 | |
note16 $B4 | |
note16 $E4 | |
note16 $Ab4 | |
note2 $E4 | |
modprobe -r pcspkr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment