Vladimir Todorov
2011-06-02 07:08:47 UTC
Hello Everyone,
Yesterday I tested the ordering of songs when the album contains more than
one CD and the Disk # is specified as "Cd1" / "CD 1" .. instead of just "1"
and it worked just fine. I also tried to load all of my mp3s to see if cmus
will hang again but it didn't so I presume that these features are working
as expected.
Now I have an idea. I hope you will like it.
Is it possible to add another view to cmus - the lyrics view. We can bind it
to the key '8' or the settings view can go to '8' and the lyrics view can go
to '7'.
I really like to be able to see the lyrics of the currently playing song. I
think that other people would like it too.
A little more explanation:
Several days ago I found a script that downloads the lyrics of specified
Artist and Title from wiki lyrics. I enhanced the script by wrapping it into
another script that first checks if the lyrics are available in a local
cache dir and if so they are linked to /home/$USER/lyrics, otherwise the
script that downloads the lyrics is invoked and if the lyrics are found they
are saved to "$baseLyricsDir/Artist/Artist - Title.txt" and after that they
are linked to /home/$USER/lyrics. If the lyrics are not found
/home/$USER/lyrics points to a file that contains the text "no lyrics
found". That way I have my own database of lyrics and the script works
faster when the lyrics are found locally. And the lyrics are not downloaded
every time when they are requested.
The script also checks if the Artist/Title information from the ID3 tags is
null or empty and if so it tries to extract that information from the
filename using a regex. After that I created an alias in my .bashrc file
(alias lyrc="cat /home/$USER/lyrics"). I attached this script to cmus
(status_display_program) and whenever I wanted to see the lyrics I just had
to type "lyrc" in the terminal (I am using tilda so I always have a terminal
opened).
This works fine but I think it will be a good idea to have this feature
inside the cmus player. It doesn't have to download the lyrics from internet
- it just needs to look for the lyrics inside a particular directory which
will be specified in the settings. The format that could be used is
"$baseLyricsDir/Artist/Artist - Title.txt" ($baseLyricsDir will be
configurable). The Title and the Artist will be extracted from the ID3 tag
and if they are not found they could be extracted from the filename with a
regex if the filename satisfies a predefined pattern. Also if the mp3 file
contains lyrics (embedded lyrics) they should have priority over the lyrics
in the local cache. The check if the lyrics are found in the cache and
should be displayed should be done on every lyrics_view_show event because
if a script is used to download the lyrics from internet we will have a
delay before the lyrics appear on the hard drive (if they are found at all).
And after I had the scripts that download the lyrics and link them I wrote a
script that changes the song in cmus on every two seconds and I mute the
volume. That way I succeeded to download 6 000 lyrics over one night. I know
it is lame but for now it is what it is ; )
What do you think about the idea?
Also if someone is interested I could send the full set of scripts that do
this thing. Improvements and suggestions will be appreciated.
/v
Yesterday I tested the ordering of songs when the album contains more than
one CD and the Disk # is specified as "Cd1" / "CD 1" .. instead of just "1"
and it worked just fine. I also tried to load all of my mp3s to see if cmus
will hang again but it didn't so I presume that these features are working
as expected.
Now I have an idea. I hope you will like it.
Is it possible to add another view to cmus - the lyrics view. We can bind it
to the key '8' or the settings view can go to '8' and the lyrics view can go
to '7'.
I really like to be able to see the lyrics of the currently playing song. I
think that other people would like it too.
A little more explanation:
Several days ago I found a script that downloads the lyrics of specified
Artist and Title from wiki lyrics. I enhanced the script by wrapping it into
another script that first checks if the lyrics are available in a local
cache dir and if so they are linked to /home/$USER/lyrics, otherwise the
script that downloads the lyrics is invoked and if the lyrics are found they
are saved to "$baseLyricsDir/Artist/Artist - Title.txt" and after that they
are linked to /home/$USER/lyrics. If the lyrics are not found
/home/$USER/lyrics points to a file that contains the text "no lyrics
found". That way I have my own database of lyrics and the script works
faster when the lyrics are found locally. And the lyrics are not downloaded
every time when they are requested.
The script also checks if the Artist/Title information from the ID3 tags is
null or empty and if so it tries to extract that information from the
filename using a regex. After that I created an alias in my .bashrc file
(alias lyrc="cat /home/$USER/lyrics"). I attached this script to cmus
(status_display_program) and whenever I wanted to see the lyrics I just had
to type "lyrc" in the terminal (I am using tilda so I always have a terminal
opened).
This works fine but I think it will be a good idea to have this feature
inside the cmus player. It doesn't have to download the lyrics from internet
- it just needs to look for the lyrics inside a particular directory which
will be specified in the settings. The format that could be used is
"$baseLyricsDir/Artist/Artist - Title.txt" ($baseLyricsDir will be
configurable). The Title and the Artist will be extracted from the ID3 tag
and if they are not found they could be extracted from the filename with a
regex if the filename satisfies a predefined pattern. Also if the mp3 file
contains lyrics (embedded lyrics) they should have priority over the lyrics
in the local cache. The check if the lyrics are found in the cache and
should be displayed should be done on every lyrics_view_show event because
if a script is used to download the lyrics from internet we will have a
delay before the lyrics appear on the hard drive (if they are found at all).
And after I had the scripts that download the lyrics and link them I wrote a
script that changes the song in cmus on every two seconds and I mute the
volume. That way I succeeded to download 6 000 lyrics over one night. I know
it is lame but for now it is what it is ; )
What do you think about the idea?
Also if someone is interested I could send the full set of scripts that do
this thing. Improvements and suggestions will be appreciated.
/v