Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Autoplay Script
robHome userMember since 2022
Hi,

I realise this is not the intended purpose of VirtualDJ but it is such a great bit of software that I have been looking at how it may fit.

The idea is to autoplay a number of playlists each day using the event scheduler. The complications are that 1. some of the playlists comprise of very long mp3s and so need to be stopped, I can't just rely on it changing at the end of a song, 2. the device that is running it may be restarted at any time of the day. 3. It would be really nice if there was a fadeout of the last playlist before the new one started, rather than a hard stop.

I got close using a schedule such as this:

<?xml version="1.0" encoding="UTF-8"?>
<schedule>
<event starttime="18000" action="script" param="stop &amp; playlist_clear &amp; unload deck default " />
<event starttime="21600" endafter="53999" action="playlist" param="pathto\playlist1.m3u" />
<event starttime="54000" endtime="61198" action="playlist" param="pathto\playlist2.m3u" />
<event starttime="61199" action="script" param="stop &amp; playlist_clear &amp; unload deck default " />
<event starttime="61200" endtime="71998" action="playlist" param="pathto\playlist3.m3u" />
<event starttime="71999" action="script" param="stop &amp; playlist_clear &amp; unload deck default " />
<event starttime="72000" endtime="16200" action="playlist" param="pathto\playlist4.m3u" />
</schedule>

This allowed the schedule to be started at any time of the day but had a hard stop at the end of each playlist at a certain time. A couple of quirks, if I didn't add the seconds to each then the scheduler UI didn't show them in the correct order. Then in an update the "Repeat once finished" option was introduced which caused some problems.

So I tried using a script that had a 3 second fade out and loading and delaying playing the playlists using a script. The issue with this is if I have "Repeat once finished" checked then it simply constantly cycles on the fade out and the turning on of Automix seems very hit and miss.

<?xml version="1.0" encoding="UTF-8"?>
<schedule repeat="no">
<event starttime="18000" action="script" param="stop & playlist_clear & unload deck default " />
<event starttime="21600" action="script" param="wait 5000ms & browser_gotofolder 'pathto\playlist1.m3u' playlist_load &amp; play & automix ? nothing : automix" />
<event starttime="50400" action="script" param="repeat_start_instant & 'customfade' 30ms 101 & level & param_smaller 1% ? stop & repeat_stop 'customfade' & wait 100ms & level 100% : level -1% & playlist_clear & unload deck default" />
<event starttime="50400" action="script" param="wait 5000ms & browser_gotofolder 'pathto\playlist2.m3u' & playlist_load & play & automix ? nothing : automix" />
<event starttime="64800" action="script" param="repeat_start_instant 'customfade' 30ms 101 & level & param_smaller 1% ? stop & repeat_stop 'customfade' & wait 100ms & level 100% : level -1% & playlist_clear & unload deck default" />
<event starttime="64800" action="script" param="wait 5000ms & browser_gotofolder 'pathto\playlist3.m3u' & playlist_load & play & automix ? nothing : automix" />
<event starttime="72000" action="script" param="repeat_start_instant &apos;customfade&apos; 30ms 101 & level & param_smaller 1% ? stop & repeat_stop 'customfade' & wait 100ms & level 100% : level -1% & playlist_clear & unload deck default" />
<event starttime="72000" action="script" param="wait 5000ms & browser_gotofolder 'pathto\playlist4.m3u' & playlist_load & play & automix ? nothing : automix" />
</schedule>

Many thanks to those on the forums already - you may recognise parts of your scripts above.

Any pointers would be gratefully received!

 

Posted Tue 21 Nov 23 @ 9:34 am
How does playthrough work, I mean so it doesn't stop after each song.
am completely new here, thanks in advance.

Hoe werkt doorspelen?
Ik bedoel dat hij niet stopt na elk liedje.
Ben helemaal nieuw hier.
Alvast bedankt.
 

Posted Tue 21 Nov 23 @ 4:02 pm
With the help of chatgpt I have managed to create a workaround for making playlists from specific folders and make sure the tracks are not played in a to set number of days. I use a python script for it what at 23:59 spits out 24 m3u lists, with random songs and a jingle on top of the list chosen random from the jingle directory. It makes use of the history m3u lists, where the titles of the files are also the dates of the played tracks on that day, it reads from the history m3u lists the files wich will be exlcuded, and then puts on 24 playlists with random tracks. In my case they will not have been played for today and yesterday, but that is adjustable, as well as the number of playlists to generate. To activate the python scripts I make use of the windows task scheduler, wich launches the python file. It takes only a few seconds to generate them and in this way you can put the newly made playlists in the scheduler of virtualdj.

you only need to install python on your computer, it is free, so no costs

it gives some more room for kind of a clockwheel rotation...

I hope somebody finds it useful. Just ask me if you want to know more.

greetz Frank


you may think what has this to do with my question, but i'm a total noob on scripting and with help of chatgpt i managed this and it had a lot more to offer for me making scripts for the vdj scheduler

and maybe in your case it is a lot less work for about ten songs to open them in audacity and then cut of the part you want to leave out and then put a fade on it on the last seconds of the remained part and export them as a short-cut-version...
 

Posted 24 hours ago