Traktor Metadata Harvester

In the Web2.0-era there are some DJs who wish to be able to "publish" their playlists live. I got somewhat inspired by Richie Hawthin's Twitter DJ - as well as Alexander Zigelski's Traktor Scrobbler. Both of which are fine programs and no mistake...

It just escapes me that both of those programs require Icecast to do their magic... Because of this, I decided to write a tool of my own. It took me a couple of hours to fix the thing together since I haven't actually coded anything in Delphi for quite a long while and I had to learn actually the basics of IceCast-protocol as well as some details of OGG-format's tagging to make this thing work.

The current implementation might still contain some bugs, so use it at your own risk. I've taken every possible precaution, but I refuse to take responsibility if this application makes your computer become sentient and start a war on humanity.

[ v0.4 STABLE ]

N.B.: While this version still fully works in theory, unfortunately Twitter has changed their API way back in 2010 and disabled the use of username/password -authentication for third party apps which basically neutered the application's #1 use case; tweeting the currently playing track.

While there are other use cases, taking advantage of them with this version is quite difficult and cumbersome. If You're interested in using the application for visualization or e.g. OBS, have a look at the newer v0.5 BETA instead...

Also … it will be IMPOSSIBLE to run the Metadata Harvester v0.4 in Mac OS X running later version than High Sierra (10.13.x) due to the limitations placed by the operating system itself. Unfortunately there is nothing we, the developers, can do about that - it is just what Apple allows. If You're running Mojave (10.14.x) or later, please check out v0.5 BETA instead.

Similarly … the 32-bit Linux -build is only compatible with Kernel releases (older than or equal to) 2.6.x.y & 3.x.y … and - because Linux-users are a bit of a niche audience altogether for Traktor Metadata Listener/Harvester anyways, we will not be building further versions of Harvester for Linux. Sorry :(

How-to start

Download the package (the package contains compiled versions of the application for Windows, Mac OS X and Linux platforms) unzip it and start the executable from the command line (on Windows, search for CMD) / terminal.

By default the application binds itself (listens) using port 8080, but you can change this by starting the application from the command line using an argument like metadata --port=9000 (in case you want to run it on port 9000 instead - of course, you can use any port in the range of 1-65536 that happens to be available on your machine). Note that on Traktor you don't need to set up anything other than the address and port for this to work... after all, it's not like this is IceCast or something. :-)

Since we are only interested in the metadata of the stream, you can set the "Server Settings / Format" as low as possible. Currently Traktor's lowest setting is "Ogg Vorbis, 11025 Hz, 32 kBit/s".

N.B.: As of August 31, 2010 … nothing mentioned below regarding v0.4 STABLE no longer applies. The reason for this is that Twitter have changed their API in such fashion that username/password -authentication simply does not work anymore.

The app does still write everything in one way or another You see (in the Terminal window) into the logfile metadata.log and … this file can be "followed" and "parsed" for the latest artist / song -names … but - on my humble opinion - that is literally not the bet way of using CPU time :D

How to make it actually "tweet"?

Now this is the easy part (as if the setup so far has been mindbendingly hard)... In Traktor, you write your Twitter username and password into the "Server Settings / Password"-field separated with a colon ":" ... so, if your username is "username" and your password is something similarly wild like "password", you should write "username:password" into the field (without the quotation marks, obviously). And that's it... you're tweeting away as soon as you "connect" to the metadata listener.

I don't like the default tweet-message

Well, you can change it. This can be done - once again - on Traktor's Preferences. You can write your customised message to the "Metadata Settings / Stream Description"-field. For example, if you want the message to be "is playing xxx - yyy loud and clear", you write "is playing %TRACK loud and clear" into the field. Simple, yes? You just need to remember that Twitter only allows a maximum of 160 bytes - other than that, the world's your oyster.

[ v0.5 BETA ]

How-to start

Download the package (the package contains compiled versions of the application for Windows as well as Mac OS (for Mac OS, both 32-bit and 64-bit versions are included in the package) platforms ... Linux is no longer supported) unzip it and start the executable from the command line (on Windows, search for CMD) / terminal.

By default the application binds itself (listens) using port 8080, but you can change this by starting the application from the command line using an argument like metadata --port=9000 (in case you want to run it on port 9000 instead - of course, you can use any port in the range of 1-65536 that happens to be available on your machine). Note that on Traktor you don't need to set up anything other than the address and port for this to work... after all, it's not like this is IceCast or something. :-)

N.B.: If You're using one of the recent versions of Mac OS like Mojave (10.14.x), Catalina (10.15.x), Big Sur (11.x.x) or anything later than the ones mentioned, the operating system might prompt You that it doesn't allow You to start this application since it has not been signed.

I personally think that it is great that Apple protects the users this way, but - since becoming an "Identified Developer" costs money on a yearly subscription … this isn't truly a viable option for freeware project developers such as myself … sorry for all the Apple users out there for this unnecessary step :( … Also, this is the reason I so far haven't built a native M1/ARM64 -version of the application - since all native M1/ARM64 -code must be signed, no matter what.

However … If this happens, You need to enable access for the application through "System Preferences / Security & Privacy / General" by clicking the "Allow Anyway"-button next to the explanation text "metadata-osx??" was blocked from use because it is not from an identified developer.

Anyways, once we've gotten the software started…

When the application starts (and successfully binds to a port), it will open Your default browser with address like http://127.0.0.1:<PORT>/ … this is the default visualizer Web UI, which can be used to initially verify that the application is working properly. On Your browser, You should see a page with the Harvester logo on the top and "a kinda turntable-platter looking thing" at the bottom. If this is the case, continue with checking that the application is working … however, if this isn't the case, something is wrong.

If You see the Harvester-logo, but not the platter … try reloading the page (might need to do that a few times) … sometimes the API doesn't load in time and that's the reason why things don't work properly all the time. This is a known issue that will be fixed later.

If You don't see the Harvester-logo (or anything else), something is "very wrong" and I suggest starting from the beginning … if the server is running on the terminal, You can use CTRL+C to stop it. The log printed on the terminal might give some hints about what is the problem.

How do I check that the application is working?

In Traktor (this has been tested with various versions of T2 & T3 - however, this should work just the same even with the "ancient" T1-versions) … You need to set the "Broadcasting" -settings according to the provided picture.

Unlike with the v0.4, You should not set anything in the "Server Settings / Password" -field; with v0.5, that is no longer used for anything.

Since we are only interested in the metadata of the stream, you can set the "Server Settings / Format" as low as possible. Currently Traktor's lowest setting is "Ogg Vorbis, 11025 Hz, 32 kBit/s".

After You've modified the settings (and the server is still running in the Terminal) … in Traktor, You should start "Broadcasting"; in Your "Global Section" of the main UI, You normally have the FX controls on both sides of the "Master"-controls (Snap/Quant/EXT, Auto/Master, Limiter, etc. in the middle) i.e.; FX1 on the left and FX2 on the right. Instead of FX2 on the right, there You need to switch to the "Audio Recorder"-pane by pressing the button below the "FX" that looks not entirely unlike a "cassette deck"-symbol.

In the "Audio Recorder"-pane, there are two buttons to the left of the rotary dial; the bottom is used to start internal recording and the top one is to start broadcasting.

Pressing the top one, it should light solid cyan. If it starts blinking instead, either Your configuration in "Preferences / Broadcasting / Server Settings" is incorrect or the application is not working properly.

Traktor is broadcasting with solid cyan … what now?

Now You should play something … open the channel in such position that the audio is coming through. When the song has been playing about 10 seconds (this is the time at when Traktor considers the song is "on air") … You should see the Web UI spring to life and display the playing song's artist & song name in Your browser.

N.B.: Traktor only ever sends the artist/song -metadata once after the track has been loaded and that track is initially considered to be "on air". If You return to Your previous track, its metadata will not be sent again … nor will the next track's metadata be sent again when you finally decide to mix it in (if it has already been sent).

Alright, I see the track information in the Web UI … What next?

Well … Now You're ready to take the next big step - and this is going to be a leap :p

You see … the Metadata Harvester is not supposed to do much by itself - it only "harvests" the metadata from the stream and provides an API for You to peruse.

There are various code examples at Github that literally show some simple examples of using the API (including the code for the default Web UI) … but … now it's all up to You to make the best use of that API and create something beautiful ;)

What about the future? New features, perhaps?

Currently the application does pretty much everything I originally wanted it to do. Of course, in case I do bring up new versions of the application, the users are the first to know (since the application checks online for new versions when started). So - who knows? Maybe I will extend the features further... Of course, with all the "busyness" (not "business", mind You, i.e. "being busy with a million things"), I wouldn't be holding my breath - it might take a while.

Bug reports, questions, ideas:

In case you do find bugs, have questions or ideas you would like to share, just throw me a few lines at markku.uttula@disconova.com ... and do subscribe to my twitter feed :) (granted, I don't have too many gigs where I have network access, but every now and then I might just "go live") ... or you could check out my fan page in facebook - of course, currently not too much is going on in there either. :D

[Screenshot of Metadata Listener user interface]
[Screenshot of Traktor's preferences]