News:

LATEST RELEASE:  FPP 8.4 - Download from here - https://github.com/FalconChristmas/fpp/releases/tag/8.4

+-+-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Site Stats

Members
Total Members: 16874
Latest: pitzav
New This Month: 13
New This Week: 2
New Today: 1
Stats
Total Posts: 135405
Total Topics: 16970
Most Online Today: 113
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 1
Guests: 63
Total: 64

FPP - Select random sequence(s) from a playlist

Started by robbiet, December 12, 2019, 06:55:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

robbiet

I have a playlist with several sequences...more than I want to play continuously. Is there a way to have FPP randomly choose a single sequence randomly to play?

If not, could an option be added to choose a limited amount of items rather than just playing the entire playlist?  Maybe that would be an added field on the playlist within a playlist drop down screen.

Something like this?

Type: Playlist
Plugin Data: 2019_Sequences
Items To Play: 3
Random Order: Yes




Sent from my iPhone using Tapatalk

CaptainMurdoch

There is no built in method, but since this request comes up pretty often, I put together a script to support this type of functionality using the 'Dynamic' Playlist Entry type.

If you want to try it, try the following:

- Save the attached file as a script called ShufflePlaylist.sh and upload it to your FPP instance.
- Create individual playlists for each song that you want to shuffle.  These can actually include more than just the song if you want to scroll a message or something before playing the song.
- Create a playlist called "PlaylistToShuffle" and add each of the individual playlists to this playlist.
- In the main section of your main scheduled playlist, run the ShufflePlaylist.sh script with the 'wait for completion' checkbox checked.  Below that, add a 'Dynamic' -> 'File' entry with a filename of "/tmp/PlaylistToPlay"
- Play the main playlist.

Basically, the script reads the PlaylistToShuffle playlist and gets the name of all the sub playlists.  It shuffles those names an saves them to a temp queue file.  This file is rebuilt if it does not exist or gets down to 1 line with a little duplicate detection to make sure we don't play the same song twice in a row.  When the script runs, it creates a file containing the playlist for the next song to play.  This is then picked up by the Dynamic playlist entry and played.  On the next loop through the main playlist section, the script runs again, updates the temp file, which is again picked up by the Dynamic playlist entry and played.

If this works, I can put the instructions into the script and upload it to the FPP Script Repository.
-
Chris

robbiet

Thanks Captain!  I'll give it a try tonight. 

Do you think it would make sense to add as a built in feature though (without a plugin)?  It seems like there would be a common need to be able to pick a random playlist from a large playlist of sequences, especially now that folks are starting to build a pretty large library of sequences. Future enhancement? 

That said, I'm happy to leverage the plugin and appreciate your work putting this together.


Sent from my iPhone using Tapatalk

dkulp

Probably could just be a checkbox added to the "Insert playlist after current" FPP command.  When the playlist is inserted, it randomizes the entries in the main section.
Daniel Kulp - https://kulplights.com

CaptainMurdoch

Quote from: dkulp on December 12, 2019, 08:49:31 AMProbably could just be a checkbox added to the "Insert playlist after current" FPP command.  When the playlist is inserted, it randomizes the entries in the main section.

That could work.  We probably would want a way to prevent the same song playing at the end of one cycle and beginning of the next although the odds are low, it did happen several times when I tested the script before adding the logic to gather then next list when the current queue got down to 1 entry.
-
Chris

robbiet

Ok. I think I have everything set up as you have said but it is not working. When I play the main playlist, it quickly passes through both the script and dynamic entry. The next song in my playlist then starts. See screenshot.




Sent from my iPhone using Tapatalk

robbiet

Never mind. I had a typo in my playlist name. Working now. Thanks!


Sent from my iPhone using Tapatalk

CaptainMurdoch

Quote from: robbiet on December 12, 2019, 09:29:29 PMNever mind. I had a typo in my playlist name. Working now. Thanks!

Great, glad it's working for you.  Thanks for reporting back.
-
Chris

K-State Fan

Thanks for adding this.  I am going to try it this weekend.

allknowing2012

I created a script / cron job that I run daily. It takes in my entire list of songs "All_Songs" playlist and generates a new play list "RandomPlayList" and then I have that one scheduled to play each night. 90 songs ... never the same play list :-)
(I also have it set to keep the intro and outro portions intact).

robbiet

It's been a while and FPP has had a bunch of changes to playlist functionality. I just wanted to see if the approach of using a script Is still the best way or is there something built in now?

To recap... I want to have a playlist that will pick a random sample from a list of sequences. In my case, I have a list of about 30 sequences and I want to pick 5 songs randomly to play for my show.


Sent from my iPhone using Tapatalk

Support FPP

+- Recent Topics

K2-Pi-Servo by breese
Today at 01:50:52 PM

K32 only the pixels stopped outputting by AAH
February 10, 2025, 11:45:33 PM

Scoreboard Plugin by CaptainMurdoch
February 06, 2025, 04:34:30 PM

Power failure wreaked havoc by perigalacticon
February 05, 2025, 04:04:27 AM

What is the fanout capabilities of ws2811 controllers? by k6ccc
February 04, 2025, 05:53:10 PM

SPixels broken in version 6 and upwards by dkulp
February 04, 2025, 02:52:30 PM

FPP stopped working by crookedpriority
February 03, 2025, 10:45:17 AM

Setting up a wired on demand show on Pi/ FPP to push a show to Falcon Controller by breese
February 03, 2025, 04:54:44 AM

F16V4 Expansion Board Half of the board stop lighting up. by onlineshopper
February 03, 2025, 03:08:47 AM

Overlay Matrix: write more than one pixel at a time ? by niemy
February 02, 2025, 03:35:16 PM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod