I’m trying to write a script that runs sweepers over song intros. Here’s what i have:
var
i: integer;
hasintro: integer;
sweep: integer;
begin
hasintro:=-1;
sweep:=-1;
for i := 0 to CurrentPlaylist.GetCount - 1 do
begin
if CurrentPlaylist.GetItem(i).GetArtist = 'zintro' then
begin
hasintro:=i;
sweep:=i + 1;
CurrentPlaylist.InsertFile(sweep , 'D:\jingl\sweep1.wav' , eaNone);
CurrentPlaylist.GetItem(hasintro).GetCuePosition(ptStartNext).SetValue(CurrentPlaylist.GetItem(hasintro).GetCuePosition(ptRamp1).GetValue - CurrentPlaylist.GetItem(sweep).GetCuePosition(ptFadeOut).GetValue);
end;
end;
end.
It simply scans the whole playlist and if it finds a song with “zintro” parameter it inserts the sweeper and sets “startNext” parameter of this song. The StartNext is calculated from length of the Ramp minus the sweeper’s length. But there’s a little problem and I have a question.
When we have something like this:
SONG1
SONG2
SWEEPER
SONG3
SONG4
… and mAirList is in the automation mode. When it starts playing SONG2, the SWEEPER fires and plays simultaneously with the song. When the SWEEPER finishes playing, SONG3 starts playing and plays along with SONG2 as well.
Is there something that prevents the next file after the sweeper from being played?
You’ve encountered the same ‘problem’ I encountered when writing IVP (search the forum: you’ll find it!).
From the automation engine’s point of view, it is operating correctly. It is designed such that when one item ends (or hits its StartNext point), the next item in the list is loaded and started. If you want to start a sweeper AFTER the song has started, then (from YOUR point of view) the automation doesn’t work and starts the next item at the ‘wrong’ time.
The only solution I can think of is to have an Automation script for OnPlayerStart (or whatever it’s called these days: I forget!) which checks the title of the just-started item. If the title contains the text SWEEPER (or whatever you choose), it should change to ASSIST mode (which will stop the next song automatically starting); then SLEEP for something like 30 seconds, to allow the sweeper to finish; then change back to AUTO mode, which will ensure that when the SONG ends, the next song will start.
All this is entirely off the top of my head: I have not tried any of this in mAirList and nor have I written any of the necessary script code. But I hope it will give you some ideas to work with! ;D
Thanks Cad for your reply. I thought that writing such a script would be easier. The mAirList’s engine put a spoke in my wheel. OK I’ll try to search another solution.
This way is quite unsatisfying because what will show the progress bar (assuming you have one displayed) ?
With this script, you change the startnext point to play the sweeper over the intro. So, if you ticked “Regard StartNext point as end of file”, you will see the progress bar displaying time until startnext point and after the sweeper, what will be showed ?
It’s quite difficult to begin playback on a “next” item, after the previous one started…
I could imagine many way for you needs :
if script detects “sweeper”, it loads the item in a cartwall player, remove the item from playlist (or tick it for not playing it), wait for a calculated time and play the cartwall player over the intro…
if script detects “sweeper”, it loads it to another hide playlist (for not interrupt with current playback)…
I will think about it. I like sweeper idea on short intro… ;D
Theo: If you mean a Global progress bar, I don’t ever use them because I don’t see any reason to use them. I only use progress bars within Players or Cartwall Players.
Another way round the ‘sweeper’ problem, if you don’t mind starting the track and Sweeper ‘together’ (instead of Sweeper finishing at Ramp of the song), is to put the Sweeper BEFORE the song, then add a StartNext cue point of 0,01s to the Sweeper. This will start the track IMMEDIATELY the Sweeper starts, AND there is no way the next song will start when the Sweeper ends.
Not exactly what was asked for, but that method does prevent any problems.
I spent all the yesterday evening time to work on script for “sweeper” item (in fact, a jingle over the ramp song, started AFTER the song and finished at the very end of the ramp song).
Result is great. All is fine. I will post tonight the 2 way I found to obtain this kind of result with pros and cons. However, it’s not very intuitive, not very handy. But, it works and it sounds great ! And when it’s configure, you don’t have to modify it ;D
I won’t give you the scripts because it’s quite specific to the way I manage audio item… Here is the thing I configure :
Liner audio item have a property “Type” with “Radio-item” value defined
Liner audio item have a EndType value defined to “L”
Song have a property “Type” with “song” value defined
2 playlists are defined : 1 with 3 players. 1 with only 1 player (viewable or not, no matter). Playlist 2 is always in Auto Mode.
All the parametrization is done in the OnPlayerStart notification script.
I look the previous Item, looking for a EndType marked to “Li” (note, this is “Li”, not “L”).
If there is no such item, I look the 2 next items. If this is a Liner followed by a song, and liner duration is smaller that ramp song, I load a mini-playlist in playlist 2 containing only the liner audio item, and I marked the endtype of the Liner with “Li”, in playlist 1.
If there is such an item (previous item is a liner that can be played over the ramp song, starting after the song), I will calculate the real start time of the liner and modifiy the start time of the item in the playlist 2 (Fixed Time).
Playlist 1 will start the song… And, when the start time of the Liner audio Item (in the playlist 2) will be reached, the liner will be played.
Avantages : It’s quite simple.
Disavantages : for me, it’s annoying because my global progress bar overrides the current playlist 1 player by the liner player…
To meet my need (which is to hide the play of the liner audio item to my global progress bar), I use a script that calls “PlayItemDetached”.
Avantages : Global progress bar follows the current playlist 1 player during the liner playback.
Disavantages : If you show the playlist 2, you won’t see the audio item but a “command” to run the script.
It’s a nutschell, but the aim of this speech is to show you that we can listen this kind of audio concept with mAirlist. It’s not very easy, but for listeners, the result is here.
Sorry, this message is quite long and my english should be quite bad… Longer the text is, more numerous the error I make.