songtexts = {}
src=u"""Je m'baladais sur l'avenue
Le coeur ouvert à l'inconnu
J'avais envie de dire bonjour
À n'importe qui
N'importe qui ce fut toi
Je t'ai dit n'importe quoi
Il suffisait de te parler
Pour t'apprivoiser
Aux Champs-Élysées
Aux Champs-Élysées
Au soleil, sous la pluie
À midi ou à minuit
Il y a tout ce que vous voulez
Aux Champs-Élysées
Tu m'as dit "J'ai rendez-vous
Dans un sous-sol avec des fous
Qui vivent la guitare à la main
Du soir au matin"
Alors je t'ai accompagnée
On a chanté, on a dansé
Et l'on n'a même pas pensé
À s'embrasser
Aux Champs-Élysées
Aux Champs-Élysées
Au soleil, sous la pluie
À midi ou à minuit
Il y a tout ce que vous voulez
Aux Champs-Élysées
Hier soir deux inconnus
Et ce matin sur l'avenue
Deux amoureux tout étourdis
Par la longue nuit
Et de l'Étoile à la Concorde
Un orchestre à mille cordes
Tous les oiseaux du point du jour
Chantent l'amour
Aux Champs-Élysées
Aux Champs-Élysées
Au soleil, sous la pluie
À midi ou à minuit
Il y a tout ce que vous voulez
Aux Champs-Élysées"""
songtexts[u'Aux Champs Elysées'] = src
Post-traitement :
lines = src.split('\n')
lines = filter(lambda s: s != '', lines)
lines
<filter at 0x104a260b8>
src = u"""I've been a wild rover for many's the year
I've spent all me money on whiskey and beer
But now I'm returning with gold in great store
And I never will play the wild rover no more
And it's No, Nay, never,
No, nay never no more
Will I play the wild rover,
No never no more
I went in to an alehouse I used to frequent
And I told the landlady me money was spent
I asked her for credit, she answered me nay
Such a customer as you I can have any day
And it's No, Nay, never,
No, nay never no more
Will I play the wild rover,
No never no more
I took from my pocket ten sovereigns bright
And the landlady's eyes opened wide with delight.
She said "I have whiskey and wines of the best
And the words that I spoke sure were only in jest."
And it's No, Nay, never,
No, nay never no more
Will I play the wild rover,
No never no more
I'll go home to my parents, confess what I've done
And I'll ask them to pardon their prodigal son.
And if they caress (forgive) me as ofttimes before
Sure I never will play the wild rover no more.
And it's No, Nay, never,
No, nay never no more
Will I play the wild rover,
No never no more"""
songtexts['The Wild Rover'] = src
src = """Ooh I need your love babe
Guess you know it's true
Hope you need my love babe
Just like I need you
Hold me, love me, hold me, love me
Ain't got nothing but love babe
Eight days a week
Love you every day girl
Always on my mind
One thing I can say girl
Love you all the time
Hold me, love me, hold me, love me
Ain't got nothing but love babe
Eight days a week
Eight days a week
I love you
Eight days a week
Is not enough to show I care
Ooh I need your love babe
Guess you know it's true
Hope you need my love babe
Just like I need you
Hold me, love me, hold me, love me
Ain't got nothing but love babe
Eight days a week
Eight days a week
I love you
Eight days a week
Is not enough to show I care
Love you every day girl
Always on my mind
One thing I can say girl
Love you all the time
Hold me, love me, hold me, love me
Ain't got nothing but love babe
Eight days a week
Eight days a week
Eight days a week
"""
songtexts['Eight days a week'] = src
src = """Yesterday, all my troubles seemed so far away
Now it looks as though they're here to stay
oh, I believe in yesterday
Suddenly, I'm not half the man I used to be
There's a shadow hanging over me
Oh, yesterday came suddenly.
Why she had to go?
I don't know, she wouldn't say
I said something wrong
Now I long for yesterday.
Yesterday love was such an easy game to play
Now I need a place to hide away
Oh, I believe in yesterday.
Why she had to go?
I don't know, she wouldn't say
I said something wrong
Now I long for yesterday.
Yesterday love was such an easy game to play
Now I need a place to hide away
Oh, I believe in yesterday...
"""
songtexts['Yesterday'] = src
songtexts['Pour la peine'] = """Quand la peur s'immisce dans nos illusions,
on abandonne,
abandonne,
le ciel pardonne,
quand l'esprit s'enlise dans la déraison,
les cannons tonnent,
cannons tonnent,
les cris résonnent,
pour la peine,
je t'emmène,
on veut des rêves,
qui nous soulèvent,
on veut des fleurs,
a nos douleurs,
on veut du sens,
de l'innocence,
au nom de nos libres penseurs,
au nom des larmes,
qui nous désarment,
on doit pouvoir,
changer l'histoire,
pour la peine,
au nom de nos pères qui nous ont appris le prix d'un homme,
prix d'un homme,
ce que nous sommes,
au nom de nos frères tombés dans l'oubli des droits de l'homme,
droits de l'homme,
droit des hommes,
on veut des rêves,
qui nous soulèvent,
on veut des fleurs,
a nos douleurs,
on veut du sens,
de l'innocence,
au nom de nos libres penseurs,
au nom des larmes,
qui nous désarment,
on doit pouvoir,
changer l'histoire,
pour la peine (x 2)
je veux sourire à tes erreurs,
embrasser tes blessures,
nous apprendrons par coeur,
la démesure,
car nos peines sont les mêmes,
on veut des rêves,
qui nous soulèvent,
on veut des fleurs,
a nos douleurs,
on veut du sens,
de l'innocence,
au nom de nos libres penseurs,
au nom des larmes,
qui nous désarment,
on doit pouvoir,
changer l'histoire,
pour la peine (x 2)"""
songtexts['And it stoned me'] = """Half a mile from the county fair
And the rain came fallin' down
Me and Billy standin' there
With a silver half a crown
Hands full of a fishin' rods
And the tackle on our backs
We just stood there gettin' wet
With our backs against the fence
Oh, the water
Oh, the water
Oh, the water
Hope it don't rain all day
[Chorus:]
And it stoned me to my soul
Stoned me just like Jelly Roll
And it stoned me
And it stoned me to my soul
Stoned me just like goin' home
And it stoned me
Then the rain let up and the sun came up
And we were gettin' dry
Almost let a pick-up truck nearly pass us by
So we jumped right in and the driver grinned
And he dropped us up the road
We looked at the swim and we jumped right in
Not to mention fishing poles
Oh, the water
Oh, the water
Oh, the water
Let it run all over me
[Chorus:]
On the way back home we sang a song
But our throats were getting dry
Then we saw the man from across the road
With the sunshine in his eyes
Well he lived all alone in his own little home
With a great big gallon jar
There were bottles too, one for me and you
And he said Hey! There you are
Oh, the water
Oh, the water
Oh, the water
Get it myself from the mountain stream"""
songtexts['Junimond'] = """Die Welt schaut rauf
Zu meinem Fenster.
Mit müden Augen
Ganz staubig und scheu
Ich bin hier oben, auf meiner Wolke.
Ich seh dich kommen, aber du gehst vorbei.
Doch jetzt tuts nicht mehr weh,
Jetzt tuts nicht mehr weh...
Und alles bleibt stumm und kein Sturm kommt auf wenn ich dich seh
Es ist vorbei, byebye Junimond!
Es ist vorbei, byebye!
Es ist vorbei, byebye Junimond!
Es ist vorbei, byebye!
2000 Stunden hab ich gewartet,
Ich hab sie alle gezählt und verflucht.
Ich hab getrunken, geraucht und gebetet.
Hab dich flussauf - und flussabwärts gesucht
Doch jetzt tuts nicht mehr weh,
Jetzt tuts nicht mehr weh!
Und alles bleibt stumm und kein Sturm kommt auf wenn ich dich seh!
Es ist vorbei, byebye Junimond!
Es ist vorbei, byebye!
Es ist vorbei, byebyejunimond!
Es ist vorbei, byeye!"""
songtexts['Sunny afternoon'] = """The taxman's taken all my dough
And left me in my stately home
Lazing on a sunny afternoon
And I can't sail my yacht
He's taken everything I've got
All I've got's this sunny afternoon
Save me, save me
Save me from this squeeze
I've got a big fat momma trying to break me
And I love to live so pleasantly
Live this life of luxury
Lazing on a sunny afternoon
In the summertime, in the summertime
In the summertime
My girlfriend's run off with my car
And gone back to her ma and pa
Telling tales of drunkenness and cruelty
Now I'm sitting here
Sipping at my ice cold beer
Lazing on a sunny afternoon
Help me, help me, help me sail away
Well give me two good reasons
Why I ought to stay
'Cause I love to live so pleasantly
Live this life of luxury
Lazing on a sunny afternoon
In the summertime, in the summertime
In the summertime
Ah save me, save me
Save me from this squeeze
I've got a big fat momma tryin' to break me
And I love to live so pleasantly
Live this life of luxury
Lazing on a sunny afternoon
In the summertime, in the summertime
In the summertime, in the summertime
In the summertime"""
songtexts['Ticket to ride'] = """I think I'm gonna be sad
I think it's today, yeah
The girl that's driving me mad
Is going away
She's got a ticket to ride
She's got a ticket to ride
She's got a ticket to ride
But she don't care
She said that living with me
Is bringing her down, yeah
For she would never be free
When I was around
She's got a ticket to ride
She's got a ticket to ride
She's got a ticket to ride
But she don't care
I don't know why she's riding so high
She ought to think twice
She ought to do right by me
Before she gets to saying goodbye
She ought to think twice
She ought to do right by me
I think I'm gonna be sad
I think it's today, yeah
The girl that's driving me mad
Is going away, yeah
Oh, she's got a ticket to ride
She's got a ticket to ride
She's got a ticket to ride
But she don't care
I don't know why she's riding so high
She ought to think twice
She ought to do right by me
Before she gets to saying goodbye
She ought to think twice
She ought to do right by me
She said that living with me
Is bringing her down, yeah
For she would never be free
When I was around
Ah, she's got a ticket to ride
She's got a ticket to ride
She's got a ticket to ride
But she don't care
My baby don't care, my baby don't care
My baby don't care, my baby don't care
My baby don't care, my baby don't care (fade out)"""
Un bon site Karaoke.ru : http://www.karaoke.ru/catalog/song/24051/.
songtexts['Kogda tvoja devushka bolna'] = """День как день, только ты почему-то грустишь.
И вокруг все поют, только ты один молчишь.
Потерял аппетит и не хочешь сходить в кино.
Ты идешь в магазин, чтобы купить вино.
Солнце светит, и растет трава,
Но тебе она не нужна.
Все не так, и все не то,
Когда твоя девушка больна,
Когда больна...
Ты идешь в магазин, головою поник,
Как будто иссяк чистый горный родник.
Она где-то лежит, ест мед и пьет аспирин,
И вот ты идешь на вечеринку один.
Солнце светит, и растет трава,
Но тебе она не нужна.
Все не так, и все не то,
Когда твоя девушка больна,
Когда больна..."""
songtexts['Ahiro no Warutsu'] = """ここはとあるアヒル町
若いふたりおりました
古い家の古い部屋
古い庭にざくろの木
好きなものはクロワッサン
きらいなのは北京ダック
ふたりいつかあこがれの
パリに行くのを夢見てる
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
アヒルのワルツ
ノートルダムにシャンゼリゼ
サンジェルマンに凱旋門
モンマルトルにカルチェラタン
エッフェル塔にクリニャンクール
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
アヒルのワルツ
月月火水木金土
来る日も来る日も働いた
満員電車の窓の外
雨に霞むアヒル町
仕事もきらい上司もきらい
アヒル町も大きらい
休みはいつも寝て過ごし
パリのパの字も忘れてた
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
アヒルのワルツ
とある晴れた日曜日
雨がやんで日が差した
遠くで鳥が鳴いている
小さな花が咲いている
カフェオレ入れて朝ごはん
庭で食べようクロワッサン
ここにふたりいるだけで
足りないものは何もない
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
アヒルのワルツ
アヒルンルン アヒルンルン
ぼくたちは一生いっしょさ
アヒルンルンルンルン
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
アヒルのワルツ
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
アヒルのワルツ
大家さんの金木犀
毎年秋を教えてくれる
花屋さんの黒い犬
行くたびいつも飛んでくる
小川の横の桜の並木
線路ぞいの名も知らぬ花
アヒル町にゃカフェもある
アヒル町じゃ映画も見れる
見た目はかなり地味だけど
アヒル町はふたりのパリ
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
アヒルのワルツ
アヒルンルン アヒルンルン
アヒルンルンルンルン
アヒルンルン アヒルンルン
アヒルンルンルンルン
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
クウェ、クウェ、クウェ
クワッ、クワッ、クワッ
アヒルのワルツ"""
songtexts['Radioactive'] = """I'm waking up to ash and dust
I wipe my brow and I sweat my rust
I'm breathing in the chemicals
I'm breaking in, shaping up, then checking out on the prison bus
This is it, the apocalypse
Whoa
I'm waking up, I feel it in my bones
Enough to make my systems blow
Welcome to the new age, to the new age
Welcome to the new age, to the new age
Whoa, oh, oh, oh, oh, whoa, oh, oh, oh, I'm radioactive, radioactive
Whoa, oh, oh, oh, oh, whoa, oh, oh, oh, I'm radioactive, radioactive
I raise my flags, don my clothes
It's a revolution, I suppose
We paint it red to fit right in
Whoa
I'm breaking in, shaping up, then checking out on the prison bus
This is it, the apocalypse
Whoa
I'm waking up, I feel it in my bones
Enough to make my systems blow
Welcome to the new age, to the new age
Welcome to the new age, to the new age
Whoa, oh, oh, oh, oh, whoa, oh, oh, oh, I'm radioactive, radioactive
Whoa, oh, oh, oh, oh, whoa, oh, oh, oh, I'm radioactive, radioactive
All systems go, the sun hasn't died
Deep in my bones, straight from inside
I'm waking up, I feel it in my bones
Enough to make my systems blow
Welcome to the new age, to the new age
Welcome to the new age, to the new age
Whoa, oh, oh, oh, oh, whoa, oh, oh, oh, I'm radioactive, radioactive
Whoa, oh, oh, oh, oh, whoa, oh, oh, oh, I'm radioactive, radioactive"""
On peut créer un widget Python :
from IPython.html.widgets import interact, interactive, Button, Box
from IPython.display import display, clear_output
class TextWidget:
def __init__(self, src):
lines = src.split('\n')
self.lines = list(filter(lambda s: s != '', lines))
self.cursor = -1
def print_current_line(self):
print(self.lines[self.cursor])
def increment_cursor(self):
if self.cursor != len(self.lines) - 1:
self.cursor += 1
def reset_cursor(self):
self.cursor = -1
# main instance
txt_widget = TextWidget(src)
# layout and widgets
container = Box()
ok_button = Button(description="Prochaine ligne")
nok_button = Button(description=u"Je me suis trompé")
container.children = [ok_button, nok_button]
# interaction
def ok_click(b):
txt_widget.increment_cursor()
txt_widget.print_current_line()
def nok_click(b):
clear_output()
txt_widget.reset_cursor()
ok_button.on_click(ok_click)
nok_button.on_click(nok_click)
# display
display(container)
En fait, on peut faire mieux : un widget interactif dans lequel on peut choisir la chanson.
class song_library:
def __init__(self):
self.widget = None
def select_song(self, song_title):
if self.widget != None:
self.widget.close()
# main instance
txt_widget = TextWidget(songtexts[song_title])
# layout and widgets
container = Box()
ok_button = Button(description="Prochaine ligne")
nok_button = Button(description=u"Je me suis trompé")
container.children = [ok_button, nok_button]
# interaction
def ok_click(b):
txt_widget.increment_cursor()
txt_widget.print_current_line()
def nok_click(b):
clear_output()
txt_widget.reset_cursor()
ok_button.on_click(ok_click)
nok_button.on_click(nok_click)
# display
display(container)
self.widget = container
lib = song_library()
interactive(lib.select_song,
song_title=list(songtexts.keys()))
I'm waking up to ash and dust I wipe my brow and I sweat my rust I'm breathing in the chemicals I'm breaking in, shaping up, then checking out on the prison bus This is it, the apocalypse Whoa I'm waking up, I feel it in my bones Enough to make my systems blow