Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Create a playlist that will limit the songs to 1 track per artist? (Read 2227 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Create a playlist that will limit the songs to 1 track per artist?

Hi

I am using playlist tree for creating some playlists based on simple query.
I have seen that it is possible to limit the tracks by number of tracks/mega/minutes but would someone please explain how can I limit the query results to 1 track per artist? (a la itunes)

thanks a lot

Create a playlist that will limit the songs to 1 track per artist?

Reply #1
I am using playlist tree for creating some playlists based on simple query.
I have seen that it is possible to limit the tracks by number of tracks/mega/minutes but would someone please explain how can I limit the query results to 1 track per artist? (a la itunes)

thanks a lot

There are a couple of ways to approach this, but I recently made one using the scheme interpreter inside playlist tree that generates an hours worth of music, rated 4 or higher, without repeating an artist.

Set the "Source" to "@scheme" and set the format to this:

Code: [Select]
;;; Fill *Scheme* playlist with an hours worth, no repeat on artist
(letrec ((playlist-index (find-or-create-playlist "*Scheme*"))
(total-time 0)
(filter-string "rating GREATER 3")
(artist-list (list))
(intersect?
  (lambda (a b)
    (cond
    ((null? a) #f)
    ((member (car a) b) #t)
    (#t (intersect? (cdr a) b))))))
  (clear-playlist playlist-index)
  (for-each-db-entry
  (lambda (handle)
    (let* ((len (get-length handle))
    (artists (meta-list handle "artist"))
    (add
    (lambda (h)
      (set! artist-list (append artists artist-list))
      (add-to-playlist h playlist-index)
      (set! total-time (+ total-time len)))))
      (if (and (< (+ len total-time) (* 60 60))
(not (intersect? artists artist-list)))
  (add handle))))
  filter-string
  "$rand()")
  (activate-playlist playlist-index)
  (play-from-playlist playlist-index)
  (write artist-list))

It's available from my example page also, at http://wiki.bowron.us/index.php/Example_Queries#HARDCORE
There used to be a link to my website here.

Create a playlist that will limit the songs to 1 track per artist?

Reply #2
wow, cwbowron in person !!!

I have to be honest, it's been two days I have been studyng your code but with no luck ... it seems to be a little bit too complicated for me as it is based on mzscheme 
fact is I found playlist tree absolutely fantastic but I would like to understand more of this @scheme commands opposed to the sample playlist selection commands.

For example, let's say that I do not want songs to be picked on a rating basis, which part of your code should I remove?

I know this might be asking too much, but would it be possible to comment your code?

thx a lot for your help

Create a playlist that will limit the songs to 1 track per artist?

Reply #3
I have to be honest, it's been two days I have been studyng your code but with no luck ... it seems to be a little bit too complicated for me as it is based on mzscheme 
fact is I found playlist tree absolutely fantastic but I would like to understand more of this @scheme commands opposed to the sample playlist selection commands.

For example, let's say that I do not want songs to be picked on a rating basis, which part of your code should I remove?

I know this might be asking too much, but would it be possible to comment your code?

thx a lot for your help


if you do not want any filtering done, change where it says "rating GREATER 3" change that so that it reads #f (no quotations marks).  If you want it to filter on something else you can change the "rating GREATER 3" to any autoplaylist filter you would like.
There used to be a link to my website here.