Hmmm… so, I heard this song On Melancholy Hill by the Gorillaz a few months ago and the melody was an immediate hit with me. I think Damon Albarn’s really talented in making melodies. I tried to make a cover of it the moment I heard the song and I think it sounds pretty good on acoustic. Simple progression and amazing melody.
Up on melan… Tree… …with me?
e |————————————————————————————–|
B |————————————————————————————–|
G |————————————————————————————–|
D |————————————————————————————–|
A |3333333333333333——————0000000000000000————————————|
E |—————–3333333333333333——————1111111333333333-1111111333333333–|
==================================================|
|1234567812345678-1234567812345678-1234567812345678-1234567812345678-1234567812345678–|
e |–3——3–3——3——–3–3—-3——3–3——3——3–3——3——3–3—–|
B |1——1—1–1–0——–0–0—-1——1—1–1–1—-1-0—0–0–1—-1-0—0–0—|
G |————————————————————————————–|
D |————————————————————————————–|
A |3333333333333333——————0000000000000000————————————|
E |—————–3333333333333333——————1111111333333333-1111111333333333–|
Now, the tabs look so untidy, the reason being that I wrote the tabs on a notepad that uses simple text. But, when I copied it to this blog, the ‘-’ size is so small that the lines started looking uneven as you see above. So, I wanted to change the ‘-’s to ‘=’s since they have the same size as the numbers and texts. Now, I didn’t want to change every ‘-’ into a ‘=’ by hand and sit there making sure the all lines are equal length so the tabs are at the right place.
So, since I have been learning PERL for some time, I thought I’d write a PERL script to change all the ‘-’s to ‘=’s. Regular Expressions. Here’s the PERL script.
open (MYFILE1, '<tabs.txt');
open (MYFILE2, '>editedtabs.txt');
while (<MYFILE1>){
my($line) = $_;
#chomp($line);
$line =~ s/-/=/g;
print "$line\n";
print MYFILE2 $line
}
close (MYFILE1);
close (MYFILE2);
Here’s the output I got.
Up on melan... Tree... ...with me? e|======================================================================================| B|======================================================================================| G|======================================================================================| D|======================================================================================| A|3333333333333333==================0000000000000000====================================| E|=================3333333333333333==================1111111333333333=1111111333333333==| |1234567812345678=1234567812345678=1234567812345678=1234567812345678=1234567812345678==| e|==3======3==3======3========3==3====3======3==3======3======3==3======3======3==3=====| B|1======1===1==1==0========0==0====1======1===1==1==1====1=0===0==0==1====1=0===0==0===| G|======================================================================================| D|======================================================================================| A|3333333333333333==================0000000000000000====================================| E|=================3333333333333333==================1111111333333333=1111111333333333==|
Well, I had to change the font again since, it was too long for the layout. But, the PERL script did what I intended it to, change ‘-’s to ‘=’s.
Now, to explain the script, MYFILE1 and MYFILE2 are filehandles which let us open the files for reading or writing. The ‘<’ sign before the file name tells the interpreter that the file is being opened for reading. The ‘>’ sign tells the interpreter that the file being opened is opened for writing. We’re storing each line read in $line so that it can be operated on. The chomp function is used to get rid of the ‘\n’ at the end of each line. I didn’t use that because I wanted the separate lines. s/regex/replacement/g is the regular expression that replaces the regex with the replacement. ‘s’ is the keyword for replacement and ‘g’ tells the interpreter to do a global regex replacement, meaning replacing ‘-’ with a ‘=’ everywhere in the file.
By the way, here’s the link to my video http://www.youtube.com/watch?v=lkxpdlyQq4o
But, it turns out that if I change the font for the tabs with the ‘-’s I can get them aligned and I wouldn’t have had to write a PERL script to change the hyphens to ‘equal to’ signs. But, I learned to do something useful.
Up on melan... Tree... ...with me?
e |--------------------------------------------------------------------------------------|
B |--------------------------------------------------------------------------------------|
G |--------------------------------------------------------------------------------------|
D |--------------------------------------------------------------------------------------|
A |3333333333333333------------------0000000000000000------------------------------------|
E |-----------------3333333333333333------------------1111111333333333-1111111333333333--| |1234567812345678-1234567812345678-1234567812345678-1234567812345678-1234567812345678--|
e |--3------3--3------3--------3--3----3------3--3------3------3--3------3------3--3-----|
B |1------1---1--1--0--------0--0----1------1---1--1--1----1-0---0--0--1----1-0---0--0---|
G |--------------------------------------------------------------------------------------|
D |--------------------------------------------------------------------------------------|
A |3333333333333333------------------0000000000000000------------------------------------|
E |-----------------3333333333333333------------------1111111333333333-1111111333333333--|
e |————————————————————————————–|
B |————————————————————————————–|
G |————————————————————————————–|
D |————————————————————————————–|
A |3333333333333333——————0000000000000000————————————|
E |—————–3333333333333333——————1111111333333333-1111111333333333–|
==================================================|
|1234567812345678-1234567812345678-1234567812345678-1234567812345678-1234567812345678–|
e |–3——3–3——3——–3–3—-3——3–3——3——3–3——3——3–3—–|
B |1——1—1–1–0——–0–0—-1——1—1–1–1—-1-0—0–0–1—-1-0—0–0—|
G |————————————————————————————–|
D |————————————————————————————–|
A |3333333333333333——————0000000000000000————————————|
E |—————–3333333333333333——————1111111333333333-1111111333333333–|


