theoriginalrage Posted August 4, 2009 Share Posted August 4, 2009 And it changes the format to whatever I want it to with a little tweaking. Right now my station only has a regular mix from 1am - 9pm and the ElectroMix from 9pm - 1am. But I have been considering changing it up. I run two scripts. The first is a script auto reloads at the TOH so that each hour sounds uniform in it's presentation while checking the time. It checks the time because at 9pm I need it to stop reloading the TOH (since in my TOH script it's just set up for the regular mix). So at 9pm it waits till 1am. Here is that script: PAL.Loop := True; {Wait for right time} if (now >= T['20:56:00']) and (now begin PAL.WaitForTime(T['01:00:00']); end; {Wait for right time} if (now >= T['00:59:45']) and (now begin PAL.WaitForTime(T['xx:59:50']); {Clear Queue} Queue.Clear; Cat['TOH'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smWeighted, EnforceRules); Cat['Daytime Mix'].QueueBottom(smLRP, EnforceRules); Cat['Computer Gen'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smWeighted, EnforceRules); Cat['Daytime Mix'].QueueBottom(smMRP, EnforceRules); Cat['Electromix Promo'].QueueBottom(smRandom, NoRules); Cat['Advertisements (All)'].QueueBottom(smRandom, EnforceRules); Cat['Advertisements (All)'].QueueBottom(smRandom, EnforceRules); Cat['Advertisements (All)'].QueueBottom(smRandom, EnforceRules); Cat['Daytime Mix'].QueueBottom(smWeighted, EnforceRules); Cat['Rage'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smLRP, EnforceRules); Cat['Computer Gen'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smLRP, EnforceRules); Cat['Upload'].QueueBottom(smRandom, NoRules); Cat['Advertisements (All)'].QueueBottom(smRandom, EnforceRules); Cat['Advertisements (All)'].QueueBottom(smRandom, EnforceRules); Cat['Daytime Mix'].QueueBottom(smRandom, EnforceRules); Cat['Daytime Mix'].QueueBottom(smWeighted, EnforceRules); Cat['Computer Gen'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smLRPA, EnforceRules); Cat['Daytime Mix'].QueueBottom(smRandom, EnforceRules); Cat['Daytime Mix'].QueueBottom(smWeighted, EnforceRules); Cat['Rage'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smLRP, EnforceRules); Cat['Computer Gen'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smLRP, EnforceRules); Cat['Daytime Mix'].QueueBottom(smWeighted, EnforceRules); Cat['Rage'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smLRP, EnforceRules); Cat['Upload'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smLRP, EnforceRules); Cat['Rage'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smLRP, EnforceRules); Cat['Daytime Mix'].QueueBottom(smWeighted, EnforceRules); Cat['Electromix Promo'].QueueBottom(smRandom, NoRules); Cat['Daytime Mix'].QueueBottom(smMRP, EnforceRules); ActivePlayer.FadeToNext; end; Then there is the ElectroMix script.... If I could somehow manage to not hurt my brain and combine this script with my reloading the top of the hour script that would be awesome, but that will have to be a project down the road. The ElectroMix script is based on someone else's script actually. Read all about Steve and the script here http://support.spacialaudio.com/wiki/Daily_Shows_Scheduling._Based_on_Steve's_original. There is a link at the bottom of the page that takes you to the actual script and explanation. I put my own variations on this script to make it work for me which is what I'm sure Steve would want. For instance, the original script is setup for multiple formats but I only needed it for 1, right now, so I chopped quite a bit out. Also the original only loaded 56 min worth of music but I needed 4 hours worth of music and station Id's, so I figured out the math for the time (kinda) and added in some category stuff. Here is the ElectroMix script: PAL.Loop := True; var D: Integer; // return from SQL calls var F : Boolean; // switch to controll additional activities in events. var E : DateTime = Queue.ETA; // Return the length of the queues // Create as many of these as you have categories you are going to use. var CatA : string; // I know it could be simplified, but I'm making a point. CatA := 'Stans Electro Mix'; F := false; // Event // Is it 9pm? If so what day? if (now >= T['20:58:00']) and (now ((DayOfWeek(Now) = Monday) or (DayOfWeek(Now) = Tuesday) or (DayOfWeek(Now) = Wednesday) or (DayOfWeek(Now) = Thursday) or (DayOfWeek(Now) = Friday) or (DayOfWeek(Now) = Saturday) or (DayOfWeek(Now) = Sunday)) then begin Queue.Clear; repeat cat[CatA].QueueBottom(smRandom,EnforceRules); Cat['Computer Gen'].QueueBottom(smRandom, NoRules); until (Queue.Duration >= 14000000); // 233 minutes or roughly 4 hours of ElectroMix F := true; end; if (F) then // If F is true. set in queue load above. begin WriteLn('Wait for 1 track'); PAL.WaitForPlayCount(1); // wait for one track to play end; if (F) then begin D:=ExecSQL('UPDATE showstatus SET event = "The ElectroMix" WHERE ID = 1',[]); WriteLn('The ElectroMix'); // this displays in the pal window. end; if (F) then begin E := Queue.ETA; WriteLn('Time to wait'); WriteLn(E); PAL.WaitForTime(E); // ok, hang about for the length of the queue. end; if (F) then begin D:=ExecSQL('UPDATE showstatus SET event = "Daily Mix" WHERE ID = 1',[]); WriteLn('Daily Mix'); F := false; // It's now after 1am, so back to the normal daily Mix. // Remember, this is Thu, Fri and Sat only. end; // End of Event There you have it. A complete PAL scripting solution to automate my station. I do use the event scheduler to load the ElectroMix Intro in at 9pm. It's a work in progress and I'll post more as I get it working. Link to comment Share on other sites More sharing options...
JJDJRadio Posted August 13, 2009 Share Posted August 13, 2009 I need to do this for my station... but that script is spanish to me... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.