2011/6/22 Brandon Casci <[email protected]>:
> Right now everything is stuffed into request.dynamic. The play script
> whatever is in queue, and that queue is filled up by a scheduled task. If
> there is nothing in queue then it selects tracks tracks from a general
> rotation bucket using a variety of methods. I'm not opposed to having two
> playlists or queues inside liquidsoap though.
Hmm.. My question was more to understand the setting. Overall, I think
stuffing everything in a request.dynamic is fine!
Concerning the custom smart_crossfade for the transition, here is an example.
Imagine that the request.dynamic returns requests of the form:
annotate:transition=a:/path/to/file.mp3
(It could have more informations, I am just minimizing)
Then the resolved request will have the metadata: transition,a. Now,
you can define a custom smart_crossfade:
# Custom crossfade
def my_smart_crossfade (~start_next=5.,~fade_in=3.,~fade_out=3.,
~default=(fun (a,b) -> sequence([a, b])),
~high=-15., ~medium=-32., ~margin=4.,
~width=2.,~conservative=false,s)
fade.out = fade.out(type="sin",duration=fade_out)
fade.in = fade.in(type="sin",duration=fade_in)
add = fun (a,b) -> add(normalize=false,[b, a])
log = log(label="smart_crossfade")
def transition(a,b,ma,mb,sa,sb)
list.iter(fun(x)-> log(level=4,"Before: #{x}"),ma)
list.iter(fun(x)-> log(level=4,"After : #{x}"),mb)
if ma["transition"] == "a" or mb["transition"] == "a" then
# For the example here, let's put a crossfade:
add([fade.initial(b),,fade.final(a)]
else
log("No transition defined: using default.")
default(sa, sb)
end
end
smart_cross(width=width, duration=start_next, conservative=conservative,
transition,s)
end
And finally apply it:
source = my_smart_crossfade(source)
As you can see, inside the function that you pass to smart_cross, you
can pretty much code whatever your mind can think of, a list of
predefined transitions, a transition for the ending a begining source,
or even an advanced parameter string that you could code how to parse
to dynamically choose the transition :)
Romain
> On Wed, Jun 22, 2011 at 5:54 PM, Romain Beauxis <[email protected]>
> wrote:
>>
>> Hi Brandon!
>>
>> Le 22 juin 2011 19:29, Brandon Casci <[email protected]> a écrit :
>> > Just looking for an opinion here. I'm reworking how scheduled content
>> > works.
>> > As you know the simple way to do it is to have liquidsoap schedule
>> > switching
>> > between playlists. If you have a more detailed setup, then maybe you
>> > want to
>> > get all your content via request.dynamic and have your script handle
>> > fetching scheduled content or some other type of content if there is
>> > nothing
>> > scheduled. I went with request.dynamic, choosing to place all the
>> > rotation
>> > logic in a script. Now I'm tossing around ideas how to make schedules
>> > tighter, so when a scheduled show starts it will fade out what's
>> > currently
>> > playing and fade into the the scheduled content. What liquidsoap feature
>> > is
>> > best suited for this? I don't know if this is too complicated, but I
>> > though
>> > about having our content scheduler connect to liquidsoap via telnet and
>> > do a
>> > playlist.next when a schedule is up. What do you think?
>>
>> There might be several ways to do this.
>> One question first: do you use a request.dynamic along with a playlist
>> or is everything stuffed into a request.dynamic?
>>
>> Now, concerning the various ways of tweaking a transition, I think my
>> favorite one is to use a custom smart_crossfade. For instance, in
>> radiopi we have added a special transition case for jingles, to avoid
>> fading in and out on those short files..
>>
>> More generally, you can tag your tracks using annotate and use this
>> information in a custom smart_crossfade to pick any transition you
>> like.
>>
>> Of course, the general warning apply here: do not use
>> (smart_)crossfading on live sources such as input.http/input.harbor as
>> these transitions will exhaust the live buffer..!
>>
>> In case of transitions from/to live sources, you may use the
>> switch/fallback transitions option. As for now, these functions do not
>> have any metadata passed to them. However, you could for instance
>> register the latest metadata passed on a given stream and use that
>> information inside the transition function. I think I have described
>> how to record the latest metadata in a previous email but I'll be
>> happy to do it again :)
>>
>> Romain
>
>
>
> --
> =========================================
> Brandon Casci
> Loudcaster
> http://loudcaster.com
> =========================================
>
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users