Skip to Content
It is currently September 18th, 2019, 11:26 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: changing decks
PostPosted: November 12th, 2008, 2:10 pm 
Offline
Junior User
Junior User

Joined: November 10th, 2008, 11:11 am
Posts: 45
Hello, does anyone know how to make these files to play on aux 1 & 2 instead of deck 1 & 2?

PAL.Loop := True;
PAL.WaitForTime(T['XX:21:00']);
queue.AddFile('I:\MP3s\Radio Stuff\Categories\Content\Other\weather\local.mp3',ipTop);
Cat['20'].QueueTop(smLemmingLogic, NoRules);


Top
 Profile  
Reply with quote  
 Post subject: Re: changing decks
PostPosted: November 12th, 2008, 2:13 pm 
Offline
Junior User
Junior User

Joined: November 10th, 2008, 11:11 am
Posts: 45
sorry I forgot to ask this also... How would I make the script play over the ramp of an oncoming song?


Top
 Profile  
Reply with quote  
 Post subject: Re: changing decks
PostPosted: November 12th, 2008, 8:34 pm 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10439
Location: Denver, CO
Take a look at the LinerOverlay PAL in your SAM directory, that is exactly what it does.

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: changing decks
PostPosted: November 13th, 2008, 3:18 am 
Offline
Junior User
Junior User

Joined: November 10th, 2008, 11:11 am
Posts: 45
the overlay is setup to run a certain amount of times (every 15 minutes) where as I am runing my show like I used to do in commercial radio (standard breaks at :10, :20, :30 :40 :50)


Top
 Profile  
Reply with quote  
 Post subject: Re: changing decks
PostPosted: November 13th, 2008, 8:48 am 
Offline
Alumni
Alumni

Joined: October 14th, 2006, 9:38 am
Posts: 5986
Location: Deep in the heart of the PRNJ
Think of this as your golden opportunity to learn PAL. :)

Modify the time constants to fire the liners when you need them or tweak the script so it can be run with the Event Scheduler.

_________________
- Stan Olochwoszcz
A proud licensed SAM user since 2002

Raritan Bay Radio


Top
 Profile  
Reply with quote  
 Post subject: Re: changing decks
PostPosted: November 13th, 2008, 1:46 pm 
Offline
Junior User
Junior User

Joined: November 10th, 2008, 11:11 am
Posts: 45
OK, I found a script and have made a few modifications to it (I commented the original code I replaced). It loads the aux 1 deck at the time I told it to but it doesn't play the file. Any thoughts?

Code:
{ About:
   This script will play a liner in Aux1 as soon as a new track starts
   The liner will only be played if
    a) The song has an intro of specified minimem duration
    b) The song is of type S, i.e. a normal song.

   Then the script will wait the specified amount of time before
   it tries to play another liner.

   This script can help brand your station and make it sound like a true
   commercial terrestrial station.
    any source connected

   Usage:
    a) Make sure you use the song information editor to specify intro times for your tracks!
    b) Make sure the AGC settings on Aux1 is to your liking. Also set the volume a bit louder
       on Aux1 so you cna clearly hear the liner above the active Deck audio.
    c) Edit the configuration details below.
       Make sure to change the category to the one you use to store your liners.
}
{ CONFIGURATION }
{==================================================}
const MIN_INTRO = 7*1000; //7 seconds
//const MIN_WAIT  = '+00:15:00'; //Wait 15 minutes between liners
const LINERS_CATEGORY = 'Liners';


{ IMPLEMENTATION }
{--------------------------------------------------}
function ExtractIntro(Song : TSongInfo):Integer; forward;

var Song, Liner : TSongInfo;
var Waiting : Boolean = True;
var Intro : Integer = 0;
Aux1.Eject;

{Step1: Queue up the deck, ready for play}
Liner := CAT[LINERS_CATEGORY].ChooseSong(smLRP,NoRules);
if (Liner=nil) then
 WriteLn('No valid liner found')
else if (not Aux1.QueueSong(Liner)) then
 WriteLn('Failed to queue song: '+Liner['filename']);

{Wait for a valid song with intro}
while Waiting do
 begin
  {Step2: Wait for the song to change}
  //PAL.WaitForPlayCount(1);
   PAL.Loop := True;
   PAL.WaitForTime(T['XX:28:00']);

  {Step3: Grab current song information}
  Song := ActivePlayer.GetSongInfo;

  if (Song=nil) then
   WriteLn('The active player contained no song info??')
  else
   begin
    {Extract the intro time - this is a bit tricky}
    Intro := ExtractIntro(Song);

    {Start playing the liner if the current song matches our rules}
    if(Song['songtype']='S') and (Intro>=MIN_INTRO) then
     begin
      Aux1.Play;
      Waiting := False;
     end;
    Song.Free; Song := nil;
   end;
end;

{Wait 5 minutes before we do this all again}
//PAL.WaitForTime(MIN_WAIT);
//PAL.WaitForTime(T['XX:36:00']);
//PAL.Loop := True;

{................................................}
function ExtractIntro(Song : TSongInfo):Integer;
var
 P : Integer;
 XFade : String;
begin
 Result := -1;
 XFade := Trim(Song['xfade']);

 WriteLn('Decoding XFade string');
 WriteLn('XFade: '+XFade);

 if XFade = '' then
  Result := -1
 else
  begin
   P := Pos('&i=',XFade);
   if (P > 0) then
    begin
     Delete(XFade,1,P+2);
     P := Pos('&',XFade);
     if (P>0) then
      Delete(XFade,P,Length(XFade));

     Result := StrToIntDef(XFade,-1);
     WriteLn('Intro time detected: '+XFade);
    end;
  end;
end;

{--------------------------------------------------}


Last edited by Elevatorboy on November 13th, 2008, 3:32 pm, edited 1 time in total.
Added code tags to improve script readability


Top
 Profile  
Reply with quote  
 Post subject: Re: changing decks
PostPosted: November 13th, 2008, 3:34 pm 
Offline
Alumni
Alumni

Joined: October 14th, 2006, 9:38 am
Posts: 5986
Location: Deep in the heart of the PRNJ
Are your song files all tagged with intro lengths?

_________________
- Stan Olochwoszcz
A proud licensed SAM user since 2002

Raritan Bay Radio


Top
 Profile  
Reply with quote  
 Post subject: Re: changing decks
PostPosted: November 13th, 2008, 5:51 pm 
Offline
Junior User
Junior User

Joined: November 10th, 2008, 11:11 am
Posts: 45
yes


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 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:  
cron
Powered by phpBB® Forum Software © phpBB Group