Playlist Coding

Started by BrianA, October 09, 2010, 08:08:58 AM

Previous topic - Next topic

BrianA

I am trying to figure out how to generate a playlist based upon certain percentages of catorgies.

I.E 70s Hard Rock 20%, 80s Hard Rock 25%, 80s New Wave 15%, Current Top40 25%, Current Alternative Rock 15%, over a 2 hour time period.

Is this possible?

B

Dr.J

It is possible but must be coded by hand, there isn't a percentage option in the template language.

Out of a 20 song set you will have:

4 = 70s Hard Rock
5 = 80s Hard Rock
3 = 80s New Wave
5 = Current Top40
3 = Current Alternative Rock

You need to decide how the songs will be grouped or dispersed. Once you have that you can code them appropriately. Something like this would work:

~length hours=2
~iq=2 avail & rating > 0 & (70s Hard Rock) & itemsep artist > 40 & itemsep title > 40
~iq=3 avail & rating > 0 & (80s Hard Rock) & itemsep artist > 40 & itemsep title > 40
~iq=2 avail & rating > 0 & (80s New Wave) & itemsep artist > 40 & itemsep title > 40
~iq=3 avail & rating > 0 & (Current Top40) & itemsep artist > 40 & itemsep title > 40
~iq=2 avail & rating > 0 & (Current Alternative Rock) & itemsep artist > 40 & itemsep title > 40
~iq=2 avail & rating > 0 & (70s Hard Rock) & itemsep artist > 40 & itemsep title > 40
~iq=2 avail & rating > 0 & (80s Hard Rock) & itemsep artist > 40 & itemsep title > 40
~iq=1 avail & rating > 0 & (80s New Wave) & itemsep artist > 40 & itemsep title > 40
~iq=2 avail & rating > 0 & (Current Top40) & itemsep artist > 40 & itemsep title > 40
~iq=1 avail & rating > 0 & (Current Alternative Rock) & itemsep artist > 40 & itemsep title > 40




BrianA

the number of songs per category will work just fine.  Thank you very much!

B

BrianA

# Breakfast 9AM-11AM

# Global options:
~length items=30

# Iteration:
# 60s Pop Rock: 1
# 60s RB: 1
# 60s British Invasion: 4
# 60s Blues Rock: 2
# 70s Blues Rock: 2
# 80s College Rock: 1
# 60s Folk Rock: 2
# 70s Folk Rock: 2
# 70s Pop Rock: 2
# 80s Pop Rock: 4
# 90s Pop Rock: 4
# 2000s Pop Rock: 1
# Current Pop Rock: 1
# Reggae: 1
# 80s New Wave: 2
# Tempo Range: 85 BPM - 110BPM

# ~priority lastplay=50, rating=80, random=100

~iq=1 avail & rating > 5 & (60s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s RB) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s British Invasion) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s Blues Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (70s Blues Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (80s College Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s Folk Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (70s Folk Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (70s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (80s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (90s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (2000s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (Current Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (Reggae) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (80s New Wave) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s British Invasion) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s Blues Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (70s Blues Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s Folk Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (70s Folk Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (70s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (80s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (90s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (80s New Wave) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s British Invasion) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (80s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (90s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (60s British Invasion) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (80s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110
~iq=1 avail & rating > 5 & (90s Pop Rock) & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110


This is coding i'm currently using that i'm getting an OMQL error when i load the playlist.  Any suggestions?

B


Lane

I suggest you comment out all lines, and then uncomment one by one until you hit the error, and then check those categories to be sure they're valid. Note, I typically put quote around categories that have spaces.
It's all just programming :P

milky

Any categories that have embedded spaces MUST be included in double quotes.
e.g. ~iq=1 avail & rating > 5 & ("60s Pop Rock") & itemsep artist > 40 & itemsep title > 40 & BPM >= 85 & BPM <= 110

Personally, I avoid embedded spaces, by using underscores instead. e.g. 60s_Pop_Rock.
OtsDJ           PDI = PAAA-BHVP,  PBQN-3658
S & L               PDI = PAAA-BK27 x 2
Studio             PDI = PAAA-BL38