You are not logged in.
aqtrans: Regarding m3u files, most other players know what do to with them. You can disable m3u loading. Set line 13 to "playlist_exts = []". If it becomes more of a problem, I'll move that part to the config file. After editing the extensions list, rerun "albumbler sync". Some sort of pattern matching to avoid directories might be useful, but it can already learn that you don't like those directories. Might be a needless complication.
onearm:
Added, use "gmusicbrowser". But are you sure that works? Most players need some sort of "clear playlist" command first. And there is nothing in the man page or documentation that looks like those options. Are they actually FIFO commands?
Testing period is over, Albumbler is finally in the AUR.
Offline
Very interesting idea/project !
Works really great with mpd.
Offline
very neat. still testing it to see how it "guesses" (charts). :} thankfully i haven't uninstalled mpd yet so i can use that. would like to see mplayer support but it's no big deal. i've already got an mplayer [daemon] script but not with learning capabilities. hadn't thought of that before. mplayer can be used as a slave and read from a fifo, which commands may be sent through. it handles playlists (m3u, etc).. aka loadlist, and regular file(s).. aka loadfile, with ability to append (not that it's useful for a program like yours). a list of some commands and how it may be used ( http://www.mplayerhq.hu/DOCS/tech/slave.txt ) just an idea anyway, as i'd like to remove mpd alltogether. anyway, great idea, and thanks. :}
Offline
onearm:
Added, use "gmusicbrowser". But are you sure that works? Most players need some sort of "clear playlist" command first. And there is nothing in the man page or documentation that looks like those options. Are they actually FIFO commands?
No they aren't, they are simply commands to replace whatever playlist there is with the album from albumbler (-playlist does that) and start playing (-play). There is a
-F fifo
option but I didn't try it, mine was just a 2min hack
It works though.
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
How does this work? How does it know which music I will want to hear?
Offline
It guesses, remembers and learns.
It assumes your collection can be divided into two constantly changing halves - stuff you want to hear right now and stuff you don't. It gives you A. Skip. B. Skip. C. Skip. D. Listen. This gets recorded as a session. Later, it give you B. Skip. Now, it knows when you did not want to hear B, you also did not want to hear A or C. So it lowers the odds of you getting those. It keeps track of everything individually, and presumes nothing about what you want to hear. You could even have two people with completely different taste using Albumbler, and after the first guess or two it would have a good idea who is sitting at the keyboard.
I have different music I listen to for work or play or reading. It can figure this out, instead of having me stop what I am doing to pick out a playlist.
Offline
I found this very interesting, but I have some problems with it.
First, your music dir must be organized well. In the following case:
A
Artist A
Album A
Artist AB
Album AB
B
B something
Album C
C
CCC
Album D
Strange dir
I found albumbler treat every directory as an album, a valid item to play. It might play A for you and that would include Album A and Album AB. I don't think that's correct. The code is
def dir_tree(dir_root):
tree = list(os.walk(dir_root))
dirs = [t[0] for t in tree]
playlists = [os.path.join(t[0],f) for t in tree for f in t[2] if os.path.splitext(f)[1] in playlist_exts]
return dirs + playlists
The second line in this function, I would suggest to be
dirs = [t[0] for t in tree if t[2]]
`t[2]` is the file list in that directory. If there is no files, it shouldn't be considered a valid item. And this doesn't really fix, because it could be a directory without music files.
Also, when resync, albumbler should also re-check all items. I noticed the `resync()` is extending the cache. Some items (dir) might not have music files anymore. More, if someone mess the directory, like replace one with another. The weight might be mis-given since I don't see any unique id (using hash or something, based on album songs) for directories.
I know albumbler rely on directory of file system, not meta data in music files. There is a possibility that someone is too lazy to organize, he or she could just dump all music files in one single directory. In that extreme case, albumbler can't be useful. However, if it reads meta data, then more library dependency that albumbler would require.
Just few thoughts. I think this has good potential as a standalone or as a plugin in music player.
Last edited by livibetter (2010-09-20 23:01:55)
Offline
I tried to edit the wiki-like http://kmkeen.com/albumbler page and probably messed it up, sorry.
I just wanted to say that using ratpoison's normal messaging system as a notifier works. To add it, I just added
if conf['notify'] == 'ratpoison':
call('ratpoison -c "echo Now Playing: %s"' % os.path.basename(play))
in the appropriate place. Ratpoison is a window manager that you will be using very soon.
Offline
Thanks! Added to the code.
Offline
How about xmms2?
usage: nyxmms2 <command> [args]
Available commands:
play
pause
stop
toggle
seek
status
prev
next
jump
info
search
list
add
remove
move
exit
help
playlist <subcommand>
collection <subcommand>
server <subcommand>
archlinux|xmonad
++++++++++[>++++++++>+++++++>+++<<<-]>+++.>---.<----.+++++..>>++.<++++++++.--.-----..+.<--.
Offline
It's very difficult not to get curious about the data albumbler is collecting on my tastes. Any chance of any flag to give to albumbler so it'll dump it's graph in some sloppy way?
Offline
jbaber:
"albumbler best" and "albumbler worst" will give you a birds eye view. If you really want to get deep into things, fire up python and unpickle the log file at ".local/share/albumbler/albumbler.pickle". (Details about the datatype are in the source.)
ScottKidder:
Done. (I think. The playlist is seems to work, but I get servererror every time play starts.)
Offline
Thanks again for this great program. I'm using it for hours every day.
Is it normal for albumbler to take up to two minutes to finish? Sometimes it works instantly and sometimes it tells me immediately what's going to play and I see python chugging in 'top' for a few minutes before it finishes and moc finally reacts. I thought it was my moc setup for a while, but it seems to be albumbler.
Offline
I have since switched to cmus and am just starting to work my way through my collection and see how albumbler works out for me. (looks great so far!) A few things: I have a lot of directories (albums) and a lot of compilations that get sorted like so: ~/music/artist/album/song. This makes me get loads of playlists that are only one track long, it would be nice to listen to x amount of songs that I want to hear now. Anyways, I'll probably start hacking around and see what I come up with. Cheers!
archlinux|xmonad
++++++++++[>++++++++>+++++++>+++<<<-]>+++.>---.<----.+++++..>>++.<++++++++.--.-----..+.<--.
Offline
ScottKidder:
I have the same problem, a bunch singles with the same directory structure. I had always taken it as more of a challenge for the training algo, since I rarely want to listen to them. But it is kind of annoying, and Albumbler is all about convenience.
Look at how the max_playlist variable is used. Or just download the latest version, it has support for MinPlaylist. Enjoy.
jbaber:
I think it is Mocp. By default it pre-loads all the metadata. If your music is over a network share, this means some amount of lag.
ReadTags = no
seems to clean this up. (Tags will still be read, but not until the track is played.)
Last edited by keenerd (2011-01-26 13:47:20)
Offline
You must be right that it's because I'm reading directories over an sshfs mount (the slowest possible way to network mount, I'm sure).
ReadTags = no
in my .moc/config did make albumbler succeed instantaneously more often, but I still get super long times sometimes -- almost definitely my network, not albumbler.
What is albumbler waiting for, though? Doesn't it send the playlist commands to mocp, announce what's about to play, then stop execution? The entire time I'm waiting for a playlist to start, albumbler is running.
P.S. I cannot repeat too often how great albumbler is. When I explained it to someone, they mentioned that you really ought to make a phone app that does it and make your millions...
Offline
Hi, at what point does this get better than "clear + add random album"? I have >1000 entries in the database, does it have to go through all of them for me to see any effect?
Also is there anything one should pay attention to when teaching the program?
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
I've added Clementine: http://www.archlinux.org/packages/commu … lementine/
I also cleaned up the code to fix one of my pet peeves - using 'if' when it should be 'elif'
if conf['notify'] == 'console':
print play
elif conf['notify'] == 'notify-send':
call('notify-send "Now Playing: %s"' % os.path.basename(play))
elif conf['notify'] == 'ratpoison':
call('ratpoison -c "echo Now Playing: %s"' % os.path.basename(play))
if conf['player'] == 'mocp':
call('mocp --clear')
call('mocp --append "%s"' % play)
#call('mocp --sync')
call('mocp --play')
elif conf['player'] == 'mpd':
port(6600, 'clear\n')
port(6600, 'add "%s"\n' % strip_dirs(play, conf['music_paths']))
port(6600, 'play\n')
elif conf['player'] == 'cmus':
call('cmus-remote -c')
call('cmus-remote "%s"' % play)
call('cmus-remote -C "view 3" "win-activate"')
elif conf['player'] == 'rhythmbox':
call('rhythmbox-client --clear-queue')
[call('rhythmbox-client --play-uri="%s"' % track) for track in list_files(play)]
call('rhythmbox-client --play')
elif conf['player'] == 'audacious':
call('audtool --playlist-clear')
[call('audtool --playlist-addurl "%s"' % track) for track in list_files(play)]
call('audtool --playback-play')
elif conf['player'] == 'gmusicbrowser':
call('gmusicbrowser -play -playlist "%s"' % play)
elif conf['player'] == 'xmms2':
call('nyxmms2 remove "*"')
call('nyxmms2 add "%s"' % play)
call('nyxmms2 play')
elif conf['player'] == 'clementine':
call('clementine -s')
call('clementine -l "%s"' % play)
call('clementine -p')
Offline
I got annoyed by it trying to "play" folders that had only one song in them. MinPlaylist is fine, but sometimes there are non-music files in there, like cover JPGs and the like, so albumbler would still try to play them. So I add a simple regexp to just count "music files" in the reasonable_dir function:
import re
def reasonable_dir(path):
"Estimates size of recursive add."
if not os.path.isdir(path): # assume any custom playlists are reasonable
return True
length = 0
musicext = re.compile('.*\.(mp3|flac|ogg|wav)$')
for w in os.walk(path):
for mname in w[2]:
if musicext.match(mname) :
length += 1
if length > conf['max_playlist']:
return False
if length < conf['min_playlist']:
return False
return True
Probably could add a config string for it instead.
Last edited by jdarnold (2011-02-22 16:36:35)
Offline
hut: Good question. I have no idea. You certainly don't have to go through everything. Just enough to find a pattern.
jdarnold: Merged and released. By the way, the if/elif/elif symmetry bugs me more. If I was forced to use elif, I'd preface it with "if false: pass; elif ...." just so the tests all look the same. Anyway, neither are "good" at this many options. It really should be a dict of lambdas or something. I've got it half cleaned up now.
Edit. Posted before I saw the ext check patch. Let me think about that one.
Last edited by keenerd (2011-02-22 18:51:55)
Offline
Yup, I was thinking the same thing about the indirection for the various players and notifiers, but hey, it works just fine. And albumbler even exposed a bug in clementine!
Last edited by jdarnold (2011-02-22 20:52:26)
Offline
So sorry to resurrect a dead topic, but man, I love this little script.
One thing that bothered me, though, is that albumbler sees any m3us in the music directory, and decides they're albums too. This may be true for some collections, but definitely not mine.
So, here's my itch scratched: http://pastebin.com/JLyS6w2U
I added a config file entry: ignoreplaylists. Defaults to false, for the same behavior as the current script. Add 'ignoreplaylists = True' to your albumbler.config, and... yeah, enough said.
Anyway, my next step will be making sure only directories that contain valid music files. Could probably also make it check playlists to see if they contain valid audio files, which would be the more elegant version of my above patch. Maybe later, when I'm not so... chemically distracted.
Keenerd, this script is awesome. Thank you.
Offline
Hey, it is not dead!
I think I'll go about adding this feature a little differently. Instead you'll be able to configure the valid playlist extensions. Null the list to ignore everything. I'll do that this weekend.
Offline
hi Keennerd
just discoverd this awesome script and really like it could there be a way to manually assign a 'like' or 'fav' mark to albums which would make it jumo to the top of the albumbler list?
thx again
Zeltak
Offline
kerobaros: Very busy weekend, still working on your request.
zeltak: Sorry, no. That would defeat the purpose. Off the top of my head I can't even think of a good way to bias the algo. If you know a little python, it would be possible to keep certain albums at 1.0 probability but maintaining that list would be a pain.
Offline