It was staring me right in the face on the cookbook page. I can achieve my
goal by removing the fallback and adding ({ true }, sf) into the switch
(along with a third transition) where that becomes the schedule fallback.
The changes are as follows:

schedule = switch(
track_sensitive=false,
transitions=[crossfade, crossfade, crossfade],
[ ({1s-5s}, s1), ({5s-10s}, s2), ({ true }, sf) ]
)

list=schedule

---

Now I don't understand the purpose of the fallback, I guess it's mostly for
switching between local and live? so either a transition is not
required/supported by design or it's a bug.

If it's on purpose then my fault, I was looking at this post:
http://forum.sourcefabric.org/discussion/14624/snippet-complete-liquidsoap-schedule/p1

PS I tried the original script on LS 1.1.1 in case it was fixed since 1.0.0
but no dice. The above solution was the only one that worked.

Also, if I have 1h slots for 8h day / 5d week, that's 40 switch time
elements. It seems ridiculous to have have to define 40 transition
statements, can't we make it so that if you specify one transition it uses
it for all switch elements, or also add a flag that makes it work that way?

Dan



On Thu, Mar 13, 2014 at 11:14 PM, Dan <[email protected]> wrote:

> liquidsoap gurus,
>
> Objective
> -------------
> I'm trying to set up a simple script that will run 24/7 with pre-defined
> sets / playlists and a fallback set / playlist.
>
>
> Requirements
> --------------------
> - The pre-defined sets are to play for 1h, during the schedule specified.
>
> - If a previous set was playing, predefined or fallback, it's cut in
> favour of the new set.
>
> - If a set has less than 1h of music, the fallback set kicks in and
> chooses a song to fill the rest of the time
>
> - If the set has more than 1h of music, more specifically if it plays past
> the 1h mark, it gets replaced by the fallback set or next set if scheduled
> right after.
>
> - There needs to be a transition between sets, including the fallback
> because sets may be shorter or longer than 1h.
>
> - Transitions are not required between songs.
>
>
> Scenario / Test
> ----------------------
> sf plays until s1 comes on then s2 comes on then back to sf
>
>
> Issue
> -------
> I've noticed that transitions work properly from sf -> s1 -> s2 but once
> going from s2 back to sf, s2 is not faded out. sf is however faded in.
>
> The log shows the first two switches as "with transition" while the last
> switch is with a "forgetful transition"
>
>
> Info / Versions
> ---------------------
> - liquidsoap 1.0.0
> - ubuntu precise
>
>
> Script
> ---------
> Below is a full self contained script that illustrates my setup and
> observed issue:
>
> #!/usr/bin/liquidsoap -v
>
> set("log.file.path","fade_test.log")
> set("log.stdout",true)
>
> def crossfade(a,b)
>   add(normalize=false,
>       [ sequence([ blank(duration=0.25),
>                    fade.initial(duration=1.,b) ]),
>         fade.final(duration=1.,a) ])
> end
>
> d = 6.
> s1 = sine(440.,duration=d)
> s2 = sine(660.,duration=d)
> sf = sine(220.,duration=d)
>
> schedule = switch(
> track_sensitive=false,
>  transitions=[crossfade, crossfade],
> [ ({1s-5s}, s1), ({5s-10s}, s2) ]
> )
>
> list=fallback(
>  track_sensitive=false,
> transitions=[crossfade, crossfade],
> [schedule, sf]
> )
>
> out(list)
>
>
------------------------------------------------------------------------------
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to