With your help and some examples I've wired up a custom crossfade and a
server skip command. Everything works mostly as expected. It sounds pretty
nice too!

The only thing I can't seem to figure out is why the custom transitions are
bypassed when the server skip command is executed. I've been at it for a few
hours so I'm probably overlooking the obvious. I think it has to do with
precedence and mksafe because a whole different source shows up in the logs.
Src_random_id_number and it's using "forgetful transition" rather than
custom_crossfade. Custom_crossfade does get executed, but only when tracks
are left to playout naturally.

Where is the right place to use custom_croassfade so it's always executed on
every track change?



# Custom crossfade
def custom_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["crossfade"] == "yes" and mb["crossfade"] == "yes" then
     # For the example here, let's put a crossfade:
     add(fade.initial(type="sin", sb),fade.final(type="sin", sa))
   else
     log("No transition defined: using default.")
     default(sa, sb)
   end
 end

 smart_cross(width=width, duration=start_next,
conservative=conservative,transition,s)
end

live_broadcast = input.http(id="live_broadcast_url", "
http://localhost:8000/live";)
live_broadcast = nrj(live_broadcast)
local_playlist = mksafe(playlist(id = "local_playlist", mode = "normal",
"content.m3u"))
local_broadcast = custom_crossfade(local_playlist)

def skip(_)
  skipped := true
  source.skip(local_broadcast)
  "OK"
end
server.register("local_broadcast.skip",skip)
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to