The MusicTicker Substitutions File Documentation By Atul Varma, 1999 varmaa@kenyon.edu ABOUT THE MUSICTICKER SUBSTITUTIONS FILE ---------------------------------------- The mt_subs.inf file, located in the same directory as the gen_mticker.dll and plugin.ini files, stores a list of track-name substitutions for MusicTicker. It can be used for a variety of purposes. Basically, it consists of lines of text written with the following syntax: MATCH|REPLACE Where MATCH is the name of the string you want to replace with the REPLACE string. This is just like the find/replace command in a lot of word processors and file editors, but with the limitation that MusicTicker only searches for the MATCH string at the beginning of a track name, not in the middle or at the end of it. For example, the entry Hello|Bye bye would change the string "Hello world" to "Bye bye world", but it would NOT change the string "Good Morning and Hello" to "Good Morning and Bye bye". Also note that the MATCH string is not case sensitive, so "Hello world", "hello world", and "HELLO world" would be changed to "Bye bye world". When MusicTicker initializes itself, it loads the list of substitutions in mt_subs.inf; whenever it exports anything to HTML, it runs all of the displayed songs through this substitution list. An example would probably be the easiest way to show what can be done with this. Here's the most basic case. Suppose you're streaming songs by a band called 'The John Spencer Blues Explosion', but your mp3's don't have any ID3 tags, and in the interest of having short file names, each song name by that band starts with "JSBE". So your mp3's by them are named "JSBE-Great Song.mp3", "JSBE-Another Great Song.mp3", and so on. But when you put your station up on SHOUTcast and use MusicTicker, you want MusicTicker's HTML output to say "The John Spencer Blues Explosion" instead of "JSBE". The solution is to put the line JSBE|The John Spencer Blues Explosion in your mt_subs.inf file. Then whenever MusicTicker finds a song that starts with "JSBE", it will replace that "JSBE" with "John Spencer Blues Explosion". As a result, instead of saying that the currently playing track is "JSBE-Great Song", it will say "John Spencer Blues Explosion-Great Song". Get it? Well, that's kinda useful, but most people do use ID3 tags so it doesn't really do a whole lot. But there are MANY other uses for this feature! Because MusicTicker outputs to HTML, you can put whatever HTML code you want in the replacement string. This includes hyperlinks, images, sounds, and even forms and Java applets, and whatever else can be put into an HTML page--it's all up to your imagination. Suppose you run a SHOUTcast server that plays music by a lot of bands that aren't very well known. Or, suppose that you're playing music and you've got the URL's of some really nice homepages of some of the bands you showcase. Try putting something like this in your substitutions file: Sloan|Sloan This would replace any tracks that started with "Sloan" with the hyperlinked version of "Sloan". That way, when someone is looking at MusicTicker's HTML file to see what's playing on your SHOUTcast server, they can click on the word "Sloan" and it'll take them to the URL http://greatbandhomepage.com. Or, if there's a new song you just put in rotation, you can do something like: Ash - Girl From Mars|Ash - Girl From Mars Assuming new.gif is a GIF file that contains a little icon that says "NEW!" or something, it'll put that little icon next to the song name whenever it's displayed. Or you can combine hyperlinks with images and do something like: Lush - Undertow|Lush - Undertow (that should all be put on ONE line in your substitutions file, even though it may have appeared on two lines in this document!) That extremely long URL leads to a page on CDNOW.COM for ordering the Lush album that the song "Undertow" is on, and the GIF is a little picture that has a CDNOW logo, so if the user clicks on the CDNOW logo, they'll be taken straight to a page where they can order the album that the song's on. If you really want to get into it, you could even put an image tag at the beginning of the the replacement string that has a thumbnail pic of the album's cover or something. There's a lot more you can do with music than just play it--be creative and let your listeners have the opportunity to know more about what it is they're listening to! ADVANCED FEATURES ----------------- You can use a few special tokens to insert special information into the replacement string. Right now there are only a few: %a -- Inserts the string "TARGET="mticker_link"" (without the outermost quotes) into the replacement string at that point. This is useful for when you want an anchor to open a new window for the link instead of replacing the HTML status page. So Sloan|Sloan Would open a new browser window with the location http://greatbandhomepage.com displayed in it. %t -- This will insert the name of the entire track. This token was added primarily as an ease-of-use feature. For instance, one of the example substitutions I used earlier was: Ash - Girl From Mars|Ash - Girl From Mars With the use of the %t token, this could be shortened to: Ash - Girl From Mars|%t And it would have the exact same effect as the one before it, assuming the name of the entire song was "Ash - Girl From Mars". If it was "Ash - Girl From Mars is Dumb", then the first substitution string would result in "Ash - Girl From Mars is Dumb" and the second one would result in "Ash - Girl From Mars is Dumb ". %% -- This will just insert a single % character. Another advanced feature is the use of the asterisk (*) character. You can use this in the match string to specify that you want the replacement string to replace the name of the ENTIRE track, not just of the part that is matched. For instance, take the following line: scpromo*|SHOUTcast advertisement This would replace anything that began with "scpromo" to be the text "SHOUTcast advertisement", hyperlinked to the SHOUTcast website. Thus the tracks "scpromo-milk.mp3", "scpromo-dotcom.mp3", and "scpromo-shoutcastradio1.mp3" would all be entirely replaced with the hyperlinked "SHOUTcast advertisement" string. Also, starting any line with a semicolon (;) will make MusicTicker skip the line, so it's basically used for commenting the substitutions file. HOW TO SEE WHAT ALL THE REPLACED TRACK NAMES WILL LOOK LIKE IN HTML ------------------------------------------------------------------- You might be wondering how you're supposed to see what all these replaced track names will look like in MusicTicker's output HTML file, without having to manually run through each song. This is actually very easy--just put all the tracks you want to see replaced in your Winamp playlist, and export the playlist to HTML by going to the MusicTicker configuration dialog box and clicking on "Export Playlist to HTML..." That should show you what all the replaced tracks will look like when they're shown on your MusicTicker status page. Well, that's about it. Have fun with it; I hope this feature helps the music world prosper. HOW TO RELOAD THE SUBSTITUTIONS FILE ------------------------------------ If you make modifications to mt_subs.inf, don't worry about reloading it--that's done automatically. Every time MusicTicker outputs to HTML, it checks to see if mt_subs.inf has been modified since it was last loaded, and it is reloaded if necessary.