Final post (got through this faster than I thought)...
*** HOW THE RADIO FUNCTIONS ***
Turn on the radio: When turning on the radio, the Arduino boots up instantly. It starts playing a specific MP3 file on the microSD card that has the sound of an old tube radio powering up with the familiar fading in tube hum and static.
Radio Begins Playing Music: After the tube hum MP3 ends, it immediately plays a random MP3 from the last station it was in (it remembers). Stations are made up of 21 folders of music. Each folder has a different genre of music and has anywhere from 150 to 250 (max I can have per folder) MP3 files. Each folder/station has a different genre of music. All the MP3 files were acquired from the Internet Archive, which hosts thousands of 1940s songs, V-Discs, Broadcasts, Shows, etc.
For example, folder '01' has big band music. '02' has complete news broadcasts from 1940 through 1945, some can be 2-3 hours long per broadcast. '03' is 1940s instrumental/symphony tracks. '04' has Armed Forces Radio complete programs from 1941 through 1945. '05' has entire comedy hour shows from the 1940s of the Abbott and Costello Show, Jack Benny Show, George and Gracie, etc.
Here's a look at the folder structure. The 99 folder holds the system MP3 files, like the start-up tube hum. Folders 97 and 98 hold special MP3s I'll explain in a few:
There are 21 folders/stations I can choose from. It amounts to years' worth of music/programs/broadcasts. Each time the radio is started, it shuffles the MP3s in that station's folder, so I don't start the radio with the same song/program every time. When I change stations, it shuffles the next folder's MP3 tracks, so it randomly will start a song.
Turn the volume: When turning the volume up or down, it will either lower to the point it effectively 'mutes' the audio, or turn it up to a pre-set maximum level I set so I don't blow the speaker. It's mighty loud, and I can't imagine getting close to the max level I set.
Push the preset station button: This acts as a 'next track' button. It will simply play the next MP3 track on the shuffled playlist for that station.
Turn the station changer dial: This one is a lot of fun. At first, I was just going to have it be where when you turn the dial, it would go to the next station folder, randomize the MP3s, and start playing. But I decided to make it more real. So when you turn the dial, it plays a specific MP3 file that has the sound of quickly switching through different radio stations on an old radio. It loops this sound until you stop turning the dial, at which point it then moves to the next station folder, shuffles the MP3s, and starts playing (all done in milliseconds). If you turn the dial forward, it moves forward to the next station folder. If you turn the dial back, it moves back to the previous station folder.
What happens when it runs out of tracks to play in that station folder? I doubt that will happen since there are hours/days of music in each station folder, but if it does, it simply just instantly goes to the next station folder on the list, randomizes the MP3s, and starts playing.
But we're not done yet...
So, everything works really well, and I have basically a custom MP3 player that acts like real radio stations. But I felt I could go further and make it even more real. What if I added:
commercials?
So, I went online and found a free repository of 1940s radio commercials. I built into the programming an internal counter. When the radio is turned on or when it goes to a new station folder, it starts to count how many tracks are played. It will randomly select a number between 3 and 5 (or 1 to 2 for longer full-hour broadcast stations), and it will then randomly select an also random number of 1940s commercials (between 2 and 3 commercials each 'commercial break'). After that, the counter starts over, and it will play more tracks before doing another set of commercials after the random number of tracks.
This gives each station a more radio feel rather than just music or broadcasts. There are 250 radio advertisements it can pull from.
Almost done...
Now that everything was working, I thought I was all done till I had another idea:
station jingles.
I thought, what if I were to make a bunch of fictional station jingles that could play randomly between tracks at times. So, I enlisted some help and made 63 different 'WFORD' and 'KFORD' jingles. The jingles are simple, with some 1940s-style music with bouncy harmonies like 'You're listening to K-F-O-R-D AM!'. Obviously, the station name is a play on the fact that it's a Ford car.
If you want to listen to a jingle, here's a short one -
MP3 FILE (clicking this will immediatly play in your browser)
So, there you have it... this long, long story complete! I'm going to be filming a YouTube video showing the radio in action soon, which I'll post once I get that done.
It was a lot of work, but a lot of fun to come up with and put together. And gave me the idea to start on the currently ongoing 1940 Ford Battery case with the 3D printer I had bought. If you've managed to read the entire thing, kudos and thanks to you!