The analysis file holds the parts of the song, its drops and its kick, snare and hi-hat pulses. With it, the lights and effects follow the real song, measured the same way as the included track. Without it, the song still plays, but its light show follows a generic pattern.
The track meter ships with the resource:
road-unicorn/tools/track-meter.html. It runs in Chrome, Edge or Firefox, works offline, and no file leaves your computer.Add a song
1
Convert the song to .ogg
Export the song as Ogg Vorbis (
.ogg), for example with the Ogg Vorbis export of Audacity. MP3, WAV and other formats are not played.Give the file a simple name: letters, digits, - and _, ending in .ogg, at most 64 characters, without spaces. For example night-drive.ogg.2
Measure it with the track meter
Open
tools/track-meter.html from the road-unicorn folder in your browser and drop your .ogg files on it. You can measure several songs at once.For each song the track meter shows the tempo, the first downbeat and the length, and a line such as Light show measured: 12 parts, 4 drops, a kick on every beat.- Check the badge: Steady beat is fine, Check by ear means you should listen once, No steady beat means the lights may not match this song.
- Press Play with click: the click must land on the kick drum, with a higher click on the first beat of every bar. Skip 30 s jumps ahead.
- If the click runs at half or double the speed of the song, press ½ or ×2. The track meter measures the song again at the new tempo.
- Check Title, Artist, Id and File name in the music folder. The title and artist are shown in the DJ console, the queue and the guest song list.
3
Save the analysis files
Press Save analysis on a song, or Save all analyses at the bottom to save the files of every song at once. Your browser saves one
.json file per song, named like the song: night-drive.json for night-drive.ogg.4
Copy the song and its analysis into the music folder
Copy both files into the Put the files straight into
music folder of the resource, next to fxmanifest.lua:Folder structure
music, not into a sub folder. If the song file was renamed on the track meter, rename it on disk the same way before you copy it.5
Add the lines to config.lua
Press Copy lines at the bottom of the track meter and paste the lines into Always use the line and the analysis file from the same measurement. If you measure a song again, replace both.
tracks in config.lua:config.lua
6
Load the new songs
Restart the server, or run these two commands in the server console:The server checks every song at start. Problems are reported once in the server console, see Server console messages.
Server console
/unicornrequest.
The config line
Copy these values from the track meter instead of typing them: the analysis file must match
file, bpm and durationMs of its line.
Server console messages
Each problem is printed once when the resource starts, with the position of the line intracks:
Server console
A song that is skipped does not load at all. A song with an unusable analysis file still plays, with the generic light show.
Update Road Unicorn
When you install a new version, keep yourconfig.lua and your music folder. Replace everything else.
Good to know
How many songs can I add?
How many songs can I add?
Up to 100 songs. Each song is downloaded by the players’ game like the other files of the resource, so very long playlists make the first join after a restart take longer.
The click on the track meter misses the kick
The click on the track meter misses the kick
Press ½ or ×2 and listen again. If no tempo fits, the song has no steady beat (live recordings, tempo changes); it still plays, but the lights may not match it.
I edited or re-exported a song
I edited or re-exported a song
Measure it again and replace both the line in
config.lua and the .json file. The old analysis does not match the new file.Can I edit the analysis file by hand?
Can I edit the analysis file by hand?
No. The server checks it against the song and refuses a changed file. Measure the song again instead.
Do I need the rights to the songs?
Do I need the rights to the songs?
Yes. As the server owner you are responsible for holding the rights to play every song you add on your server. Road Unicorn does not license any music for you.