Crystal FM: A radio-like music provider for Discord

Overview

Crystal FM logo

I've developed a love for music ranging across different eras, and alongside that a love to share music with people. With that in mind, it's only natural that I built Crystal FM, a radio-like music provider for Discord, an online messaging & voice service. Rather than serving on-demand song requests like many other Discord-based music services, Crystal FM simply offered easy access to a steady stream of cherry-picked songs.

The songs Crystal FM played primarily consisted of pop & rock music released between the 1960s and 1990s, which was complemented with a wide range of unique instrumental tracks. They could've been songs I'd heard in movies, on the radio, or anywhere else where music happened to be playing.

Crystal FM was online for about a year, after which I didn't find it practical to keep the service running on the old desktop PC it had been on. The bot was primarily used within a group of online friends when we would regularly listen to music together.


History

At first, Crystal FM existed under the name Wave24R, short for Wave24 Radio, while 24 was referencing the 24/7 music playback on offer.

The first version of the bot was accompanied by a separate program titled Pre70sR (or Pre-1970s Radio - creative...!). This version of the bot played many of the older tracks that I didn't feel would fit together with what Wave had, which at the time was very much 80s and beyond. By separating the two services, Wave24 Radio could continue without mixing in too many distinct eras, which I felt would have resulted in an fairly inconsistent listening experience.


Development

'Wave24R (rewrite #2)'

Three iterations of the code powering Crystal FM have been and gone:

  1. Wave24R Discord Bot
  2. This version of Wave24R is a modular Discord bot made to represent different "brands" of music bot (such as Crystal FM), built on the idea that I could easily swap out playlists and simply rebrand bots to fit different themes.

  3. Wave24R Icecast Server
  4. This version of Wave24R was intended for use as an internet radio station. It created an audio livestream to broadcast the music to any client. This worked in parallel with a simple Discord bot I built to listen to the stream (amongst other internet radio stations) in any Discord voice channel.
    To use it, you simply connected to a voice channel and sent a chat command specifying which station you wanted to listen to.

  5. Crystal FM based on "S.A.F.E."
  6. This was the final rewrite of Crystal FM. It used a silly idea I came up with called "S.A.F.E." I can't really remember what the acronym stood for, but S.A.F.E. was my template launcher of sorts for a few of my future JavaScript programs and handled the configuration files, offered localization support and other repetitive tasks. It was my equivalent of a game engine for my JS programs. It didn't really stick.


Technical & Epilogue

Crystal FM was written in JavaScript and ran with the server-side runtime environment Node.js.
I hosted Crystal FM on a Dell OptiPlex 780 desktop computer for about a year, after which it was no longer practical to keep running.

If I were to reboot it again (or work on something similar), I would consider adding some features I had planned but never implemented. One idea was a song rating system which would lower or increase the probability of a song playing depending on how current listeners have rated it. This would serve as a sort of global voting system that tries compromises for all listeners in a given voice channel. Other ideas I had planned included the automatic handling of seasonal music during Halloween and Christmas periods.

In the end, while I may be biased, I think Crystal FM was good while it lasted. A lot of great music was enjoyed using it, and I consider that a big success.