Author Topic: Sweep on a group of songs  (Read 570 times)

taz1033

  • New User

  • Offline
  • *
  • 4
Sweep on a group of songs
« on: April 08, 2019, 08:49:24 PM »
Hello I would like to assign a group of sweepers for a group of songs in a rotation
for example I do want the rotation to pick out a sweeper that talk about 80 s music on a group of 80 s music and a different group of sweepers for 60 s music only on 60 s songs.
can it be done without adding the sweeper manually to every song ?

Thank you

Eli

PROducer

  • Hero Member

  • Offline
  • *****
  • 587
  • Personal Text
    Long Time Radio Guy
    • The Rooster
Re: Sweep on a group of songs
« Reply #1 on: April 09, 2019, 12:28:21 AM »
I've done something similar in SQL.

https://www.radiodj.ro/community/index.php?topic=13001.msg73088#msg73088

I've also used SQL to have "Year" sweepers... It teams a "Here's a song from" ID with a year shout ID and plays them together before a song from the same year.  The SQL figures out what year the next song came out & builds a playlist from that.

Chip Douglas Mosley

  • Sr. Member

  • Offline
  • ****
  • 461
  • Personal Text
    Retired disc jockey and radio programmer
    • Jukebox 92.7 WEPQ Internet Oldies Radio
Re: Sweep on a group of songs
« Reply #2 on: April 09, 2019, 12:55:56 AM »
Your link doesn't go anywhere. Please update it if you can, because I'd love to see how you do the year shout. I do something similar, but I recorded the year shout and music into the same file to do it.

Thanks!
Chip Douglas Mosley
Jukebox 92.7 WEPQ
www.jukebox927.com
Radio DJ user since 2016, Live365 since 2019
Previously using v2.0.3.1 since June 9, 2021
Upgraded to v2.0.3.4 on December 12, 2021

PROducer

  • Hero Member

  • Offline
  • *****
  • 587
  • Personal Text
    Long Time Radio Guy
    • The Rooster
Re: Sweep on a group of songs
« Reply #3 on: April 09, 2019, 03:40:37 AM »
I made the link clickable, but it won't show you what you want to see. What I did:

1) Made a playlist with two items in it... the ID part, followed by the Year Shout part.  Saved the playlist to the database, so the SQL code can change it. (I can rotate through multiple intros, before the shout)
2) Created a MANUAL event that runs the SQl Code (below) and loads the playlist (created above) to the TOP of the queue.
3) Created a 0.1 second silent audio file, imported it into the database and edited it. On the "Other" tab in the edit window, I changed the "End Event" to the one I created in step 2. (I have a few of these files, they are in their own sub category I call "Event Triggers".
4) Schedule these "Event Triggers" where ever you want them to run in your rotations/playlists.

Here's the code.  Keep in mind you will need to adjust some of the variables to match things in your database.
Code: [Select]
SET @extrocat = 134; -- Sweeper Category ID for extro (Year)
SET @introcat = 112; -- Sweeper Category ID for intro (ID)
SET @plid = 12; -- Segue Playlist ID
SET @nextsong = (SELECT songID FROM queuelist WHERE ID=1); -- Find ID of Next Song to Play
SET @nextyear = (SELECT songs.year FROM SONGS WHERE ID = @nextsong); -- Next Songs Year
SET @introid = (SELECT ID FROM songs
WHERE id_subcat=@introcat
AND ((songs.start_date <= Now()) AND (songs.end_date >= NOW() OR songs.end_date = '2002-01-01 00:00:01'))
AND enabled=1
ORDER BY songs.date_played ASC LIMIT 1);
SET @extroid = (SELECT ID FROM songs
WHERE id_subcat=@extrocat
AND songs.year = @nextyear
AND ((start_date <= Now()) AND (end_date >= NOW() OR end_date = '2002-01-01 00:00:01'))
AND enabled=1
ORDER BY songs.date_played ASC LIMIT 1);

SET @cuestr = (SELECT cue_times FROM songs WHERE ID = @introid);
SET @cstart = (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@cuestr, '&sta=', -1), '&', 1));
SET @cend = (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@cuestr, '&end=', -1), '&', 1));
SET @cfade = (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@cuestr, '&fou=', -1), '&', 1));
SET @cnext = (@cend - @cfade);
UPDATE `playlists_list`
SET `sID` = @introid, `cstart` = @cstart, `cnext` = @cnext, `cend` = @cend WHERE `pID` = @plid AND ord = 0;

SET @cuestr = (SELECT cue_times FROM songs WHERE ID = @extroid);
SET @cstart = (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@cuestr, '&sta=', -1), '&', 1));
SET @cend = (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@cuestr, '&end=', -1), '&', 1));
SET @cfade = (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@cuestr, '&fou=', -1), '&', 1));
SET @cnext = (@cend - @cfade);
UPDATE `playlists_list`
SET `sID` = @extroid, `cstart` = @cstart, `cnext` = @cnext, `cend` = @cend WHERE `pID` = @plid AND ord = 1;

-- SELECT @introid , @extroid , @nextyear;
This is based on a more complex Query I created which picks a song extro VO, a segue VO, and an intro VO based on songs just played and about to play.  The best thing about the query, is that I can change/add/delete VO files without having to change sweepers linked to songs (the RDJ built-in method) and if I don't have a VO file based on the song's title or artist, it picks a generic file.  It finds all available VO files that work for the previous & next song, and plays the least recently played VO file, so it sounds completely random.  I can also use the start & end dates in RDJ to stop airing time sensitive VO.  And to get it to work, I just need to insert one of my "Event Trigger" files between two songs.