You are not logged in.

#26 2010-08-18 13:09:29

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Albumbler - A psychic playlist generator

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

#27 2010-08-18 19:22:24

ApotheoZ
Member
Registered: 2009-08-10
Posts: 40

Re: Albumbler - A psychic playlist generator

Very interesting idea/project !
Works really great with mpd.

Offline

#28 2010-08-19 00:44:43

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Albumbler - A psychic playlist generator

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

#29 2010-08-19 06:58:40

onearm
Member
From: Anywhere but here
Registered: 2006-07-06
Posts: 359
Website

Re: Albumbler - A psychic playlist generator

keenerd wrote:

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 smile
It works though.


To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github

Offline

#30 2010-09-18 12:25:30

greenmanwitch
Member
Registered: 2009-04-20
Posts: 21

Re: Albumbler - A psychic playlist generator

How does this work? How does it know which music I will want to hear?

Offline

#31 2010-09-18 16:11:52

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Albumbler - A psychic playlist generator

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

#32 2010-09-20 22:23:22

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: Albumbler - A psychic playlist generator

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

#33 2010-11-22 18:00:06

jbaber
Member
Registered: 2010-11-22
Posts: 5
Website

Re: Albumbler - A psychic playlist generator

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

#34 2010-11-23 15:48:55

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Albumbler - A psychic playlist generator

Thanks!  Added to the code.

Offline

#35 2010-12-07 05:15:46

ScottKidder
Member
Registered: 2008-10-27
Posts: 23

Re: Albumbler - A psychic playlist generator

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

#36 2010-12-08 00:16:26

jbaber
Member
Registered: 2010-11-22
Posts: 5
Website

Re: Albumbler - A psychic playlist generator

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

#37 2010-12-09 23:40:12

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Albumbler - A psychic playlist generator

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

#38 2011-01-04 18:52:01

jbaber
Member
Registered: 2010-11-22
Posts: 5
Website

Re: Albumbler - A psychic playlist generator

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

#39 2011-01-26 05:13:04

ScottKidder
Member
Registered: 2008-10-27
Posts: 23

Re: Albumbler - A psychic playlist generator

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

#40 2011-01-26 13:37:54

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Albumbler - A psychic playlist generator

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

#41 2011-02-15 14:43:02

jbaber
Member
Registered: 2010-11-22
Posts: 5
Website

Re: Albumbler - A psychic playlist generator

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

#42 2011-02-22 14:28:32

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

Re: Albumbler - A psychic playlist generator

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

#43 2011-02-22 16:06:04

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Albumbler - A psychic playlist generator

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' smile

    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

#44 2011-02-22 16:34:44

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Albumbler - A psychic playlist generator

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

#45 2011-02-22 18:48:18

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Albumbler - A psychic playlist generator

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

#46 2011-02-22 20:52:04

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Albumbler - A psychic playlist generator

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

#47 2011-04-30 06:56:58

kerobaros
Member
Registered: 2009-09-28
Posts: 2

Re: Albumbler - A psychic playlist generator

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

#48 2011-05-06 03:47:55

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Albumbler - A psychic playlist generator

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

#49 2011-05-09 03:09:49

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Albumbler - A psychic playlist generator

hi Keennerd

just discoverd this awesome script and really like it smile 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

#50 2011-05-09 07:05:14

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Albumbler - A psychic playlist generator

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

Board footer

Powered by FluxBB