"Auto DJ" feature (like the LiquidSoap hack on old version)

Hi there, I have got the server installed and LibreTime running :slight_smile:
Is there a way to set an “Auto DJ” that plays files from directory(s) in a scripted manner? Like the LiquidSoap hack we use on the older version?

The following is an example of how I used to do it:

def mixsetfade(~id="",~conservative=true,~start_next=3.,~fade_in=3.,~fade_out=3.,thesource)
thesource = fade.in(duration=fade_in,thesource)
thesource = fade.out(duration=fade_out,thesource)
fader = fun (a,b) -> add(normalize=false,[b,a])
cross(id=id,conservative=conservative,duration=start_next,fader,thesource)
end

jingles = playlist(mode=‘randomize’,reload=60,reload_mode=“watch”,"/disk2/media/Converted-Jingles")
tracks = playlist(mode=‘randomize’,reload=60,reload_mode=“watch”,"/disk2/media/Converted-Tracks")
mixsets = playlist(mode=‘randomize’,reload=60,reload_mode=“watch”,"/disk2/media/Converted-Mixes")

adverts = playlist(mode=‘randomize’,reload=60,reload_mode=“watch”,"/disk2/media/Converted-Adverts")

tests = playlist(mode=‘randomize’,reload=60,reload_mode=“watch”,"/disk2/media/Test-Tones")

failover = single("/disk2/media/Converted-Failover/Mixset.co.uk ~ Failover - 192.mp3")

airplay = mixsetfade(rotate(weights=[1,1,1,3],[jingles,mixsets,jingles,tracks]))
default = fallback(track_sensitive = false,[airplay,failover])

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

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

1 Like

I’m sure there is a way, but nobody has coded it yet. Most of the work has been done on the AutoPlaylist functionality and some theoretical work on building a web interface to replicate something similar to what is above. I don’t plan on coding anything that doesn’t also provide a web UI to interact with. But you are more than welcome to give a shot at writing the code to do this. It might rely upon a liquidsoap hack to work.

2 Likes

How do you deal with dead air?
Is there no auto dj in this fork?

Could you make this work somehow?

I’m definitely interested in this. Seems like it would/should be one of the most basic features for a station automation software.

The background of this goes way back. It was so easy to set up a Winamp playlist and dish out the tunes in random order in perpetuity. SAM Broadcaster has the same function, but it uses scripting to set up weighted rotations, and to script a jingle every so often. Then, if a live DJ was scheduled, they’d kick into the stream and take over. Once they’re done, it goes back to the Auto-DJ. Some stations use this method 24/7 and have been streaming literally for years without intervention.

I’m surprised this isn’t built directly into the UI, unless I’m missing something?

So, this is one of those functionalities that we haven’t built because nobody has fleshed it out entirely. We do have an autoloading playlist which can in effect perform the same action, but it requires being setup ahead of time. We do need to make it more clear and redesign the UI so that this can be easily configured without someone knowing a number of different custom steps. I’m going to be working on this over the next couple of months.

1 Like

I think Auto-DJ is great but I think most people want some kind of control, I personally think the way LB is now is a much better solution for serious stations. One might be able to achieve something similar by just using smart blocks in a playlist, you would just need to spend a day organizing your tracks and how you want that playlist to look, then just repeat it throughout the day. I guess you can use one of the unused fields to add some sort of weight that you can at least use in Smart Blocks.

I’ve added a couple new fields just to make it easier for me that can be used in the search criteria inside Smart Blocks, I think I might just add another one with ratings. At the moment, I notice people are using Genre for things like Jingles, but I needed it to be a bit more organized so I added a Media Type dropdown (Music, Station ID, Intro, Outro, Sweeper, Jingle, Promo, Shout Out, News, Commercial, Interview, Voice Tracking) since I needed it separate from Genre in my app. It’s in my fork of LB right now, but I still need to get a few things sorted out before doing a pull-request to original. I just did this because I needed a quick solution with artwork for my app since I switched from SAM Broadcaster Cloud to this but you can still do this if using Genre for the types in case you need some kind of solution.

So this would be my setup if I was trying to do a station like that using Smart Blocks, create a few Smart Blocks:

Sweeper 		:: Media Type Is Sweeper        ::Limit to 1 Items
Sound Bridges   :: Media Type Is Sound Bridges	::Limit to 1 Items
Promo     		:: Media Type Is Promo		    ::Limit to 1 Items

Commercials [2x]  :: Media Type Is Commercial	::Limit to 2 Items
Commercials [3x]  :: Media Type Is Commercial 	::Limit to 3 Items

Then you can decide how you want to get the songs or just mix them up when you add them to playlist.

Random Song[1x]  ::Media Type Is Music	::Limit to 1 Items
Random Song[2x]  ::Media Type Is Music	::Limit to 2 Items
Random Song[3x]  ::Media Type Is Music	::Limit to 3 Items
Random Song[5 Mins]  ::Media Type Is Music ::Limit to 5 Minutes    ::Allow Last Track to Exceed…
Random Song[10 Mins]  ::Media Type Is Music	::Limit to 10 Minutes  ::Allow Last Track to Exceed…
Random Song[15 Mins]  ::Media Type Is Music	::Limit to 15 Minutes  ::Allow Last Track to Exceed…

Create Playlist named Station ID, and set it in Settings>General>Intro Autoloading Playlist so you can add all the Station IDs and play on top of the hour.

Create another playlist: “My Random” Playlist and just start filling it with smart blocks, for example:

Random Song[10 Mins]
Commercials [3x] 
Sweeper
Random Song[10 Mins]
Sound Bridges
Random Song[2x]
Commercials [3x] 
Random Song[10 Mins]
Commercials [2x] 
Random Song[2x]
Sweeper
Random Song[1x]
Commercials [3x] 
Random Song[10 Mins]
Sound Bridges
Random Song[2x]
Commercials [3x] 
Random Song[10 Mins]
Sweeper
Random Song[2x]

If we use this playlist for an hour, just add more than an hour of smart blocks just to make sure you have no gaps since some songs could be shorter.

Now when going to Calendar (which I renamed to Schedule since I feel it’s a better term in Radio) Just create a show depending on how long you made the playlist, so if one hour, do a 1 hour show for every hour of the day. When you edit the show, like robbt mentioned, you can autoload that playlist on all shows and set it all shows to repeat on the whole week. I mean you could probably just do 1 long 24hr show and set that to repeat but you’ll be all day organizing. The way I showed you, you’ll have more control and can always schedule a live show for whatever hour. Djs can always come in and out of live broadcast they are scheduled for, and if they come out a live broadcast after just a few minutes it will just continue playing what you had in the playlist seamlessly.

Any change you can work on getting a PR from your fork opened with the main project so we could integrate the media type work. I had planned on doing something like this so it’s awesome that someone else was able to beat me to the punch.

Sure. I will do it tonight.

1 Like

This looks cool. Currently I’m using the “useless” “label/organisation” ID3 tag as a place for me to “label” things like Station ID, Jingles, etc. It means that I can ensure those tags stick with the audio files metadata. I wonder if there’s a universal place where you can store this “media_type” information with the file.

Yes, it should be out real soon, hopefully this week.

1 Like

Yeah, this will be useful, since we don’t currently store any metadata updates on the files, ie any changes are only on the database, it won’t be saving back to the ID3/metadata yet. This could be included if and when we start modifying the underlying files when you update the metadata in LibreTime - see https://github.com/LibreTime/libretime/issues/621

@robbt @kmahelona Yes, I actually have something for storing to the file using the getID3 library. just need to go back to it and make sure everything works properly before doing a PR. It will write tags onto the file including artwork when saving, acting like a ID3 tag editor. Has some benefits if sharing directory, moving files maybe to another installation, and since we have that download button I can see this being used if a remote DJ wants to download a few tracks in library to play live and keeping the same info. Maybe add an option to disable/enable the feature. You should see a PR soon.

1 Like

I’m in the process of building our own LT server, to replace our hosted AT server and have been using the ‘old LiquidSoap hack’ to ensure we never have dead air after a DJ ends their stream.

As this feature still seems incomplete, is it possible to use the old hack to the same effect, until such time as it becomes available?

@ProgzillaRadio : We use the “old” liquidsoap hack (the one used on Airtime) on our Libretime install, it works without problem and fixes the dead air problem when nothing scheduled in Libretime.

1 Like