Prism in Python - selecting options
Back to actually constructing the tracks for Prism Exhilarated, and the next thing on the menu was to generate option numbers from a given rendition number.
This routine I had already figured out well before the pact began. It works by seeing the rendition number as a bit field which is divided up into smaller bit fields based on a track's number of processes and their respective options count. Converting the divided bit fields back into decimal yields a set of numbers unique to the given rendition number, and equal to the number of processes.
Integrating that into the software was no big problem. But the routine requires range checking for its input arguments, so I decided that creating a file of config file functions would be a good idea (and allow me to encapsulate all routines based on the config file into one module).
What I needed in this case was the maximum number of renditions that an album can support, which is essentially the track in the album with the smallest number of renditions. This routine also handles default tracks (which, when enabled, reduces the option count of every process by one). I finished off the session by completing this routine, ready for future use.