You are not logged in.

#1 2012-04-27 13:40:42

brianb
Member
From: Montreal, QC
Registered: 2012-02-17
Posts: 81
Website

mpd/ncmpcpp and streaming: question about title displayed

Hi,

I've recently discovered the awesomeness of mpd/ncmpcpp + m3u "playlists" to stream radio stations online. That is, create a text file like oldies.m3u containing the URL to the stream, and place the file in ~/.mpd/playlists/. Then it shows up in your playlists and you can listen as if it were any other music file.

The cool thing is that for many (but not all) streams, the title that shows up in your playlist (tag #2 of ncmpcpp) changes to display the current artist and song name being streamed.

However, I find myself opening several radio streams in my playlist, so that I can switch around when a song comes on that I don't care for. The problem is that when I switch away from a stream, the title that is displayed remains as the last currently played artist/song instead of the stream name. This makes it difficult to remember which items in the playlist are which streams.

Example: Suppose I have two playlists/streams, oldies.m3u which streams Oldies Alternative and somafm_bootliquor.m3u which streams Soma FM: Bootliquor. Let's say I add both to my playlist in ncmpcpp. I begin streaming oldies.m3u and the title changes from "Oldies Alternative" to the current track, "Fats Domino - Bo Weevil - ...". I decide now to switch to somafm_bootliquor.m3u for a while. The title displayed for oldies.m3u remains as Fats Domino, which makes it difficult for me to remember later on that that's actually Oldies Alternative (and not, say, one of my other oldies stations).

So if I have, say, 10 stations in my playlist, and I've switched around a lot, all the titles are now artists/songs that were played minutes or even hours ago, instead of the station names.

Question: Is there any way to make it so that when I switch away from a stream, the title changes back to the station name, e.g. "Oldies Alternative"?

Somewhat related question: What would also be amazing is if I could get artist info and lyrics just like with normal files, but this doesn't work because the title of a stream includes both song and artist name, e.g. Title: Fats Domino - Bo Weevil ..., instead of Title: Bo Weevil, Artist: Fats Domino. Anyone know if it's possible to get this working properly?

Last edited by brianb (2012-04-27 14:25:09)

Offline

#2 2014-01-01 01:29:10

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: mpd/ncmpcpp and streaming: question about title displayed

i hope i won't be accused of necrobumping.
i had the same problem (although i listen to quite different music ;-) so this is still a valid issue.
searching the wild web, my first (and only relevant) result pointed to this thread.
after some fiddling, i found that ncmpcpp offers a solution.
not 100% as op wished, but good enough for me.

the problem is that radio stations usually fill only 1 tag which usually contains, well, whatever data, usually the title of the song plus artist. mpd/ncmpcpp still derives the name of the station somehow. it is stored in the filename %f tag.
this is quite different from how audio file tags are composed.
so by defining an OR condition for a tag that is most probably not being filled by the radio station (i chose artist %a), i get a sane layout whether i play radio or some songs from my database.

just find the following values in your ~/.ncmpcpp/config and replace them:

user_interface="alternative"
alternative_header_first_line_format ="$b$5«« {%a}|{%t} »»$9$/b"
alternative_header_second_line_format ="$b$5 {%b}|{%f} {%b} ({%y})$9$/b"
song_columns_list_format = "(40)[blue]{a|f} (40)[green]{tE} (20)[blue]{bE}"

my example is done with the alternative layout; but the logic is the same for the normal layout.

Offline

Board footer

Powered by FluxBB