• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

Random Select from category and then play in series

Started by Tony316, January 04, 2021, 05:27:46 PM

Tony316

Hello I have a bunch of categories (or subcatoegories I don't think it matters, correct me if I am wrong) that I would like to play according to the following:
I want to set an event (or events) that randomly selects a subcategory and then plays all its contents (one per day) in asceding title order) until it finishes. Then it selects another category random and plays it again. How can I set this scehe? Any ideas?

To help you better understand what I ask for, each subcategory could be a course (e.g. Math, Physics, etc.) and I want to select a random course and then play each lesson of the course every day accoring to the date (say title is YYYY_MM_DD_...) and when all lessons are played then select a new random course.

Thank you in advance.  :)

sothdfm1

Quote from: Tony316 on January 04, 2021, 05:27:46 PM
Hello I have a bunch of categories (or subcatoegories I don't think it matters, correct me if I am wrong) that I would like to play according to the following:
I want to set an event (or events) that randomly selects a subcategory and then plays all its contents (one per day) in asceding title order) until it finishes. Then it selects another category random and plays it again. How can I set this scehe? Any ideas?

To help you better understand what I ask for, each subcategory could be a course (e.g. Math, Physics, etc.) and I want to select a random course and then play each lesson of the cour
se every day accoring to the date (say title is YYYY_MM_DD_...) and when all lessons are played then select a new random course.

Thank you in advance.  :)

Ok so I'm probably not the best person to answer this, and I'm sure smarter people here can maybe give you a better solution...   I'm assuming you don't add new "courses" often, and even if you did this still might work it will just require a little bit more work before getting it ready.
You could take the course and combine all the tracks for it in a program called "Audacity" . you might have to search up how to do that but it is possible. Then import all of the combined tracks into RadioDJ all in the same sub-cat. Make a track rotation that is the following:

Cat: The cat the track is in...
Subcat: the one the track is in...
Play by: Random.
Repeat: Leave all at "0" except for "title" which you would put (lets say) 5 minutes longer than the longest course as to not repeat twice in a row. (5 is just for good measure it doesnt mean anything) ALSO, you could set this value in Settings ->> AutoDJ, but that would apply it systemwide.

Click ok and make sure to check "repeat rules" on the rotation itself.
Let me know if you have any questions. Good Luck :cool:


sothdfm1

Quote from: sothdfm1 on January 05, 2021, 01:54:42 AM
Ok so I'm probably not the best person to answer this, and I'm sure smarter people here can maybe give you a better solution...   I'm assuming you don't add new "courses" often, and even if you did this still might work it will just require a little bit more work before getting it ready.
You could take the course and combine all the tracks for it in a program called "Audacity" . you might have to search up how to do that but it is possible. Then import all of the combined tracks into RadioDJ all in the same sub-cat. Make a track rotation that is the following:

Cat: The cat the track is in...
Subcat: the one the track is in...
Play by: Random.
Repeat: Leave all at "0" except for "title" which you would put (lets say) 5 minutes longer than the longest course as to not repeat twice in a row. (5 is just for good measure it doesnt mean anything) ALSO, you could set this value in Settings ->> AutoDJ, but that would apply it systemwide.

Click ok and make sure to check "repeat rules" on the rotation itself.
Let me know if you have any questions. Good Luck :cool:

I just realized that you might need it to be an event due to you have other stuff playing also. You could set an event like this:
=======================================
Set rotation: to the one you made with the course in it.
Clear Playlist
(then it will automatically add the course to queue #1)
Wait seconds: 500 (just to wait until whatever is playing to get out)
Clear Playlist
Set rotation: to the one you had before.
==========================================
At your selected time this will randomly play a "course" every day and then after the course, it will resume to whatever was playing before.
:P

Tony316

First of all thank you for your answer and your help. By what you said I understand the following:


  • Combine each Course's tracks into one big track (in my case mp3) that plays all the lessons of the course one after the other (so I will end up with as many mp3 files as my courses are)

  • Set a rotation to pick a random track (i.e. course) and don't repeat the title for (duration of longest track + 5min)

  • Make an event that loads the rotation clears the playlist and then starts playing the rotation

Ok until now but I don't understand how can I get to play each day only one lesson (I didn't make it very clear in my initial post that's my fault). I'm guessing your solution is to play the whole course at once, if I got it right?

Again thanks for your time. I hope we can come to a solution.  :)

sothdfm1

Quote from: Tony316 on January 05, 2021, 03:08:11 AM
First of all thank you for your answer and your help. By what you said I understand the following:


  • Combine each Course's tracks into one big track (in my case mp3) that plays all the lessons of the course one after the other (so I will end up with as many mp3 files as my courses are)

  • Set a rotation to pick a random track (i.e. course) and don't repeat the title for (duration of longest track + 5min)

  • Make an event that loads the rotation clears the playlist and then starts playing the rotation

Ok until now but I don't understand how can I get to play each day only one lesson (I didn't make it very clear in my initial post that's my fault). I'm guessing your solution is to play the whole course at once, if I got it right?

Again thanks for your time. I hope we can come to a solution.  :)

:) Thank you. This community has done so much for me, I have to give back if I can. I have had similar problems to this before...

Ok so I'm guessing you have a daily rotation (or multiple). You said you
Quotedon't understand how can I get to play each day only one lesson
This is where the event comes in. (see my last comment)

Here is how it would look for example if you wanted to play a random course (assuming you have the rotation right), in your event list.

Settings ->> Events ->> Add (+)

Look here for example: https://i.imgur.com/8Shf6eZ.png

The first red box would be the rotation with the course in it, the last red box would be your rotation that you were playing before the course OR the rotation you want to play after the course. If there is more than JUST the course in your "course" rotation than remove #4 from the event list (see the example above)

Let me know how this works, or if you have any issues. Ill check back in the morning. Good Luck to you!  :cool:

Tony316

I get the part about setting the event. I have a rotation that plays songs until an event happens (and the queue is not that big every time (around 15 songs) so I guess the wait can be less seconds).

Also just to make sure we're on the same page Courses and Lessons aren't the same thing.
Each course has say 10 lessons, hence 10 tracks. I want only one track (lesson) from each course to play one time each day.

I am making this point because the event you sent in the picture will play all the lessons (tracks) from the course in one day. I want them (the tracks) to play seaparately.

Let me give you another example:
  • Course: Physics, No of Lessons: 10
  • Course: Math, No of Lessons: 15
  • Course: Chemistry, No of Lessons: 12

So:

  • First, if Physics course is picked then for 10 days the 10 lessons will be played, one each day at the specified time.
  • Then, if Math course is picked then for 15 days the 15 lessons will be played, one each day at the specified time, etc.
Sorry for writing to many details, but I hope it helps us both better understand what I have in mind.  :)

Otherwise it's my fault (you meant courses and lessons are different).

sothdfm1

Quote from: Tony316 on January 05, 2021, 04:23:30 AM
I get the part about setting the event. I have a rotation that plays songs until an event happens (and the queue is not that big every time (around 15 songs) so I guess the wait can be less seconds).

Also just to make sure we're on the same page Courses and Lessons aren't the same thing.
Each course has say 10 lessons, hence 10 tracks. I want only one track (lesson) from each course to play one time each day.

I am making this point because the event you sent in the picture will play all the lessons (tracks) from the course in one day. I want them (the tracks) to play seaparately.

Let me give you another example:
  • Course: Physics, No of Lessons: 10
  • Course: Math, No of Lessons: 15
  • Course: Chemistry, No of Lessons: 12

So:

  • First, if Physics course is picked then for 10 days the 10 lessons will be played, one each day at the specified time.
  • Then, if Math course is picked then for 15 days the 15 lessons will be played, one each day at the specified time, etc.
Sorry for writing to many details, but I hope it helps us both better understand what I have in mind.  :)

Otherwise it's my fault (you meant courses and lessons are different).

Shoot. I guess I read wrong  :'( Sorry.
I'll try and think some more on this but for now, I'm afraid I'm not able to help you any further.
I Hope you get this figured out.

Tony316

Don't worry that's fine. I'll try and think of something and wait if anyone has a solution.

Thank you very much for your time.  :)

Tony316

@sothdfm1 in case the random subcat script doesn't work I can have all the courses (and lessons) in one subcategory and then set the track number so that the play in the way I want them to
(the important part is to set up an event that selects each day the track with next track number - this is your SQL script).

An example regarding the track number setup. Say I have:

  • Math: 10 lessons
  • Pyhsics: 12 lessons
  • Chemistry: 8 lessons

Then say I assign a unique random index to every course (in our case from 1 to 3):

  • Math: 2
  • Pyhsics: 1
  • Chemistry: 3

Then the track numbers would be:

  • Math: 13-22
  • Pyhsics: 1-12
  • Chemistry: 23-30

(Don't worry about indexing I will do it my self - just tell me if this can work). :)

sothdfm1

Quote from: Tony316 on January 06, 2021, 04:17:20 PM
@sothdfm1 in case the random subcat script doesn't work I can have all the courses (and lessons) in one subcategory and then set the track number so that the play in the way I want them to
(the important part is to set up an event that selects each day the track with next track number - this is your SQL script).

An example regarding the track number setup. Say I have:

  • Math: 10 lessons
  • Pyhsics: 12 lessons
  • Chemistry: 8 lessons

Then say I assign a unique random index to every course (in our case from 1 to 3):

  • Math: 2
  • Pyhsics: 1
  • Chemistry: 3

Then the track numbers would be:

  • Math: 13-22
  • Pyhsics: 1-12
  • Chemistry: 23-30

(Don't worry about indexing I will do it my self - just tell me if this can work). :)

This was my idea as well! I am using my test RadioDJ install to re-create your situation.
I am using Bulk Rename Utility https://www.bulkrenameutility.co.uk/ to randomly sort the course folders, and mp3tag (I think you have already) to set the track number.

A good thing about this the title of the track doesnt need to be changed, so if you are transmitting with RDS, or livestreaming with a "Now Playing" dialog, listeners wont see random numbers before the title.

The SQL script is looking promising. Sorting by track number to play the next track, not repeating the same track until all other tracks have been played, then it repeats the process (you might change the order by then, but whatever) :)

Once I test it on my system, I will share it with you  ;D, along with  step by step directions of what I did, and you can go from there!


stevewa

since you want to play all lessons in order, you don't want a rotation (which is for random order), instead you could create a playlist, which would play the tracks in order.

so consider create a playlist for a math course, and add the tracks in order to the playlist.

then you could create an SQL query, which would randomly select a playlist, and perhaps sort the list to choose from by date last played, and use Select Top1, to get only 1 playlist.

then schedule an event to run that sql query.

and if you don't want to repeat the same course on the same day, include that restriction (Criteria) in your sql quer)

Tony316

Quotethen you could create an SQL query, which would randomly select a playlist.
So this SQL script will select a playlist and play its contents (in the correct order) one each day?
And when it's done it will again choose a random playlist?

stevewa

it could be programmed to do that.
we need more info. do you use other events to schedule other programming?
or are you only broadcasting lessons?
do you plan to schedule an event to start a course once an hour, or is the length of the courses always different?

so maybe instead of using events to trigger the loading of a random playlist, you use AutoDJ to load a random playlist, and when that course lessons playlist is done, AutoDJ picks a different course lessons playlist, and it repeats forever...

events use scheduled times, like the first minute of every hour, etc. so if you cannot work with variable length content (ie each course is a different length), then the AutoDJ feature might be the best way to randomly choose a course lessons playlist.

sothdfm1

Quote from: stevewa on January 06, 2021, 05:27:43 PM
it could be programmed to do that.
we need more info. do you use other events to schedule other programming?
or are you only broadcasting lessons?
do you plan to schedule an event to start a course once an hour, or is the length of the courses always different?

so maybe instead of using events to trigger the loading of a random playlist, you use AutoDJ to load a random playlist, and when that course lessons playlist is done, AutoDJ picks a different course lessons playlist, and it repeats forever...

events use scheduled times, like the first minute of every hour, etc. so if you cannot work with variable length content (ie each course is a different length), then the AutoDJ feature might be the best way to randomly choose a course lessons playlist.

Yes but OP wants to play one track (lesson),  of each course each day at a specified time, until the course is done, then pick a new course. Which my SQL query in a rotation would do. It would select the next "Track #" (as specified with different software, mp3tag). It will not repeat any course until there are none left, then it would set the `title_played` back to default, in other words, restarting the loop until the track numbers are changed, to be a different order (which would happen every year or two I believe)

Tony316

Quotewe need more info. do you use other events to schedule other programming?
So basically I have a rotation that plays songs forever.
Whenever I want to play something else I set up an event.
It loads the track in top of queue and when the track is finished the rotation keeps playing songs (it has already loaded songs in the queue).

In my case I will have 4 different set of courses.
(don't worry about that - first I want to make it work for one set of courses and I will do the same for the other sets).

I want a specific hour of the day (different hour for each set of courses) to load a track based on the pattern I have described:
The first day load one random course then play all its tracks in order for the next days until all of the tracks are played. Then repeat this pattern.

For the example given above with indexes (https://www.radiodj.ro/community/index.php?topic=14936.msg82600#msg82600):

  • Math will play for the first 10 days
  • then Physics for the next 12 days
  • and then Chemistry for the next 8 days
  • and then start over.

This is the pattern but for many more courses.

And something else. I have an intro and an outro track that I would like to play, but I guess they can be loaded with seperate events, if that complicates the SQL script.
If it's possible it would be better to load them from the script (the intro before the lesson and the outro after the lesson (no sweppers or something else needed, just play them as seperate tracks)).