Disclaimer: Don't own, wish I did.
In the unlikely chance you want to use the song let me know and credit me
for it. Thanks.

The Sorting Hat.

The Sorting Hat sighed. Well sort of. Obviously having no lungs to expel
air it was in fact impossible for it to sigh, but for the sake of this
story let us assume it can. It doesn't really matter after all.

The Sorting Hat (known fondly by headmasters of Hogwarts as Boris) had a
lot more to it than people thought. Most didn't really think about it at
all of course, but if they had they would have come to a conclusion of
pretty much that it A) Sings, B) Sorts and C) Talks. That's it. They never
take the time to wonder how. Well magic, obviously. But that's pretty
complex magic to do all that. For it to do that it had to THINK. Had to
have a mind. To be independent of the wizard who created it (should that be
he? It/he does have a consciousness after all.)

The talking was easy. That was just a simple transfiguration spell with a
few charms. Even the sorting wasn't too hard, once it had a mind. But
sorting had an effect and that's where the singing came in. The Hat was
designed to look inside the minds of student, to see what kind of people
they would become. We are shaped by our pasts and so the Hat had to look
into their memories. And the Hat grew stronger with time and started to
remember other people's memories. Nothing very intrusive but certain things
caught its attention. Like songs.

It is assumed the Sorting Hat always sang before sorting. This is not the
case. Around fifty years after its awakening, after it began sorting, the
founders were all gone. It had seen hundreds of heads and it found the most
interesting to be the ones full of song. It had learnt the structure of
song, that the best told some kind of story. It had spent five years
getting ready but it WAS ready. The Hat was placed on a stall, the students
were told what would happen - that they would put it on and be sorted. The
first name was called. But before Absintha Artinn could step forward the
Sorting Hat opened its mouth. Everyone stared in surprise. Time appeared to
stand still.

The Hat looked around (again, let us assume it is capable). All these eyes
on it, it wasn't ready! How could it be ready? Boris had only been working
on the song five years - a ridiculously short amount of time! But it had
the feeling that if it didn't sing now it never would. Feeling, that was
something else new. Not knowledge exactly, but instinct. And occasionally
emotions; concern over a student for example. That was happening too
frequently for its liking. But back to where we were.

As time stood still the Hat closed its mouth. And opened it again, this
time a sound coming out. Poor Absintha stood there looking terrified as a
thin, wheezy sound came out of the Hats mouth. All around was amazement yet
the Hat could feel something else too; they were pleased! They were
actually enjoying it! Its voice became stronger, the song filled out. It
wasn't the best song ever but it was the Hats first and it was proud of it.
It didn't care when the headmaster of the time got the congratulations. It
did beam with pride however when later the headmaster asked him to sing
again next year. It became a tradition to hear the Hat's rich baritone fill
the Hall before each sorting.

The Hat had no objections, it spent the year making up a new song, keeping
up to date by the memories of the students it had sorted. But that's where
the current problem of the Hat lay.

A boy it had sorted a few years back had been bothering him since. The boy,
Dennis Creevey, had had a song stuck in his head. And now it was bothering
the Hat. It could remember it quite well. In the end it decided to copy the
song, the sound of it, and make new lyrics. Only the lyrics didn't fit. It
sighed again and reminded itself of that infernal tune.

OOMPA LOOMPA DOOMPADEE DOO
I'VE GOT A PERFECT PUZZLE FOR YOU
OOMPA LOOMPA, DOOMPADAH DEE
IF YOU ARE WISE YOU'LL LISTEN ME
WHAT DO YOU GET WHEN YOU GUZZLE DOWN SWEETS
EATING AS MUCH AS AN ELEPHANT EATS
WHAT ARE YOU AT GETTING TERRIBLY FAT
WHAT DO YOU THINK WILL COME OF THAT
I DON'T LIKE THE LOOK OF IT
OOMPA LOOMPA DOOMPADEE DAH
IF YOU'RE NOT GREEDY YOU WILL GO FAR
YOU WILL LIVE IN HAPPINESS TOO
LIKE THE OOMPA LOOMPA DOOMPADEE DO
DOOMPADEE DOO

Hmmm, with a little changing it could work, let's see..

OOMPA LOOMPA DOOMPADEE DEE
YOU ARE THE PERFECT PUZZLE FOR ME
OOMPA LOOMPA, DOOMPADAH DOO
WHERE IN HOGWARTS AM I TO PUT YOU?

Yes, that bit seemed fine. Now, the traits..

WHAT DO YOU GET IF YOU'RE BRAVE IN YOUR HEART?
WHERE SHOULD YOU GO IF YOU'RE VERY SMART?
LOYAL TO YOUR FRIENDS IS A STRONG TRAIT TOO
OR IS IT AMBITION THAT DEFINES YOU?

Yes. It liked that. The trip down memory lane seemed to have help. Ah.
Spoke too soon.

I DON'T LIKE THE LOOK OF IT

That next bit just REFUSED to fit. The last two lines couldn't change - it
would ruin the song. So this had to be used in order to have four lines -
one for each house. But this line was sung differently to the rest. Would
it be right to single one house out? More importantly, would it sound
right? Still there was nothing for it. If it went with Ravenclaw it
shouldn't increase House rivalry at least- he Ravenclaws tended to be above
petty things like that. Now let's see.

RAVENCLAW? THEN YOU HAVE BRAINS

The bit after wasn't great either - didn't really scan. But time was
running out.

CHIVALROUS - YOU'RE A GRYFFINDOR STAR
IF YOU'RE A SLYTHERINE YOU WILL GO FAR

It liked the Slytherine line - very apt. Ah. Now it had hit a snag. What
WERE the defining traits of Hufflepuffs'? It preferred to not repeat any in
its verses. Loyalty and honesty just didn't work in this song. Still, they
all liked to be happy. So did Slytherines. Just a different, more powerful
kind of happiness. And it fitted. A shame to compare them but needs must.
So, one line to write then the last two added on the end.

HUFFLEPUFFS LIVE FOR HAPPINESS TOO
LIKE THE OOMPA LOOMPA DOOMPADEE DO
DOOMPADEE DOO

Not the greatest masterpiece ever but a song was made. And it was catchy
(the Hat should know - the song had been stuck in its head for the past few
years!) Just two hours and it would sing to the school. Better start
practising then. The Hat opened its mouth and in surprisingly good voice
the Hat began

"OOMPA LOOMPA DOOMPADEE DEE
YOU ARE THE PERFECT PUZZLE FOR ME
OOMPA LOOMPA, DOOMPADAH DOO
WHERE IN HOGWARTS AM I TO PUT YOU?
WHAT DO YOU GET IF YOU'RE BRAVE IN YOUR HEART?
WHERE SHOULD YOU GO IF YOU'RE VERY SMART?
LOYAL TO YOUR FRIENDS IS A STRONG TRAIT TOO
OR IS IT AMBITION THAT DEFINES YOU?
RAVENCLAW? THEN YOU HAVE BRAINS
CHIVALROUS - YOU'RE A GRYFFINDOR STAR
IF YOU'RE A SLYTHERINE YOU WILL GO FAR
HUFFLEPUFFS LIVE FOR HAPPINESS TOO
LIKE THE OOMPA LOOMPA DOOMPADEE DO
DOOMPADEE DOO

And again.

And again....