Creating one continuous playlist
  • Vote Up1Vote Down JarredJarred
    Posts: 1Member
    Hello,

    I have just installed airtime on my server and I was wondering if there is a way that I can upload a whole heap of songs and station id's and just have it shuffling through a song list and playing an id after every 2 songs. I don't need to schedule any shows or anything I just need it to play though the music continuously.

    Cheers,
    Jarred
  • 10 Comments sorted by
  • I'm also interested in a similar functionality. I would like to just upload a bunch of songs and get them to play randomly by category with an jingle every 2 songs, without necessary schedule a show on the calendar.

    If anyone knows how to do this, please let us know!

    Thanks.
  • Piece of cake - this is exactly what I do. 

    Specific to Airtime 2.5.1.
    Note: I assume you uploaded your music using the web interface into the default directory: /srv/airtime/stor and the jingles into /srv/airtime/stor/imported/1/jingles (change the lines in (2e) below to match your configuration if necessary)

    1. Backup your ls_script.liq file (located in /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq to your $HOME directory: 
    a. cd $HOME
    b. sudo cp /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq ./ls_script.liq.original
    2. Edit the original liquidsoap script:
    a. sudo nano /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq
    b. search for (ctrl-w): amplify(id
    c. comment out that line by adding a # character at the beginning of the line
    d. comment out the line (five lines down) that begins with: default = rewrite_metatdata([("title"
    e. add the following lines above the 'amplify' line you commented out in (2c)

    music=playlist(mode='randomize',reload=1,reload_mode="rounds","/srv/airtime/stor/")
    jingles=playlist(mode='randomize',reload=1,reload_mode="rounds","/srv/airtime/stor/imported/1/jingles/)
    default=rotate(weights=[1,2],[jingles,music])

    f. save the ls_script.liq file and exit the editor
    3. Restart airtime-liquidsoap (I use monit, available on http://localhost:2812)

    This has the added advantage that if you do schedule a show, it will take precedence.
  • Vote Up0Vote Down Voisses TechVoisses Tech
    Posts: 1,423Member
    There is 5 Things wrong with that script and here is the re-written script.Wish I had correct it before in the wiki.


    # see *1 - Use Airtime dir with caution create your own autodj music folder and import to Airtime from it

    music = playlist(mode='randomize',reload=3600,reload_mode="watch","/srv/airtime/stor/imported/1/")

    jingles = playlist(mode='randomize',reload=1,reload_mode="watch","/some/path/to/jingles")


    # See 2*
    security  = single("/some/path/to/security.mp3")


    # See 3*
    jingles=delay(1.,jingles)

    # See 4*

    rotation = rotate(weights=[1,2],[jingles,music])

    # See 5*
    default= fallback(track_sensitive = false,[rotation,security])


    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 Voisses TechVoisses Tech
    Posts: 1,423Member
    Here is the Notes

    #Notes

    # *1

    #  reload - make this more than 1 sec otherwise you might have one song playing too often 3600s=1hr

    #reload_mode - make this watch when ever songs in the folder changes it will be accepted without restart
    #If you use rounds or seconds for your playlist it become static and you will have to restart each you add songs
    #
    # directory - songs are stored in /srv/airtime/stor/imported/1/ be aware that anything you import will be part of
    # the playlist. Its best to create your own directory.if you use a jingles folder under airtime storage,you
    # have to tag its artist as jingles and its also will play in your music unless dir is different
    #
    # *2
    # Its recommended that you create some form of emergency or security files,when something go wrong

    #  *3
    # If You use a playlist for jingles you want to delay Ls from picking up and play a second jingles
    # too early
    # If your jingles is shorter than 45sec use 1 sec delay,if lessthan 1min45sec use 2sec delay and so on.
    # playlist are loaded 10 sec before preparation

    # *4
    #
    # set a rotation different from default.Airtime default is actually to stream silence when some goes wrong
    # If you use it as suggested above your weights will only occur once at start then some unpredictable results

    # *5
    # to keep everything intact make a fallback when something goes wrong.without this when something goes wrong
    # you will always have to be restart you system,if you like that then goahead leave it out


    If you follow my steps above you will

    1.You do not need to restart when new songs are added
    2.You will not be swearing when something goes wrong,your system will recover
    3 reload_mode watch will make your playlist dynamic

    You will want to read my tutorial in the forum's Airtime Hacks and also liquidsoap quickstart for alli have noted
     

    Reference

    http://forum.sourcefabric.org/discussion/15701/fallover-101-how-to-make-all-scripts-worked-easy-steps-to-build-your-scripts-fixed-silence

    http://savonet.sourceforge.net/doc-svn/quick_start.html

    http://savonet.sourceforge.net/doc-svn/cookbook.html


    Good Luck

    VOISSES

    Post edited by Voisses Tech at 2014-05-26 21:20: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.
  • I made the changes you suggested, Voisses - thank you. Although I've not had any problems with the version I had been using (for the last year or so) that may just have been luck. Now I can add music and the playlist updates dynamically :D
  • Wow, probably nice solution (not tested yet).

    Question:

    Is it possible to "combine" with scheduled shows/playlists? Ex: I schedule x hours show once, twice... a week... The rest of the time, the script works as failsafe?
  • However, i have a question.. using the fallback hack, airtime is constantly playing the default playlist (instead of silence), is there a way to start the liquidsoap script when silence is detected? this way a jingle or station id could be added at the beginning, instead of switching to the already running liquidsoap instance. I tried with fallback.skip to no avail. Here is my script:



    # START MODIFICATION
    # default = amplify(0.00001, noise())
    # default = rewrite_metadata([("artist","Airtime"), ("title", "offline")],default)

    clock = audio_to_stereo(single("/srv/airtime/stor/ls_script/clock.mp3"))
    security = audio_to_stereo(single("/srv/airtime/stor/ls_script/security.m4a"))

    # M3U Playlists are recreated everyday at 00h by a cron:
    morning = playlist(mode='randomize',reload=1,reload_mode="rounds", "/srv/airtime/stor/playlists/morning.m3u")
    midday = playlist(mode='randomize',reload=1,reload_mode="rounds", "/srv/airtime/stor/playlists/midday.m3u")
    afternoon = playlist(mode='randomize',reload=1,reload_mode="rounds", "/srv/airtime/stor/playlists/afternoon.m3u")
    night = playlist(mode='randomize',reload=1,reload_mode="rounds", "/srv/airtime/stor/playlists/night.m3u")
    jingles = playlist(mode='randomize',reload=1,reload_mode="rounds", "/srv/airtime/stor/playlists/jingles.m3u")

    # Schedule
    schedule = switch(track_sensitive=false,
    [
    ({0h-6h}, night),
    ({6h-12h}, morning),
    ({12h-18h}, midday),
    ({18h-0h}, afternoon),
    ({ true }, night)
    ])

    # Let's play!
    rotation = rotate(weights=[2,4],[jingles, schedule])
    # Add clock signal every hour
    radio = add([rotation, switch([({0m0s},clock)])])
    # Add security
    radio = fallback([radio,security])
    # Play a few seconds of silence first
    radio = fallback(track_sensitive=false,[strip_blank(max_blank=3.,threshold=-45.,default),radio])
    # Add normalization and crossfade:
    radio = normalize(smart_crossfade(fade_out=0.5,fade_in=0.5,radio))
    # Fallback.skip supposed to move to new track on transitions from airtime to fallback, but it does nothing
    default = fallback.skip(input=radio,radio)

    # END MODIFICATION

    Thanks in advance


    By the way, if you need time based jingles, we have a workaround that might be helpful, read here https://forum.sourcefabric.org/discussion/17312/jingle-with-expiration-date

    Post edited by Bashatee Radio at 2015-03-09 22:47:08
  • I am sorry to jump here, but seems to me you guys pretty smart with Airtime tricks, so I would just as you to look at my question I posted here: https://forum.sourcefabric.org/discussion/17376/what-to-modify-in-ls-script-if-i-need-approach-this

    So basically I would like to see how to automate already scheduled show either from calendar or from master/show sources. I suspect I have to listen my live icecast output, but maybe I am wrong...
    Please help me with this. Thanks.
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • @Voisses Tech and @Wade Eilrich, I have done my best to try to implement this but I think something just isn't right... I have a fresh install of Airtime running on a headless Ubuntu 14.04 install (fresh as well).  I am a complete newb to all of this so I hope I am doing it ok... I have implemented @Voisses Tech's code at the same spot @Wade suggested... is that correct?  I save the config and restart stuff with sudo service airtime-liquidsoap restart... Am I doing this right?
    Post edited by Andy Grooves at 2015-05-03 22:44:22
  • Vote Up0Vote Down Voisses TechVoisses Tech
    Posts: 1,423Member
    These are old Thread  use this one instead

    https://forum.sourcefabric.org/discussion/comment/32704#Comment_32704

    Pay attention to this line

    default = amplify(id="silence_src", 0.00001, noise()) #this is already there you do not need to remove this
    # just put the lines below

     autodj=mksafe(playlist(mode="random","myplaylist"))
     default = fallback(track_sensitive=false,[strip_blank(max_blank=30.,threshold=-45.,default),autodj])


    that's it two lines

    It you have a spot web stream
    • Make the max_blank to like say 120. so thats like 2 minutes before the autodj chips in
    • make the threshold higher if you want like 70. so your stream have to get extremely silent

    If you want I can tell you how to add a transistion that plays a jingle or station ID before any Autodj chips in or make the time period anything you want

    For further reading

    https://forum.sourcefabric.org/discussion/15701/fallover-101-how-to-make-all-scripts-worked-easy-steps-to-build-your-scripts-fixed-silence


    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.