Organizing off-air random play
  • I commented out the couple of 'default = ' lines in ls_script.liq and added:
    default = playlist(mode='random', "/srv/airtime/stor/")

    Now during non-schedule show times my radio plays a random selection of music from my default airtime music folder (/srv/airtime/stor). This is wonderful but I had to laugh when I heard Christmas music playing. I am careful to label Christmas music with genre=Christmas in the idv3 tags and this makes it easy to select it for holiday shows. I really don't want Christmas music to play as part of my random selection of music. I've been thinking about this for a bit and although I haven't heard any jingles yet, they are also stored in the the default airtime music folder. 

    I could group the Christmas music in a directory and move it out of the default location, but then I would have to move it back in again during the holidays. The jingles are a bigger problem because I do use them during shows and it would be very inconvenient to move them around constantly. I'm thinking that a better way would be to label the jingles as genre=speech and use some programmatic method to exclude specific genres from the currently streaming playlist. Is there a way to do this (I've scanned the liquidsoap documentation and nothing jumps out at me)? 
  • 7 Comments sorted by
  • Take a look here at the section "Notify when a song is played".

    You will see how to access the song's metadata. When the track is about to begin playing, use the on_notify function to check the metadata, and if type == christmas, then simply use the "skip" function.

    I haven't tried this, but I'm assuming it will be quick enough that no one notices the track started playing. 


    Airtime Pro Hosting: http://airtime.pro
  • Hi Wade,

    Where exactly have you put  

    default = playlist(mode='random', "/srv/airtime/stor/")

    line in the ls_script.liq. I couldn't find any default line for that and definitely need to play the songs in random order as well.

    Thanks!
    eastanbul.com
  • In my  unmodified ls_script the relevant lines are 153 -158 that look like this: 

    default = amplify(id="silence_src", 0.00001, noise())
    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)


    you need to disable the first and the last line in that section by putting a # at the very start of the line, then add the line default = playlist(mode='random', "/srv/airtime/stor/") immediately after so it looks like this:

    #default = amplify(id="silence_src", 0.00001, noise())
    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)
    default = playlist(mode='random', "/srv/airtime/stor/") 
    Post edited by Phillip Mackintosh at 2013-12-04 03:08:16
  • Hello,

    Looking into this. Testing Airtime for our station, we like the DJ features. But we need random play as well.

    Got it working. Only the stream isn't showing the Artist and Title in the player. Is there a also some possibility to get this working during random play mode?

    Also the settings in Airtime about fade in and out, crossfading seems not to be used in this mode?


  • Vote Up0Vote Down Voisses TechVoisses Tech
    Posts: 1,423Member
    Try this

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

    Put this Line instead (or if not modify it to read )

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


    as I posted Here


    Some Tips as relate to this post  

    As I said Airtime is a dynamic software and Things has changed since

    To deal with seasonal playlist
     
    • Make  one directory like /path-to whatever/
    • Now make sub-directory say for christmas
    • Put this as watched folder (they will show up in your media library)[ SYSTEM ==>MEDIA FOLDER]
    • Now Create a playlist say Christmas Morning pls
    • Create a Schedule show in your calendar for the time and when that time comes it just play
    Key to note 
    1. This will not be part of your regular files in your Airtime store
    2. You can add an subtract songs as time goes by
    3. You state how it helps you
    Ps. I must confess,I never say this post when I did my


    but as they say ,   " Nothing is New in computing,Just that you have not seen it Yet "
    There is really a "treasure trove" in these Archive




    Post edited by Voisses Tech at 2014-05-10 10:08:46
    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.
  • Martin, your link is no longer works. Albert FR provides some very useful information in: https://wiki.sourcefabric.org/display/CC/Playing+Random+Songs+on+Silence

    The ls_script.liq location has changed from what is stated at the top of the above article. It is now (as of 2.5.1) in /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq

    I like to use the monit web interface (available on port 2812, .e.g. http://localhost:2812) to control airtime-liquidsoap. After modifying ls_script.liq, I use the interface to restart airtime-liquidsoap.
  • Vote Up0Vote Down Voisses TechVoisses Tech
    Posts: 1,423Member
    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.