Shuffle Method
In this tutorial I will show you one way to implement a much better Shuffle play mode in Scenarist
A common feature desired by music DVD clients is a shuffle playlist function; meaning that every track on the disc should be played, in a random order without any repetition. The DVD specification does define an in-built feature for this purpose, and in Scenarist this is utilised by placing all the tracks as programs within one PGC, and setting that PGC’s play-mode to ‘Shuffle’. If left to play through without interruption; this is functionally sound feature, working on almost all DVD players, and is very easy and quick to implement.
However, as soon as one tries to use Previous, Next and other navigation controls, the limitations of this method quickly become apparent. Skipping out of a currently playing program won’t register that item as played, so all those tracks which you skipped because you didn’t like, will keep coming back later on. Its also impossible to mix video with different aspect ratios, subtitle and audio attributes given that all items must be confined to one PGC.
There are other solutions to this posted online, the most commonly referred to involves using a psuedo random sequence based on prime numbers, but that’s not nice; we don’t like pseudo random, and the possible paths or ’seeds’ are limited to the number of play items we have, meaning our supposedly random sequences will keep coming back time and again.
The next evolution is to use a GRPM register as flags to represent which of our play items have changed… TBC
Scenario Overview

General Parameter Usage
GRPM0: Track index. This value will determine which track is actually played.
GRPM1: Track register A, containing bit-flags for tracks 1-16.
GRPM2: Our random choice. This is chosen as a number between 1 and the number of tracks left to play (the value in GRPM3).
GRPM3: The number of unplayed tracks. This will start at our total number of tracks, 32.
GRPM4: The ‘working register’, where our bit-flags are shifted and examined.
GRPM5: Track register B, containing bit-flags for tracks 17-32.
‘Init’ PGC Pre-Commands

‘Randomise’ Pre-Commands

‘GoToProg’ Pre-Commands

‘GoToProg’ Post-Commands

‘GoToProg’ Cell-Commands

Download a test project implementing this method, here: Randomise_Test.zip (1.15MB)