Skip to Content
It is currently December 2nd, 2022, 10:35 pm

All times are UTC - 6 hours [ DST ]




 [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: February 13th, 2016, 3:44 pm 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
Ok, I have SAM setup with these categories: Singing, Preaching, and Station ID. I have the queue set to queue 5 tracks from singing, then one from station ID, and repeat. I have the playlist rotation rules set for those categories. Then, I am using a PAL script so that it will load a track from Preaching every 17 tracks. Basically an hour of singing, then an hour of preaching, and so on.

Now, I have a question. Is there any way to use different playlist rotation rules for the PAL?

Reason I ask is that I have a limited number of singing tracks, so I have to set my rules kinda lax. But, I have enough preaching tracks, and since they only play one track every hour or so, I would like to use a little stricter rules for them.

For instance, I have the singing rules set to not play the same title within 300 minutes. But, I could easily set that to well over 2 or 3 days for preaching tracks.

Is there any way to do this in SAM Broadcaster?


Top
 Profile  
 
PostPosted: February 13th, 2016, 8:07 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
The QueueTop/QueueBottom Method has 2 parameters. #1 is the selection method and #2 is the repeat rule.
If you set the second parameter to NoRules instead of EnforceRules, you can queue a track regardless of your normal rotation rules.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
 
PostPosted: February 13th, 2016, 8:17 pm 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
Sure, I can do that. But, then there are no rules and I have had times where it played the same track twice in the same day. Not the end of the world, but would like to avoid that.

So, there's no way to set different rules for the PAL?


Top
 Profile  
 
PostPosted: February 14th, 2016, 4:00 pm 
Offline
Junior User
Junior User

Joined: August 23rd, 2008, 10:12 am
Posts: 67
The PAL scripting you need needs to be based around these two lines

Code:
PlaylistRules.MinArtistTime := 0;  // # of minutes before Artist repeat
PlaylistRules.MinSongTime := 0;    // # of minutes before Song repeat


With those you should be able to write a simple PAL script that Has a switch at position one It will play a sermon. At position two ( or potentially three four five etc) it will change the rules and play a song

_________________
Steve

Without questions there is no knowledge.


Top
 Profile  
 
PostPosted: February 16th, 2016, 9:23 am 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
Thank you. I'll give that a shot.


Top
 Profile  
 
PostPosted: February 16th, 2016, 11:06 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
Just be aware of the small chance that other tracks queued by your clockwheel or other scripts or requests will follow the same rules during the 2-3 second interval of changed rules.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
 
PostPosted: February 16th, 2016, 7:51 pm 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
Ok, I took the Basic Clockwheel rotation example that came with SAM and modified it to my needs, with those parameters added. Would you mind taking a look at this and giving some input?

edit: I couldn't upload it so here is a copy/paste of it:



Code:
// Basic Clockwheel rotation example via PAL scripting

//Notes:
// Add items to the queue based on different rules
// Notice how we disabled separation rules for stationIDs
// StreamAds ads will also only work if you joined the StreamAds program
// See http://www.streamads.com


PlaylistRules.MinArtistTime := 420;  // # of minutes before Artist repeat
PlaylistRules.MinSongTime := 500;    // # of minutes before Song repeat
Cat['Preaching'].QueueBottom(smRandom, EnforceRules);
PlaylistRules.MinSongTime := 240;    // # of minutes before Song repeat
Cat['Station ID'].QueueBottom(smRandom, NoRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, NoRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);


//Lets wait for queue to get near empty
while Queue.Count > 1 do
begin
  PAL.WaitForPlayCount(1);
end;

//Restart script
PAL.Loop := True;


Last edited by Mastacheata on February 17th, 2016, 5:00 am, edited 1 time in total.
Added CODE tags for better readability, please use them yourself next time


Top
 Profile  
 
PostPosted: February 17th, 2016, 5:49 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
Errors: You forgot to reset the MinArtistTime.
Possible Improvements: You could store the "old" values in variables and reset them later. That way you're more flexible should you ever change your repeat rules.
Checking queue.count could be replaced by PAL.WaitForQueue if that works for you.

But actually: NEVER EVER try to manually build a clockwheel in PAL.
Move your singing stuff into the clockwheel. (Preferrably remove any repetitions, a clockwheel repeats on its own) and rewrite your PAL script so it will only introduce the preaching into the queue in regular intervals.)

Here's how I would do it:
This is the PAL that plays your preaching once every 22 tracks.
Code:
VAR artist, song : Integer;
PAL.Loop := True;
artist := PlaylistRules.MinArtistTime;
song := PlaylistRules.MinSongTime;
PlaylistRules.MinArtistTime := 420;  // # of minutes before Artist repeat
PlaylistRules.MinSongTime := 500;    // # of minutes before Song repeat
Cat['Preaching'].QueueTop(smRandom, EnforceRules);
PlaylistRules.MinArtistTime := artist;
PlaylistRules.MinSongTime := song;    // # of minutes before Song repeat
// Repeat every 22 tracks
PAL.WaitForPlayCount(22);


What's confusing me is why you have one line where your singing category is picked from with NoRules.
Without that line you've got a regular repetition in your structure. With that line it breaks everything.
Here's a clockwheel taking care of that irregularity:
Code:
Cat['Station ID'].QueueBottom(smRandom, NoRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, NoRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);


And this would be a much simpler version of the same Clockwheel: (minus the ID, that needs to be placed via PAL in this version)
Code:
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smRandom, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);


Modify the Preaching PAL like this to include the ID:
Code:
VAR artist, song : Integer;
PAL.Loop := True;
Cat['Station ID'].QueueTop(smRandom, NoRules); // put to the very top

PAL.LockExecution;
artist := PlaylistRules.MinArtistTime;
song := PlaylistRules.MinSongTime;
PlaylistRules.MinArtistTime := 420;  // # of minutes before Artist repeat
PlaylistRules.MinSongTime := 500;    // # of minutes before Song repeat
Cat['Preaching'].QueueTop(smRandom, EnforceRules); // put even more to the top (on top of the station ID)
PlaylistRules.MinArtistTime := artist;
PlaylistRules.MinSongTime := song;    // # of minutes before Song repeat
PAL.UnlockExecution;

// Repeat every 23 tracks
PAL.WaitForPlayCount(23);

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
 
PostPosted: February 17th, 2016, 11:46 am 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
"But actually: NEVER EVER try to manually build a clockwheel in PAL.
Move your singing stuff into the clockwheel. (Preferrably remove any repetitions, a clockwheel repeats on its own) and rewrite your PAL script so it will only introduce the preaching into the queue in regular intervals.)"


I see what you're saying. I guess I still don't understand PAL as good as I thought I did.


"What's confusing me is why you have one line where your singing category is picked from with NoRules."

That was an oversight. I had it in my Clockwheel set up to play a Station ID every few songs. So, I just did a cut and paste from there to the PAL, then decided to play one less often. The line with the singing category and no rules was a Station ID, but I changed it to Singing and forgot to change to enforce rules.


Top
 Profile  
 
PostPosted: February 17th, 2016, 12:10 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
Another problematic thing: With your PAL idea, you put all the tracks into the queue at once. That is problematic because the rules only check against the stuff that has played in the past.
For example selecting a track via Least Recently Played twice in a row is no problem in a Clockwheel. (Each line in the clockwheel is only executed when the queue needs another track to fullfill your required "keep tracks in queue" count)
In a PAL script that is problematic, because it executes one line per second (or even more in a LockExecution section), regardless of whether the previous line's selection has already been played or not.

That means:
Code:
Cat['Singing'].QueueBottom(smLRP, EnforceRules);
Cat['Singing'].QueueBottom(smLRP, EnforceRules);

Will result in two different tracks using when written in a clockwheel, but will result in playing the same track twice in a PAL script. (Assuming "keep tracks in queue" is set to 0 or 1)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
 
PostPosted: February 17th, 2016, 12:14 pm 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
Yes, I noticed when I ran my PAL that it was trying to load all the tracks at the same time and was giving me multiple errors. That would explain why.

Thank you for you help with the Preaching PAL that inserts the Station ID for me. That was exactly what I was trying to do.


Top
 Profile  
 
PostPosted: February 17th, 2016, 3:13 pm 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
Ok, I've used the below code. Now, though, I'm getting pretty well one preaching track after another. And a lot of failed to load, both preaching and singing. I also setup the clockwheel rotation in SAM to use for singing, rather than use the PAL, as you recommended.

Is there something I missed?

Code:
VAR artist, song : Integer;
PAL.Loop := True;
Cat['Station ID'].QueueTop(smRandom, NoRules); // put to the very top

PAL.LockExecution;
artist := PlaylistRules.MinArtistTime;
song := PlaylistRules.MinSongTime;
PlaylistRules.MinArtistTime :=600 ;  // # of minutes before Artist repeat
PlaylistRules.MinSongTime := 4500;    // # of minutes before Song repeat
Cat['Preaching'].QueueTop(smRandom, EnforceRules); // put even more to the top (on top of the station ID)
PlaylistRules.MinArtistTime := artist;
PlaylistRules.MinSongTime := song;    // # of minutes before Song repeat
PAL.UnlockExecution;

// Repeat every 23 tracks
PAL.WaitForPlayCount(15);


Top
 Profile  
 
PostPosted: February 17th, 2016, 4:12 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
At the point of starting the PAL it should insert the Station ID in the first queue position, then the Preaching track on top (i.e. before the Station ID plays the Preaching Track)
Once it's done with that it will wait until 15 tracks have played (that is including the station ID and preaching itself)
There is no way to skip the 15 track waiting.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
 
PostPosted: February 17th, 2016, 5:47 pm 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
I don't know what to tell you, but it seems to have. When I first started that PAL this morning it played 2 preaching tracks in a row, failed to play 2 more, then played another.

But, after that it seems to be working correctly.

So, all seems fine now. The PAL shows waiting for 3 more tracks to play. So, lets see what happens in 3 more tracks.


Top
 Profile  
 
PostPosted: February 17th, 2016, 5:59 pm 
Offline
Junior User
Junior User

Joined: September 2nd, 2015, 12:02 am
Posts: 25
All seems fine now. Sorry for the false alarm.


Top
 Profile  
 
Display posts from previous:  Sort by  
 [ 16 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group