Note that this Wiki is a work in progress, items may not be updated or may disappear entirely as the pages are updated.

PAL to play an hour of an artist

From SpacialAudio

Jump to: navigation, search

PAL script to play an hour (actually an hour with a 10 minute buffer) of music from a particular artist. The PAL below runs at 2pm Wednesday and 2pm Friday.

The Wednesday show is an hour of Rush called "Rush Hour". The Friday show is an hour of King Crimson called "Entry of the Crims".

Feel free to massage as necessary for your station.

The version servicing FesterHead Radio can be found at: http://www.festerhead.com/PAL/artist%20hour.pal

All the PAL scripts servicing FesterHead Radio can be found at: http://www.festerhead.com/samweb/pals.php

Note: The versions servicing my station may not be compatible with your station.

An enhancement in the future is to use native SAM2 song selection methods instead of the SQL query.

*** PAL START ***
// Don't be a dick.  Leave this here.
// Artist hour script by FesterHead (fester@festerhead.com)
// Version 1.0 05/21/2003
//
// Plays an hour of an artist
// Declare variables
var theSongChooser : TDataSet;
var duration : Integer;
var theArtist, theShow : String;
// Keep da bugger goin!
PAL.Loop := True;
// Wait for the designated time
if ((now >= T['14:00:00']) and (now <= T['14:00:30']) and (DayOfWeek(Now) = Wednesday)) or
  ((now >= T['14:00:00']) and (now <= T['14:00:30']) and (DayOfWeek(Now) = Friday)) then
 begin
   if (DayOfWeek(Now) = Wednesday) then
     begin
       theArtist := 'Rush';
       theShow := 'Rush Hour';
     end;
   if (DayOfWeek(Now) = Friday) then
     begin
       theArtist := 'King Crimson';
       theShow := 'Entry of the Crims';
     end;
   WriteLn('Starting ' + theArtist + ' hour PAL script...');
   WriteLn();
   theSongChooser := Query('select *' +
     ' from songlist' +
     ' where artist = ' + QuotedStr(theArtist) +
     ' and songtype = S' +
     ' order by rand() limit 100',[],True);
   duration := 0;
   theSongChooser.First;
   while not theSongChooser.EOF do
     begin
       if ( (duration + theSongChooser['duration']) < 4200000 ) then
         begin
           WriteLn(theSongChooser['title'] + ' *from* ' + theSongChooser['album']);
           Queue.AddFile(theSongChooser['filename'], ipTop);
           duration := duration + theSongChooser['duration'];
         end;
       theSongChooser.Next;
     end;
   theSongChooser.Free;
   // Let's wait for two songs to play...  just in case
   PAL.WaitForPlayCount(2);
end;*** PAL END ***
Personal tools