I like listening to music while playing games, and I mostly play games that use the Quake engines, so yesterday while I was messing around with skins and things with Audacious I decided to set it up so that I could have a bind in Tremulous that would say the name of the song I’m currently listening to. I got the idea from all the the IRC and Pidgin plugins that say your currently playing song.
Here’s what I used to do it:
- Audacious – SVN and packages for most Linux and BSD distributions
- Song Change plugin – packaged with Audacious
- Tremulous – SVN and packages/installers for almost any Operating System
First, download and install Audacious, or any other media player you like that lets you execute a command on song change. Then you need to enable the Song Change plugin, so start up Audacious and press Ctrl+P to open the Preferences, select “Plugins” on the left column, and then go to the “General” tab. In the plugin list look for the “Song Change” plugin and enable it by checking the box next to it. In the left column you now have a “Song Change” option, select it. Under command it says “Command to run when Audacious starts a new song.” and there’s a text box under it, this is where we put the command that Audacious will use to print to our game config file. My Tremulous base directory is located at “/home/tinman/.tremulous/base/” and I have a directory in there named “configs” that I keep my .cfg files in to keep things organized. For my command I put this:
echo “say /me ^2is listening to ^5%s” > /home/tinman/.tremulous/base/configs/song.cfg
- echo – used to echo the text to a file
- say – the command to say something ingame
- /me – the command to say something as an action, in Tremulous many servers are running a patch that lets it be used like it is in IRC
- ^2 – sets the following text colour to green
- ^5 – sets the following text colour to cyan
- %s – an Audacious format string that is substituted for the song name, %n also does this
- > – tells echo to send the echoed text to a file
- /home/tinman/.tremulous/base/configs/song.cfg – the location of the text/cfg file that the text is going to
Now we have Audacious echoing a saying with the currently playing song in it to a .cfg file that Tremulous can execute, but you may want to bind it to a key in your Tremulous config. Tremulous will execute a file named “autoexec.cfg” if it finds it in the “base” directory. An edited version of mine is available here: autoexec.cfg. In it I have the song configuration file bound to my keypad’s enter key with:
bind KP_ENTER “exec configs/song.cfg”
- bind – sets a command to be executed when a key is pressed
- KP_ENTER – is the name of the keypad enter key in the Quake 3 engine
- “exec configs/song.cfg” – executes our song.cfg, which runs the command within it
Mine is in the format of “Artist – Title”, you can change the title format of it in Audacious by selecting “Playlist” on the left column and then messing with the “Song Display” options.
— Edit —
Many Tremulous players play on Mac and use iTunes as their main media player so I messed around with AppleScript for a while on my MacBook and came up with an AppleScript that can be found here: tremsong.scpt
— Edit —
Install the Now Playing plugin and then start Winamp, press Ctrl+P to get to the Preferences. In the left column select “General Purpose” under Plug-ins. Select the Now Playing plugin from the General Purpose plugin list and click the button to configure it. A window titled “Config” should have opened, select the “General Options” tab and check the “Enabled” box, then change the “Song history” to 1 song. We want the config file saved locally, so go to the “Local Save” tab and check “Local Save Enabled”. Make sure you have a “configs” directory and then set the path to the path of your configs directory, I used
If you’re using a TJW backport binary then you may want to set it to your user’s Tremulous directory, which is
C:\Documents and Settings\<username>\Application Data\Tremulous\base\configs\
where <username> is your user’s name. Change the “Html-filename” to “song.cfg“. Now select the “Html Settings” tab and check “Use template” in the right column. The default template is “template.html”, that’s the default template and is full of HTML so you need to modify it. Click the “Apply” button and leave the “Config” window.
Open up an explorer window, Winlogo+E, and then navigate to your Winamp install directory, by default it’s
The Now Playing plugin should have created a folder titled “np_templates”, open that up. The “template.html” file that Now Playing uses is in here, right click and open it with Notepad. Delete all the text from it and then paste the following text into it and save the file:
say /me ^2is listening to ^5[np:Artist1] – [np:Title1]
By default it updates the song every 5 seconds.
Note: Do not create the song.cfg file, the Now Playing plugin will create it for you.
Have fun, but don’t spam it! 😛