Random Function omitting certain numbers

I just had a look at the DF Player, and it just might be a better option than the DY because I could swap out the SD Card for different sound themes.

I will still use the numbering system for the files, so they can be easily referenced by the code, but appreciate that the files just need to be in physical order on the SD Card.

seemed that you had playing the audio files figured. It was the other parts of the code that you needed help with

Yes, that’s right. Initially to be able to exclude certain numbers from the random function, which has now been answered. Following on from that, my original code needed tidying up, and you have kindly provided a solution. I will try at the weekend to see if I can omit the lookup table array by referencing the audio files directly by their number after comparing with the braille input byte.

Not strictly correct. The DFR module addresses a file based on the time it was added to the card. Of course, users would normally ensure this matched their apparent order as seen in File Explorer or whatever. But it’s not a given, and could lead to unexpected behaviour if this distinction is misunderstood.

I number sequence name my audio files as 00001.mp3 etc. then use the utility DriveSort to sort the directory table, and it seems to have worked so far, especially when re-recording certain tracks. See DriveSort for more information.

That feels misleading, the actual time does not matter or does but indirectly, what matters is the index of the file in the file system table of the SD card. ( so if you add later’ indeed it has a further index,)

As most OS copy things in alphabetical order when you do a group copy (copy your 100 songs from your PC to the SD card) that’s why having the naming convention 0001.mp3 0002.mp3 etc works

Yes, I probably over-simplified with that single word 'time'. With care, unexpected results can be avoided. Especially when editing a playlist, either directly on the card or externally on the computer.

Here's a relevant summary from the tool used by @roblund

"Recent operating systems sort the files before showing them to the user, either by name, by size or by whatever the user choose. However, it is not always the case in embedded OSes on small portable devices like MP3 players. On these devices the lack of resources (CPU, memory) can lead their developers to make it display or play the files in the order in which they are on the disk.

This order depends mostly of the order in which they were added to the disk, which is not convenient for the user. DriveSort can change this order to help such devices to play or view their files in the order you want, by putting them on the disk in a customizable order."