Jingle every 1 song, but on the script every 3
  • ##############################################################################################################

    #music = playlist (mode='randomize',reload=1200,reload_mode="rounds", "/home/mp3/muzika/Muzika/AutoDJ/")

    jingles = playlist(mode='randomize',reload=1200,reload_mode="rounds", "/home/mp3/muzika/AutoDJ/dzinglai/")

    weekends = playlist (mode='randomize',reload=1200,reload_mode="rounds", "/home/mp3/muzika/AutoDJ/Savaitgalio Muzika/")

    morningday = playlist (mode='randomize',reload=1200,reload_mode="rounds", "/home/mp3/muzika/AutoDJ/Rytas - DIENA/")

    night = playlist (mode='randomize',reload=1200,reload_mode="rounds", "/home/mp3/muzika/AutoDJ/Vakaro Muzika/")

    security = single("/home/mp3/muzika/AutoDJ/dzinglai/Jingles/Radijo stotis fixfm su muzika.mp3")

    valanda = single("/home/mp3/muzika/AutoDJ/kiti/nauja valanda deividas.mp3")


    mixed = switch([
    ({ (1w) and 00h00m00s-17h59m59s}, morningday),
    ({ (1w) and 18h00m00s-23h59m59s}, night),
    ({ (2w) and 00h00m00s-4h59m59s}, night),
    ({ (2w) and 05h00m00s-17h59m59s}, morningday),
    ({ (2w) and 18h00m00s-23h59m59s}, night),
    ({ (3w) and 00h00m00s-4h59m59s}, night),
    ({ (3w) and 05h00m00s-17h59m59s}, morningday),
    ({ (3w) and 18h00m00s-23h59m59s}, night),
    ({ (4w) and 00h00m00s-4h59m59s}, night),
    ({ (4w) and 05h00m00s-17h59m59s}, morningday),
    ({ (4w) and 18h00m00s-23h59m59s}, night),
    ({ (5w) and 00h00m00s-4h59m59s}, night),
    ({ (5w) and 05h00m00s-15h59m59s}, morningday),
    ({ (5w) and 18h00m00s-23h59m59s}, night),
    ({ (6w) and (7w) },weekends),
    ({ true }, delay(1.,morningday))
    ])

    valanda =amplify(3.0,valanda)
    playrotation = rotate(weights=[1,4],[jingles,mixed])

    schedule =add([playrotation,
    switch([
    ({ 0h0m00s },valanda),
    ({ 1h0m00s},valanda),
    ({ 2h0m00s},valanda),
    ({ 3h0m00s},valanda),
    ({ 4h0m00s},valanda),
    ({ 5h0m00s},valanda),
    ({ 6h0m00s},valanda),
    ({ 7h0m00s},valanda),
    ({ 8h0m00s},valanda),
    ({ 9h0m00s},valanda),
    ({ 10h0m00s},valanda),
    ({ 11h0m00s},valanda),
    ({ 12h0m00s},valanda),
    ({ 13h0m00s},valanda),
    ({ 14h0m00s},valanda),
    ({ 15h0m00s},valanda),
    ({ 16h00m0s},valanda),
    ({ 17h0m00s},valanda),
    ({ 18h0m00s},valanda),
    ({ 19h0m00s},valanda),
    ({ 20h0m0s},valanda),
    ({ 21h0m00s},valanda),
    ({ 22h0m00s},valanda),
    ({ 23h0m00s},valanda),
    ])])

    # now lets set up a music rotation



    musicbreak= fallback.skip(input=schedule,playrotation)
    default = fallback(track_sensitive=true,[musicbreak,security])


    ##############################################################################################################

    Jingle every 1 song, but on the script every 3
    Post edited by TheNerka at 2014-12-14 05:30:31
  • 3 Comments sorted by
  • TheNerka
    No offense but you copy not good (bad!)
    If you look at what I wrote you would see the difference

    1. for time periods which are consistent and the same playlist you only need a single statement
    so your switch for schedule should be  just

    schedule =add([playrotation,
                     switch([
                              ({ 0m00s },delay(1.,valanda)) # <= Please note the delay so that you do not have jingles playing  too quickly
                           ])
                 ])

    It Makes no difference but its a little tidy,use less line and easier to read,similar if you want every 15 minutes it would be ({ 15m00s },valanda),30 minutes is ({ 30m00s },valanda) and so on.

    The fallback.skip will kick one song or the currently playing song which maybe the reason for that one song lost since your track-sensentivity is true which suggest to wait until the currently playing song is finished before the rotation.

    Try changing the track-sensentivity to false like this
    default = fallback(track_sensitive=false,[musicbreak,security])

    I cannot test but in addition if that does not work

    then try

    • Keep the default line as I just suggest that is make it stay as
    default = fallback(track_sensitive=false,[musicbreak,security])

    • Change the music break
    musicbreak = fallback(track_sensitive=false,[schedule,playrotation])

    Enjoy The holidays coding
    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.
  •  ({ 0m00s },delay(1.,valanda)) valanda is new hour jingle he is okay, me bugged jingles script playrotation = rotate(weights=[1,4],[jingles,mixed])
  • 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.