Smart DJ

Amarok 1.x Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
5.0
Description:

Smart DJ lets you find tracks based on how similar they sound to each other. It can also automatically add new tracks to your playlist based on how similar they are to what you've been listening to.

In addition to PyQt, this requires songanalysis (0.4.0 or higher), python-commandsplus, python-extattr, python-Observable and python-amarok (these last two are new dependencies) which can be found at

http://rudd-o.com/projects/

(the RPM packages have been linked here for your convenience, and will work if you have Fedora Core 4; the source packages are available at the aforementioned URL, and packages for other distributions may be found in the comments section of this page, thanks to very thoughtful and considerate individuals).

Songanalysis requires the GNU Scientific Library (package named libgsl or gsl, depending on your operating system), mpg321 (package mpg321) and ogg123 (package vorbis-tools).
Last changelog:

15 years ago

- Fixed various bugs
- Functionality was split into separate libraries which can be used standalone now

Db0

15 years ago

OK it works now :)

Great!

Report

gordin

15 years ago

I submitted ebuilds for gentoo to http://bugs.gentoo.org for songanalysis, python-commandsplus and python-extattr.
They can be found at
http://bugs.gentoo.org/show_bug.cgi?id=114243
http://bugs.gentoo.org/show_bug.cgi?id=114245
http://bugs.gentoo.org/show_bug.cgi?id=114246

have fun

Report

blaster999

15 years ago

... ats tartup, try changing the line 232 of amarok.py to
logger.debug("Detected SQLite/PostgreSQL as database type")

(erease "self." at the beginning). That worked for me. YMMV.

Report

C

RuddO

15 years ago

This bug has been fixed now

Report

zefo

15 years ago

Traceback (most recent call last):
File "/home/jose/.kde/share/apps/amarok/scripts/Smart DJ/Smart DJ", line 61, in ?
test_ui()
File "/home/jose/.kde/share/apps/amarok/scripts/Smart DJ/Smart DJ", line 58, in test_ui
import uiqt as ui
File "/home/jose/.kde/share/apps/amarok/scripts/Smart DJ/uiqt.py", line 15, in ?
from qt import *
RuntimeError: the sip module supports API v%u.0 to v%u.%u but the %s module requires API v%u.%u

Report

C

RuddO

15 years ago

Your SIP bindings do not match your PyQt or Qt library version. Update them three.

Next version will have a message box if this happens, advising about the best course of action.

Report

wdsl

15 years ago

do i need for debian?

I can't find this RPM packets for Debian ;-(

thx
wdsl

Report

blaster999

15 years ago

You can compile from sources. You need songanalysis, python-commandsplus and python-extattr. You can get them all from http://www.usm.edu.ec/~amadorm/software/

Report

jdm33

15 years ago

Hi,

Nice work - I'd been wondering whether something like this was possible for a while.

To get the script (v 0.3.6) working though, I had to hack the script to replace SQL uses of GREATEST/LEAST with MAX/MIN as GREATEST/LEAST don't seem to be supported by my DB backend.

I think my backend is sqlite, but it doesn't actually look as though amarok links the sqlite library in so I'm getting confused. Certainly I debugged the problem by trying out the SQL sql from the log file in sqlitebrowser and that told me that 'GREATEST'/'LEAST' aren't recognized.

Is it possible to fix this or is there some major headache here with different DBs supporting different SQL variants?

Report

C

RuddO

15 years ago

Now there is support for SQLite

Report

blaster999

15 years ago

Well, Oracle and MySQL both support least() and greatest(), but SQLite and Postgres do not. Min() and max() are better supported.

BTW, amaroK has a builtin version of sqlite, so it doesn't link to an external sqlite lib.

Report

HessiJames

15 years ago

Hi, very good that now apostophes are supported. But I can't find similar tracks, when I click on one and select "find tracks similar to selection...". I have scanned a song which I have twice. Both have 135 bpm.

Report

C

RuddO

15 years ago

Lots of bugs have been fixed. I suggest you give it another go. If you are using SQLite as the database type (which is the default) then you'll see it working now.

Report

C

RuddO

15 years ago

I need more details in order to help you with the issue. Saying "i cannot find any tracks" without letting me know error messages, behaviours, or what the log file says, is close to useless for debugging.

Report

ChrisFritz

15 years ago

I've been having the same problem as this person -- when I get a chance, I'll see if I can figure out what's going on, and e-mail anything I find, if I find anything.

Report

ChrisFritz

15 years ago

Ah, I see jdm33 further below in the comments found the solution. When I changed the greater/least to max/min, it worked out just fine (I'm still running an older Smart DJ, so I don't know if this was already fixed in the current release after jdm33's comment.) Now that this works, I can finally enjoy the script =D

Report

fungs

15 years ago

Thanks, I appreciate your work. I just couldn't understand why somebody took so much time to write this plugin but didn't have the 10 minutes to write a short descriptional text. :)

No really, screenshots are candy but at least _some_ text is obligatory.

However, good work...

Report

ChrisFritz

15 years ago

I'm very interested in this plug-in, but it appears to reach an infinite loop when analyzing a file which contains an apostrophe. I'm not familiar with Python enough to determine what coding to change to fix this.

I believe the problem is an apostrophe in the filename because all my other files had no problem, until this one which kept looping this data in the log:

---------------------
INFO:SongAnalyzer: Processing: /home/chris/Music/CDs/Pokemon/2BA Master/11 - Misty's Song.ogg
DEBUG:SongAnalyzer: Songanalysis interface available: 2 used for this song: 2
DEBUG:SongAnalyzer: A-OK, we only collect
DEBUG:SongAnalyzer: collecting info from extattrs
DEBUG:SongAnalyzer: collected 124.190369 [...etc...] 4.357717
---------------------

Other files from that CD analyzed without problems. So, I moved that file to somewhere else, and restarted Smart DJ. Everything was fine until it reached another file with an apostrophe, and kept looping:

---------------------
INFO:SongAnalyzer: Processing: /home/chris/Music/CDs/Sailormoon/Sailor Moon: Songs From the TV Series/She's Got The Power.ogg
DEBUG:SongAnalyzer: Songanalysis interface available: 2 used for this song: 2
DEBUG:SongAnalyzer: A-OK, we only collect
DEBUG:SongAnalyzer: collecting info from extattrs
DEBUG:SongAnalyzer: collected 150.093596 [...etc...] 2.780481
---------------------

I hope this problem is easy to identify and fix.

Report

C

RuddO

15 years ago

Please send me the log file to better understand what it's doing. My e-mail address is dragonfear@gmail.com.

Report

ChrisFritz

15 years ago

I already e-mailed the author this information, but I'll repeat it here in case anyone has the same problem I had.

I use SQLite, and have some files with an apostrophe (') in the filename. Smart DJ escapes SQL statements with a backslash, but SQLite escapes with an apostrophe. Because of this, when Smart DJ tries to enter database information and move to the next song, no information is entered and it's unable to move. It keeps looping over the same song.

If you use SQLite, here's a fix you can use (which causes the script to escape SQLite statements, but it won't work with other databases now). In the "Smart DJ" file, I've made this change (the post will probably remove the Python spacing):

def sql_escape(string):
newstring = []
for c in string:
if c == "'":
newstring.append("''")
# if c == "\\":
# newstring.append("\\\\")
# elif c == "'":
# newstring.append("\\'")
else:
newstring.append(c)
return "'" + "".join(newstring) + "'"

Again, this comments out MySQL and Postgresql escaping and puts in SQLite escaping.

Report

bsander

15 years ago

I seem to be experiencing the same problem, I'll send my log file too :)

Report

HessiJames

15 years ago

Hi, this looks very very cool, but I was unable to test it. At first here I have built some packages for suse 9.3:
http://kaligames.de/rpms/python-commandsplus-0.2.1-1.suse9.3.noarch.rpm
http://kaligames.de/rpms/python-extattr-0.1.2-1.suse9.3.noarch.rpm
http://kaligames.de/rpms/songanalysis-0.3.0-1.suse9.3.i386.rpm

When I want to configure the script or want view similar track by selecting this option in the context menu, I get an error message:

Something went wrong in the monitor loop. This is not your fault, but a bug in the Smart DJ plug-in. Please report the contents of the file ~/.smartdj.log to the Smart DJ plug-in developers.

I'll send you the log file by e-mail.

Report

HessiJames

15 years ago

so and here is the new rpm of songanalysis 0.4:

http://kaligames.de/rpms/songanalysis-0.4.0-1.suse9.3.i386.rpm
http://kaligames.de/rpms/songanalysis-0.4.0-1.src.rpm

Report

C

RuddO

15 years ago

Thanks for your effort. I'm tracking the bug down right now as we speak, probably have a new release tomorrow. Subscribe to the release (if that-s possible on KDE apps) or check back tomorrow night.

Report

kayosiii

15 years ago

Looks really cool... gets my vote Anybody know which if there are equivalent debian packages to the ones listed here. Which version of Python is it based on?

Report

15 years ago

- Fixed various bugs
- Functionality was split into separate libraries which can be used standalone now

12345678910
Be the first to comment
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.6.0
updated Dec 28 2005
added Nov 18 2005
downloads 24h
0
mediaviews 24h 0
pageviews 24h 0
System Tags addon