Fallover 101-how to make All scripts worked - Easy Steps to build your Scripts-Fixed silence
  • I call this 101 because,I took over 101 scripts from here and others and have them worked then select my best suited.
    These script will just replace the silence and now your airtime will autodj for you when nothing is schedule


    This script have now being merge
    See https://forum.sourcefabric.org/discussion/18336/autodj-script-using-php-2-1-5-6-solution-you-were-waiting-on-no-ls_script-modification-need


    Lesson start
     
    This tutorial is only designed for 2.4 as its the best stable version of Airtime at this time of writing.

    Decide how you want your autodj to work.I urge you at least looked at the quickstart guide of liquidsoap,but not necessary.

    Key things to note.

    • back up your original ls_script before any modification make two backup if you can mybackup and mynextbackup
              sudo cp /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq  /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq.mybackup
    • to get to  your script

     sudo pico /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq


    • then after every modification always see if your script are ok issue the following command.

    sudo /usr/lib/airtime/pypo/bin/airtime-liquidsoap  /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq


    Now to the  tutorial


    # default = amplify(id="silence_src", 0.00001, noise())
    # comment out the line as per above and start immediately after

    #Create some playlist

    jingles = playlist("/somepathto/jingles")
    music   = playlist("/somepathto/music")
    security= single("/somepathto/security.ogg)


    # make these the same liquidsoap clock variable( note you can use the path as the variable in the default fallback)
    # Your Main objective is that the liquidsoap clock variable must be the same
    # if different there can be unpleasant consequences such as looping
    # you must do this if you are going to have your playlist reloads etc.

    # I use letters here like j,m,and v. you are not bound by this call them words like jams,mangoes,violets or anything you like radio,turner etc
     
     j=jingles
     m=music


    # Chose how you want a fallback to occur
    # A common mistakes is to think that weights will be how the fall back occur
    # Weights = [1,4] just tell what will happen at the time of fallback
    # Therefore


     v = random(weights = [1,4],[j,m])


    # means that when there is a problem or switch the weights will occur once 1 jingle for 4 music then it will move to the fallback
    # use time schedules switch or time promotions if you want anything to occur at specific time periods
    # weights are an optional
    # If you stop here then you will be back to dead air when "m" playlist which is the final song is finished.This is because the default is dead air,
    # the line # default = amplify(id="silence_src", 0.00001, noise()) that is comment out is just dead air amplified
    # the fallback for airtime is the "default"
    # You have to define this at least once unless your system will run in some unpredictable looping
    # You can have as many fallback as you want
    # this will be the final way your system will run until something occur
    # for my security I use a schedule (which consist of my station Id,My news,etc.)
    # follow  to see my final script http://forum.sourcefabric.org/discussion/15650/airtime-2-4-and-backups-playlists-give-yours


    default = fallback(track_sensitive = false,[security,v])


    #This where your magic begins it states play your security file first then move to the playlist (v) and keep playing (v) until something changes
    #so at the end of (v)- the last song the playlist will start playing songs over and keep going until something happen,it will go do that stuff and #return
    # track_sensitive=false  Without this the fallback would wait the end of a track to switch.
    # In most case you will not want
    track_sensitive=true so that if there is a bad or silence track,fallback will have to wait for it to end to move on
    #The order of the brackets [] are [1st,2nd] and therefore unless the 1st event is not completed the second will not occur
    # therefore you do not want to put say a playlist of jingles,etc as the first "1st" unless you want the system to keep playing jingles
    #if you do not want this put a single song in the fallback or a stream and when these are not present it will move to your playlist 2nd

    #l leave these line below alone
    # if you want go to system settings and put the offline tags you want

    ref_off_air_meta = ref off_air_meta
    if !ref_off_air_meta == "" then
        ref_off_air_meta := "Airtime - offline"
    end


    #the line below is optional if you leave it alone,airtime will use this as the meta-tag

    default = rewrite_metadata([("title", !ref_off_air_meta)], default)

    # I commented the line below,I still not able to say why as I used this for buffer - runs but may mean something else in Airtime
    # I had no difference commented or uncommented if you do let me know

    # ignore(output.dummy(default, fallible=true))




     
    That's it you have completed  your first lesson in ls_scripting.
    Hack away and let us know how it worked for you
    I will point you to some of the scripts I found here and how to have them worked for you

    If you did my fallback mount I listed here http://forum.sourcefabric.org/discussion/15678/tips-to-fullfil-and-spice-up-your-airtime-life-dailymonthlyor-whenever-the-pen-fill-with-ink

    Then listeners will not even know when you issue the restart command

    sudo service airtime-liquidsoap restart

    ctrl-c

    and see the magic  by typing

    sudo airtime-log -t liquidsoap

    To restore your original ls_script

    sudo cp /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq.mybackup 
    /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq



    Here is my working ls_script   http://forum.sourcefabric.org/discussion/15650/airtime-2-4-and-backups-playlists-give-yours




    Post edited by Voisses Tech at 2017-04-10 07:23:54
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • 30 Comments sorted by
  • The watch mode in playlist will allow you to place new media files in any directory without having to need to restart your ls_script.

    So place this
      reload_mode="watch" in any playlist
    Like this f.e
    playlist(mode="random",reload_mode="watch","/srv/airtime/stor/imported/")
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Vote Up0Vote Down BartBart
    Posts: 89Member
    Thank you Voisses Tech! Your scripts are helping me (and others!) a lot to learn more about liquidsoap.

    Schelstraete Bart - http://www.contact-dance.com
    image
  • I'm using script 1 - slightly adapted (names, only, see below) and I've found a strange thing with this and also other versions (I tried this one before: http://myassradio.com/index.php/software/airtime/5-fallback-folder) that when it goes back to the scheduled program, about 5-10 seconds later it cuts into the random fallback for 1-2 seconds, then back to the scheduled program!

    I am using the Icecast fallback for admin/Airtime issues too - but it's not that cutting in.
    #default = amplify(id="silence_src", 0.00001, noise())

    # auto DJ additions from Voisses script

    myplaylist = playlist(mode="random",reload=300,"/home/shows")
    promos = playlist("/home/shows/genericpromos")
    security = single("/home/shows/genericpromos/Listening to RCL -sting.m4a")
    mymusicbackup = mksafe(myplaylist)
    mypromos = promos

    playmymusicbackup=rotate(weights = [1,5],[mypromos,mymusicbackup])
    default = fallback(track_sensitive = false,[playmymusicbackup,security])

    ref_off_air_meta = ref off_air_meta
    if !ref_off_air_meta == "" then
        ref_off_air_meta := "Airtime - offline"
    end
    #default = rewrite_metadata([("title", !ref_off_air_meta)], default)
    ignore(output.dummy(default, fallible=true))


  • " when it goes back to the scheduled program, about 5-10 seconds later it cuts into the random fallback for 1-2 seconds, then back to the scheduled program!"

    When does this occur
    - if there is a  web schedule
    - a schedule playlist
    - master/show schedule

    Basically this script is a filler fo silence and if the fallback occur then there is a gap (Schedule) between and silence switch over.

    The script does nothing by itself but load songs when there is silence.

    I need more details give me a time when you have a fallback so I can listen.I await another person to say that but from my test I do not have that problem.

    What Icecast mount you use ? tell me let me see where your problem are

    I listen to your stream here http://listen.radioclash.com:8000/streamhigh with rythmnbox and amarok and they disconnected a number of times.
    VLC works most times so make sure all is well on your side

    Voisses





    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I'm using a schedule, not a playlist, I use long shows, with shorter music between - most I use is smart blocks but not at the moment.

    It would be disconnecting since I've been having real problems since installing that script - rebooted several times and had to basically restart airtime-liquidsoap as it refused to reboot with that script - I've gone back to normal and it's a lot better - I kept a copy! But I have a problem currently with monit which apparently is a bug in 2.4 and will be fixed in 2.4.1 - hence wanting a fallback as I was getting gaps, but gaps are better than random music cutting in!

    Also is possible to delay the start of the default fallback? I find it kicks in when the feed is having these glitches rather than later - in fact at one point it was cutting in every few seconds which was weird...
    Post edited by Tim RadioClash at 2013-08-23 00:17:32
  • If you hear this at fallback

    playmymusicbackup=rotate(weights = [1,5],[mypromos,mymusicbackup]).

    it means some thing is wrong with your schedule and Airtime- there is silence because of a schedule and non-schedule


    If you hear this at fallback ie. your security file


    default = fallback(track_sensitive = false,[playmymusicbackup,security])


    it means some thing your music list is too short



    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • yes just set the airtime fade to a greater number

    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Neither is the case, it happened randomly - as I said it cut back in after it cut out, when a scheduled item came in for instance - 10 seconds later you'd have 1-2 seconds of the fallback cutting in.

  • yes just set the airtime fade to a greater number



    Airtime fade never worked that great for me...I'll give it a try!
  • make promos be single
    promos = single("/srv/backup/promos.mp3")

    and make a 12s-14s mp3 with nothing(silence) or your station ID just use audacity  to do it .
    then fiddle with crossfade under preference  make it like 7 s and let me know.




    Post edited by Voisses Tech at 2013-08-23 00:39:42
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Hi, can someone help me with something. 

    I can't seem to understand how liquidsoap work so i have the following situation. I need to modify the script for 5 periods of the day. 

    Early mornin' - 05:00-08:00
    mornin' - 08:00 - 12:00
    midday - 12:00 - 18:00
    early evening - 18:00 - 21:00
    late evening - 21:00 = 00:00
    night - 00:00 - 05:00
    I need my fallback/backup to play from these folders everyday. Can you guys help me with the script? I do not have jingle/ids/etc. at this point.

    Thank you.

    Later edit:

    I got this bit down, but i'm not so sure it is enough.

    earlymorning = playlist("/srv/airtime/stor/earlymorning")
    morning = playlist("/srv/airtime/stor/morning")
    midday = playlist("/srv/airtime/stor/midday")
    earlyevening = playlist("/srv/airtime/stor/earlyevening")
    lateevening = playlist("/srv/airtime/stor/lateevening")


    radio = fallback(track_sensitive=true, [ switch([({ 0h-5h }, night),
                            ({ 5h-8h }, earlymorning),
                            ({ 8h-12h }, morning),
                            ({ 12h-18h }, midday),
                            ({ 18h-21h }, earlyevening),
                                ({ 21h-0h }, lateevening)]),
                        default])
    Post edited by Bogdan Gherasim at 2013-09-14 14:32:15
  • Why not do this type of programming in Airtime schedule?

    But I will assume that you are like me I have one Live show on the weekend so all the other times I have a playlist run by itself.
    I will not test a script like this but I will show you how to get it working.


    #*********************************Safety First*********************************************

    # lets first have a file called safety so that when something goes wrong
    # or when a playlist end it will be trigger
    # This can normally be a station Id etc.

      stationID = single("/srv/airtime/stor/stationid.mp3")



    #*********************************The schedule**********************************************

    #Lets first define the variable "radio" to be our schedule
     radio =
            switch([

                            ({ 0h-5h }, night),
                            ({ 5h-8h }, earlymorning),
                            ({ 8h-12h }, morning),
                            ({ 12h-18h }, midday),
                            ({ 18h-21h }, earlyevening),
                            ({ 21h-0h }, lateevening),
                            ({ true },stationID),

                   ])


    #*********************************Feed with music********************************************

    # And now to play the back up music and if a schedule play that
    # we will define a new variable to play that schedule called "music"
    # do not use "radio" here its our schedule
    # do not use "default" its our fallback
    # random /rotate use "rotate" so that scan the "radio"list to the end of the  4th song to see
    # if there is any change
    #
    music=rotate(weights = [1,4],[stationID,radio])

    #*********************************Fallback to default******************************************
    #  I would use track sensitive= false
    #  track sensitive = true means that your schedule ("radio") may not come on at the exact time but
    #  will wait until whatever is playing comes to an end to start
     
    default = fallback(track_sensitive = false,[stationID,music])
    #
    #********************************* End ******************************************

    NB
    • Remember I did not test this and I still believe all these feature is covered  in airtime
    • You should opt to put your files in a different directory than the airtime  so that you could use the upload script and give it write permission so that you can use an ftp ciient and upload





    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Hi, is there any way to play from sound card's line-in when nothing is schedule? I need to use a two line-in sound card, one to record live show and another to play a satellite radio when nothing is scheduled.
    I'm using ubuntu server.
    Thanks,
    Andrea
  • Yes I did do a tutorial
    with this I was able to ditch Encoding clients like butt etc 

    Here Are the tutorial


    and here


    My recommended soundcard is
    2496 for 1-2 stations

    1010LT for multiple stations
    Find my suggestions here


    Voisses

    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Vote Up0Vote Down hoerichhoerich
    Posts: 627Member, Airtime Moderator


    Hi, is there any way to play from sound card's line-in when nothing is schedule? I need to use a two line-in sound card, one to record live show and another to play a satellite radio when nothing is scheduled.
    I'm using ubuntu server.
    Thanks,
    Andrea

    I'm in a similar position like you.
    In near future we want to use multiple Soundcard-Inputs. Input 1 for Live-Studio, Input 2 for satellite radio.

    In your case I think the most tricky part is to setup the soundcard correctly with ALSA or JACK.
    You could use default Line-In (hw:0,0) for show-record and 2nd Line-In (f.e. hw:0,1) for satellite radio.

    If you change your ls_script.liq to include a fallback to 2nd Line-In, then anytime you have no show planned or content added to a show, it falls back to satellite radio input.
    There are many discussions about this. search for it or go through my comments http://forum.sourcefabric.org/profile/comments/1740/hoerich

    I already had success trying this, but only with choppy sound.
    frame.size, buffer, etc. are very important for this.
    check liquidsoap manuals for more infos on this http://savonet.sourceforge.net/doc-svn/reference.html

    Which soundcard do you want to use?
    Let us know how you go your way!

    cheers
    Official Airtime Forum Manager
    --------------------------
    Most of the time an issue is located between keyboard and chair.
  • I have move the discussion to a new thread http://forum.sourcefabric.org/discussion/16081/is-there-any-way-to-play-from-sound-cards-line-in-when-nothing-is-schedule  since this recent question is about sound card  and not ls_script modification

    Finally
     If You chose to do Simple modification,This can be in one line  and even with external streams

    I will use my one line  modification for silence found here [ I like this for fast,simple,and quick solution]

    So here is what you would do something like this
    #Use this to test first
    #default = fallback(track_sensitive = false,[playlist(mode="normal","/srv/airtime/stor/imported/")])

    Code Starts here:

    #now modify to pick up an external stream instead

    #external stream
    urlexternalstream=input.http("http://localhost:port/mount")

    # Some music,Jingles,Airtime library etc
    somemusic =playlist("/srv/airtime/stor/imported/")

    # you could put music weights to hit a jingle then a song etc

    #Fallback where when there is no stream,play something and return when stream comes back online
    default = fallback(track_sensitive = false,[urlexternalstream,somemusic])



    Post edited by Voisses Tech at 2014-02-05 22:56:50
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Thanks for your scripts. First of all i have to say that i do not like hacking the default silence for a main reason, it uses to get mixed with the current content, either if it is scheduled content or a live show, but if it works for you great!, just one suggestion:

    Instead of doing all modifications in the ls_script, that will get overriden next time you upgrade or reinstall airtime, why not adding an include like this:

    default = amplify(id="silence_src", 0.00001, noise())

    # Include your own liq script path

    %include "/etc/liquidsoap/myscript.liq"


    Then you can safely do any modification in myscript.liq and next time you upgrade or reinstall airtime just have to add the include line again.


    An example of the myscript.liq would be:

    #!/usr/bin/liquidsoap

    #set("log.file.path","/var/log/liquidsoap/myscript.log") //disable the log

    clock   = single(id="clock","/var/airtime/stor/sounds/clock.mp3")


    silence = amplify(id="silence_src", 0.00001, noise())


    morning = playlist.safe(reload=43200,mode='random',"/var/airtime/stor/playlists/morning.m3u")

    night = playlist.safe(reload=43200,mode='random',"/var/airtime/stor/playlists/night.m3u")



    afternoon = playlist.safe(reload=43200,mode='random',"/var/airtime/stor/playlists/afternoon.m3u")

    # Some jingles


    jingles = playlist.safe(mode='random',"/var/airtime/stor/playlists/jingles.m3u")

    # If something goes wrong, we'll play this


    security = audio_to_stereo(single("/var/airtime/stor/sounds/default.ogg"))

    radio=fallback([


            switch(track_sensitive=false,[


                    ({ 1w and 1h-6h }, night),


                    ({ (2w or 3w or 4w or 5w) and 0h-6h}, night),


                    ({ (1w or 2w or 3w or 4w or 5w) and 6h-10h}, morning),


                    ({ (1w or 2w or 3w or 4w or 5w) and 18h-20h}, afternoon),


                    ({ 6w and 3h-6h }, night),


                    ({ 6w and 6h-9h }, morning),


                    ({ 7w and 1h-6h }, night),


                    ({ 7w and 6h-9h }, morning),


                    ({ true }, silence)


                    ])


    ])


    # Now add some jingles


    radio = rotate(weights = [1, 4],[jingles, radio])


    # And the clock thing


    radio = add([radio, switch([({0m0s},clock)])])


    # finally the security


    default = fallback([radio, security])


    #output.icecast( //REMOVED THE OUTPUT AS IT WILL BE BROADCASTED BY AIRTIME-LIQUIDSOAP

    #       %vorbis,

    #        host = "localhost",

    #        port = your_port,

    #        password = "your_password_here",

    #        mount = "offline" ,

    #        genre="radio",

    #        description="Some description here!",

    #        name="(((( station_name ))))",

    #        radio)



    my 1 cent here :)
    Post edited by Bashatee Radio at 2014-04-24 23:02:54
  • Thanks for your suggestions @Bashatee but  this was the basic stuff ,The parts about separate includes liq was covered here  http://forum.sourcefabric.org/discussion/16091/fallover-101-how-to-make-all-scripts-worked-revisted-pt2-advance-reduce-effects-of-upgrade-brok/p1

    There is also a thread that was started  for person who want to display the scripts.

    I delve into a whole cases of different scenario (even got flap for some) but I even did  a One-line modification. you might want to read my comment in this post
    http://forum.sourcefabric.org/discussion/16340/how-would-one-go-about-making-a-top-of-hour-script-which-plays-station-id-news-

    My attempt here was to take a NOOB and let them follow through trying different cases(examples),wet the appetite and then broaden the knowledge.

    Comment well respected

    but I urge you to look through my posts,there are wonderful tips even how to use a Mixer/broadcast console even how to record painlessly.

    I have two approach to teaching or coaching anyone
    1. You must want to go further
    2. You must Think its easy (never impossible)

    Good Luck

    VOISSES

    "Open source is the best since slice bread"


    ps.
    I am not too clear on what you meant "mixed with schedule/live content"
     but to make your silence do not mixed with your schedule (if i am interpreting you correctly) you can do either of these

    1. Set a transition  with jingles
    2. Set a broader fallback with something like this (main content,jingle,jingle,security) or whatever
    3. Do a smooth fade or crossfade

    Like I said this is the easy stuff for the NOOB or like I always say dummies like me





    Post edited by Voisses Tech at 2014-04-24 23:24:53
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Hi Voisses, 

    Thanks for your clarification. 

    What i meant for "mixed with schedule/live content" is that when overriding the default behavior, when the DJ connected to a live show and there was a micro-disconnection, then airtime would try to play the fallback content, making the show unlistenable. Your proposal of doing a transition or a smooth fade may work.

    Anyway, now i use the show link feature and smart blocks to make the automatic lists, this way I have more control of what is played.
    Post edited by Bashatee Radio at 2015-02-15 08:12:19
  • @Bashatee_Radio
    So here is a further thought,In my reflections on the possible reasons why the original author of the ls_script by putting the silence so that if something or nothing schedule I clearly see the logics of why they did it.

    It is one of the reason ,I later wrote this post https://forum.sourcefabric.org/discussion/16909/autodj-sweetest-seen-fake-or-real-for-a-good-deal-free-free-no-unexpected-autoplay

    its basic premise is that keep the silence as long you like and whatever you level you like.
    This eliminate when say your DJ or web stream losses its connection and you are face with dead air for that period( and if that connection is lost for 1 hour or more your listener is face with this.)
    As you can also see this will need tweak,it you are running a talk-show ,remote station or dj or web stream but works perfectly for all music,so you have to build on it  as I will never be able to contemplate all the possible uses of airtime.

    so lets say you wanted the dead air for 2 minutes (120secs) should a disconnection occur,you would just put the max_blank=120 and so it will start 2 minutes after a disconnection

    There are many other things you could do even putting a fall back with transitions to use the buffer or adaptive.buffer functions

    My scope was to give the reader a navigation and they travel the journey

    So unlike many,I want your thoughts and to contribute to it suggesting,could we do this or that to make it better.

    so I glad you have something that works for you.

    VOISSES
    6 to Go
    Post edited by Voisses Tech at 2015-02-15 12:39:21
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • @Voises_Tech, i have two question indeed,

    In one hand, the fallback.liq constantly plays songs, then, if a show has no content it switchs to the fallback.liq BUT, starting in the middle of the fallback track. Another case: two shows, both with content, one second of the fallback track is being played in the middle of both shows, which is really anoying, (sometimes it's noisy audios, i.e:metal or things like that)

    In the other hand, I programmed some shows fed by an external webstream only enabled at show time, if the dj does not start the show in time, the fallback would start but it seems not to switch to the programmed webstream when enabled. Should i add the switch to the live show in the fallback.liq or is there something else wrong? I mean... if i drop audios to the show, it does switch to the content but when it's a stream it does not.

    Thanks a lot
    Post edited by Bashatee Radio at 2015-03-21 08:14:51
  • So I am not back (but explain later).
    I gave you All the Answers,maybe some times in parable.
    Look here https://forum.sourcefabric.org/discussion/16909/autodj-sweetest-seen-fake-or-real-for-a-good-deal-free-free-no-unexpected-autoplay at at number 5 in the said answer

    "5.Make these values whatever you want like for most popular music 15sec @23db is sufficient.talk 60sec@45db and so on.(no hard and fast rule)"

    now want  to make it sweeter  lets drop a jingles(or station id)

    look here http://savonet.sourceforge.net/doc-0.9.2/cookbook.html and it basically says
    •  For  (switch, fallback and random) use Transitions (however this A simple (long) cross-fade .can be misleading ,I would have preferred A simple (long) transitions)
    • For Tracks Use Crossfades

    now how do you use it

    Just put the function (its in the utils but I want my custom version) some where above where you want to use it

    here is mine

    # Define a transition that fades out the
    # old source, adds a single, and then
    # plays the new source
    def outside_k(jingle,old,new) =
      # Fade out old source
      old = fade.final(old)
      # Superpose the jingle
      s = add([jingle,old])
      # Compose this in sequence with
      # the new source
      sequence([s,new])
    end

    # A transition when switching back to files:
    def outsidetrans_d(old,new) =
      # We skip the file
      # currently in new
      # in order to being with
      # a fresh file
      source.skip(new)
      sequence([old,new])
    end

    now for my default

    I have say two jingles define jingles

    The reason why you should use single is they a prepared and available once the script starts until the script end

    do not use the same jingle immediately behind each other in a switch or transitions because if the script call the same source at the same time you will have some serious catch up to do when Source A request the Jingle that Source B is consuming. and you like will see "we must catch up 1.06 sec) and you will search down the world to get what's wrong


    mystationID=single(blah)

    myjingles1=single(another blah)

    myjingles2=single(yet another blah)

    #format default=fallback(track_sensitive=false,[transitions],[whatever to transition])

    default=fallback(track_sensitive=false,[outsidetrans_k(mystationID),outsidetrans_k(myjingles1),outsidetrans_d(myjingles2)],[live,music,default*])

    #so basically what it does in the case of

    • live to music it plays the station Id
    • from music to default a jingles
    • from default to live a jingles

    so if you use the above (5) you can time the amount of silence you want because once the logics is that once any one of the source become unavailable the previous will be tested for availability Then the proceeding will be tested for availability.

    note previous source have priority and will go once they are available,so feel free to change the order to your liking

    so if live becomes unavailable music will play ,if music becomes unavailable it will test live before proceeding to default.

    notice some nice things in the cook book like fade final,source skip(like the current song in queues to a new on as the transition occurs)

    so now with knowledge you should be able to change the djs line  which contains [trans ,trans blah blah] in the airtime script


    Voisses





    Post edited by Voisses Tech at 2015-03-21 19:23:42
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • In the other hand, I programmed some shows fed by an external webstream only enabled at show time, if the dj does not start the show in time, the fallback would start but it seems not to switch to the programmed webstream when enabled. Should i add the switch to the live show in the fallback.liq or is there something else wrong? I mean... if i drop audios to the show, it does switch to the content but when it's a stream it does not.

    Should not

    Queue have priority maybe your fallback is not stated in the proper order

    try this
    default = fallback(track_sensitive=false,[autodj,strip_blank(max_blank=30.,threshold=-45.,default)])

    instead of this


    default = fallback(track_sensitive=false,[strip_blank(max_blank=30.,threshold=-45.,default),autodj])
               

    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Now to Explain

    No I am simple person,(dump,fool,and equally literate as the average person).The only thing that gives me a edge above a lot of person is I listen.I read it over and over.If  it is nonsense,I put it in RAM.
    My EPROM and ROM is limited to used on Hogwash

    No Senior person should insult me in here and you remove my reply and leave theirs
    But all I ask is equity Remove theirs Also.

    In the Meantime,as I said I have no passion,I am a Vulcan,give me equal space to blast "idiot-like" person or remove both of our stupidity

    OOps this does not apply to All who seeks answer but the trolls here with some " basin-heads" Full of nothing but water

    Voisses

    Post edited by Voisses Tech at 2015-03-21 19:29:41
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I will out line three scripts which uses the principle above ,these are as follows
        
    carts are like jingles,beds.promos etc. music is included but we treat it as exception
    1. This Script gives you the ability to rotate carts and music on a simple ratio basis like 1 : 10 meaning for every 1 carts you play 10 music.
    2. Script 2 introduce schedule or event switch.Its more flexible but best suit when you want the music to stop and execute the cart or  event
    3. Script 3 builds on scripts (1 and 2 ) it also introduce overlays where you can play a sweeper on top of existing,it introduce also the ability to amplify sweepers above your scripts and maybe what most people want
    Please back all your  original ls_scripts before you modify it and backup the modification for subsequent release.
     
    Post edited by Voisses Tech at 2013-08-03 21:01:23
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • # Script 1

    #default = amplify(id="silence_src", 0.00001, noise())


    #^^^^^^Start Of Modification^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    # Music

    myplaylist     = playlist(mode="random",reload=300,"/srv/backup/music")


    # If something goes wrong, we'll play this
    startup = playlist("/srv/backup/startup")

    # If something goes wrong, we'll play this
    security = single("/srv/backup/drops/station.mp3")

    #***********Start building the feed with music******************************************
    # Start building the feed with music by assigning to the same clock (variables)

    mymusicbackup = mksafe(myplaylist)
    mystartup = startup

    #**************Feed with music*************************************************************

    # And now to play the back up music when something goes wrong
    #This is the simplest way of having 1 song from your cart play for every 4 music
    #just subsitute jingles for mystartup and the numbers you want like ratio 1:10

    playmymusicbackup=rotate(weights = [1,4],[mystartup,mymusicbackup])



    #*************Fallback to default******************************************************


    #And finally the security
    default = fallback(track_sensitive = false,[playmymusicbackup,security])




    #^^^^^^^^End Of Modification^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Post edited by Voisses Tech at 2013-08-03 20:39:28
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • # Script 2

    #default = amplify(id="silence_src", 0.00001, noise())


    #^^^^^^^^^^Start Of Modification^^^^^^^^^^^^^^^^^^^^^^^^^^

    #*************Some music**********************************

    # Music

    myplaylist     = playlist(mode="random",reload=300,"/srv/backup/music")


    # If something goes wrong, we'll play this like a startup
    startup = playlist("/srv/backup/startup")

    # If something goes wrong, we'll play this
    security = single("/srv/backup/drops/station.mp3")

    #
    # jingles

    jingles     = playlist(mode="random",reload=300,"/srv/backup/jingles")

    #

    # stationid
    stationID    = playlist(mode="random",reload=300,"/srv/backup/stationid")



    #*********Create Some Schedule Event********************************

    # This type of schedule will cause the music to stop
    # The trick to make a seperate variable for schedule
    # when the time reach liquidsoap knows something happen jumps to fall back and see there is a schedule
    # It plays the fall back it first meets
    # try to space your timing more appropriately this is just a sample
    # this is a hourly break out
    # it makes better use of carts like(jingle,promo,beds,station ID)  


    schedule=
             add([
                   switch([
                            ({ 0m00s },delay(1.,jingles)),
                            ({ 0m30s},delay(1.,stationID)),
                            ({ 03m10s},delay(1.,jingles)),
                            ({ 15m00s},delay(1.,stationID)),
                            ({ 25m00s},delay(1.,jingles)),
                            ({ 30m00s},delay(1.,stationID)),
                            ({ 32m00s},delay(1.,jingles)), 
                            ({ 35m00s},delay(1.,jingles)),
                            ({ 45m00s},delay(1.,stationID)),
                            ({ 45m40s},delay(1.,jingles)),
                            ({ 50m00s },delay(1.,jingles)),
                         ])
               ])



    #******Start building the feed with music*************************************
    # Start building the feed with music by assigning to the same clock (variables)

    mymusicbackup = mksafe(myplaylist)
    mystartup = startup

    #******Feed with music*************************************************

    # And now to play the back up music when something goes wrong

    playmymusicbackup=rotate(weights = [1,4],[mystartup,mymusicbackup])

    #********Processing Section*****************************************




    #*******Fallback to schedule with music************************************

    # Fall back for Music track_sensitive=false,because we want the music pause/stop then 
    # play the schedule and start again

    playmymusicbackup = fallback(track_sensitive = false,[schedule,playmymusicbackup])



    #*******Fallback to default**********************************************


    #And finally the security

    default = fallback(track_sensitive = false,[schedule,playmymusicbackup,security])



    #^^^^^^^^^^^^^^^End Of Modification^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • #Script 3

    #default = amplify(id="silence_src", 0.00001, noise())


    #^^^^Start Of Modification^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    #******Some music******************************************

    # Music

    myplaylist     = playlist(mode="random",reload=300,"/srv/backup/music")


    # If something goes wrong, we'll play this like a startup
    startup = playlist("/srv/backup/startup")

    # If something goes wrong, we'll play this
    security = single("/srv/backup/drops/station.mp3")

    #
    # jingles

    jingles     = playlist(mode="random",reload=300,"/srv/backup/jingles")

    #

    # stationid
    stationID    = playlist(mode="random",reload=300,"/srv/backup/stationid")

    #

    # for some sweepers

     sweeper = single("/srv/backup/sweepers.mp3")


    #********Create Some Schedule Event**********************************

    # This type of schedule will cause the music to stop
    # The trick to make a seperate variable for schedule
    # when the time reach liquidsoap knows something happen jumps to fall back and see there is a schedule
    # It plays the fall back it first meets  
    # the other type of schedule(sweepers) have placed after you define the variable

    schedule=
             add([
                   switch([
                            ({ 0m00s },delay(1.,jingles)),
                            ({ 0m30s},delay(1.,stationID)),
                            ({ 03m10s},delay(1.,jingles)),
                            ({ 15m00s},delay(1.,stationID)),
                            ({ 25m00s},delay(1.,jingles)),
                            ({ 30m00s},delay(1.,stationID)),
                            ({ 32m00s},delay(1.,jingles)), 
                            ({ 35m00s},delay(1.,jingles)),
                            ({ 45m00s},delay(1.,stationID)),
                            ({ 45m40s},delay(1.,jingles)),
                            ({ 50m00s },delay(1.,jingles)),
                         ])
               ])




    #************Start building the feed with music**********************************
    # Start building the feed with music by assigning to the same clock (variables)

    mymusicbackup = mksafe(myplaylist)
    mystartup = startup

    #***********Feed with music***********************************

    # And now to play the back up music when something goes wrong

    playmymusicbackup=rotate(weights = [1,4],[mystartup,mymusicbackup])


    #**********Schedule some sweepers****************************************

    # This type of schedule will cause the music to keep playing
    # The trick to use the existing variable a lay the switch on top of it
    # when the time reach liquidsoap knows something happen and see there is an event
    # It just keep playing and lay the track on top
    # I can hardly explain this good
    # playmymusicbackup is the varible I am using,so you have to put the event(schedule) after it
    # lets amplify the sweeper first ,because although replay gain will reduce the music playing
    # sometime you bearly hear it try not to over amplify 0.7 to 2 are good gains
    # if your general output is too low play with replay gain in system settings
    # but just to make the overlay sound higher amplify it
    # s = amplify(2.0, s) is the format
    # therefore
    #
     
    sweeper = amplify(2.0,sweeper)
     
    #
    # then we keep the music playing as we apply the switch
     
    playmymusicbackup = add([
                           playmymusicbackup,
                                switch
                                   ([
                                      ({20m00s},sweeper)
                                   ])
                            ])




    #********Processing Section********************************************************




    #*********Fallback to schedule with music*******************************************

    # Fall back for Music track_sensitive=false,because we want the music pause/stop
    #then  play the schedule and start again

    playmymusicbackup = fallback(track_sensitive = false,[schedule,playmymusicbackup])



    #*******Fallback to default******************************************************


    #And finally the security

    default = fallback(track_sensitive = false,[schedule,playmymusicbackup,security])



    #^^^^^^End Of Modification^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I try  my best to ensure I test my scripts at least 1 week before I even tell anyone about them

    However,I am human  and perfection is far from my ability,so you will see my imperfection as you go through these,but I will do my best and fixed them and where appropriately I will seek help to do so.

    Take it Break it Remake it but I give you one charge and this is Share it

    So lets Team up
    Voisses

    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Vote Up-1Vote Down Voisses TechVoisses Tech
    Posts: 1,419Member
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.