Sunteți pe pagina 1din 6

Multimediabox

BpmDj

BpmDj – Free DJ
Tools for Linux
Werner Van Belle
So you want to make a party or another social event with music and you're considering, how to use
your PC running under Linux for this purpose. Thanks to the BpmDj tools, which are made using QT,
you will manage, mix and play the MP3 or OGG songs easily.

B
pmDJ annotates all songs with psycho- You can then choose to install the binaries into /usr/
autorzy@lpmagazine.org

acoustic properties, including tempo, sound local/bin or /usr/bin/ using:


color, echo/delay information, rhythm in-
formation and composition information. cd bpmdj-3.0
The program relies on mplayer, ogg123 and/or mpg123 cp * /usr/bin/
to decode songs while output is send through alsa
or oss drivers. This article demonstrates beatmix- Alternatively, you can run it from the local directory by
ing (how a DJ can superimpose two songs during extending the PATH variable:
longer times) and automixing (how BpmDj can mix
music for you). It further sheds some light on the export PATH=.:~/bpmdj-3.1/:$PATH
psychoacoustic properties used and a feature called
beatgraphs. Before starting the program. After installing BpmDj, you
should create two directories: index and music. The mu-
Installing & Setting up BpmDj sic directory needs to contain the .mp3 and .ogg files,
BpmDj requires Qt3.1, alsalib (libasound), FFTW 3.0 while the index directory will contain all meta-informa-
(libfftw) and some external players which can be tion about these songs. Copy a number of your favorite
mplayer (1.0pre6-3.3.5 or 1.0pre7-3.3.5), mpg123 or songs into the music directory and then start kbpm-dj:
ogg123. Those need to be downloaded and installed se-
parately. After downloading BpmDj (see links) unzip mkdir music
the file: mkdir index
cp <myfavoritesongs> music
tar -xvzf ../Desktop/bpmdj-3.1.bin.tgz kbpm-dj

2 January 2007
Multimediabox
BpmDj

A number of dialog boxes will guide you. equalizers, one regularly finds the volume
To summarize the setup process: you must slider that changes the volume flowing to the
Glossary
first import songs into the database (Ma- main mix. Further, the mixing desk should
nagement|Import Songs), set up an ana- have pre-fader listen (PFL) buttons. Push- • beatmixing – the art of synchronizing
lyzer (choose the standard one, don't for- ing this button routes the signal of that two songs by superimposing the beats
get to configure it by pressing the Config- channel (after equalizing, but before the vo- over a longer time. Especially with turn-
ure button) and queue the imported songs lume changes) towards the headphone/mo- tables this turns out to be an 'art'.
for analysis. To be useful, BpmDj needs at nitors. This allows the DJ to tune and posi- • cue – a position where a song should
least access to two soundcards on one or tion a song without interfering with the jump back to when the player is stopp-
more computers, which should both be set main output stream enjoyed by the audi- ed
up in Program->Preferences->Player. ence. The volume indicator can show the • equalizer – an equalizer allows one to
current PFL signal or the main signal. With alter the volume of a specific frequen-
The Mixing Desk these basic tools one can start mixing. cy band.
BpmDj requires an external mixing desk • gain - usually means the ratio of the
to blend the multiple audio streams gener- Playing the first song signal output of a system to the sig-
ated by the players. This makes it possible After starting kbpm-dj, the program pres- nal input of the system. The gain
to use specialized external audio effects. ents a list of available songs, annotated with alters the signal strength of the in-
We will now briefly touch upon a mixing various colorful pictures. Double clicking coming signal before it is send to
desk as to provide insight into the stan- a song will start playing it. The first song will equalizers and volume sliders.
dard tools available for a DJ. be considered to be the main song. Other- • main song – the song that is current-
Normal mixing tables have a number of wise, it will be considered a monitor song. ly routed towards the main channels.
channels, which in our situation, will take When a monitor song starts, it will play at • mixing desk – a mixing desk is a pie-
input from the sound cards. Every channel the tempo of the main song. To start our first ce of hardware that takes input from
has a gain to change the pre-amplification mix we do the following: various audio sources and routes
of the signal before it goes to the volume them to a number of output channels.
fader. The gain should be set as high as po- • Zero the gain and volume of the first It is essentially an audio 'router'.
ssible without clipping or distorting the channel, • monitor song – the song that the DJ
music. Every channel also has a number of • Double click your first song, is listening to, but which is not send
equalizers to change the intensity of low, • Change the gain until we have maxi- to the main outputs.
middle and high frequencies. Many DJ's mum PFL signal without clipping. Don't • PFL – pre-fader listen – used to route
tend to turn the equalizers fully open (at use the volume slider in this process. If the signal towards the headphones,
+15dB), which gives the sound a distinct equalisation is necessary, this should be without sending it to the main chan-
techno feel but is in general not necessary. done now as well. When you equalise, nels.
To remain true to the original song one can don't forget to appropriately alter the
set the equalizers to neutral: 0 dB. Below the gain, • Now you can crank up the main vol-
ume (to scare your neighbours) or
keep it civilzed (and use headphones).

Selecting the next song


To help you choose the next song, BpmDj
provides a distance metric between songs.
When a main song is available, the dColor
column shows the distance between the
listed and the main song. The distance me-
tric takes into account all the information
gathered during the analysis phase, inclu-
ding tempo, sound color, echo, rhythm and
composition properties. The DJ can now de-
cide to stick to the same type of music and
select the best match (smallest distance), or
choose to alter the course of his/her set and
select a song that is close (within dColor
range) but still far enough to be different
(the perfect marriage). If you have chosen
your second song:

• Place the volume slider of the second


channel to zero (the audience should
Figure 1. BpmDj song selector and player not hear what you plan to play).

www.lpmagazine.org 3
Multimediabox
BpmDj

• Zero the gain of the second channel


(we don't want to become deaf due to
a mismatch in gain between the cur-
rent and previous song).
• Turn the first song PFL off and the
second song PFL on (we only want to
hear the new signal such that we can
set its gain appropriately).
• Double click your second song.
• Change the gain until you have maxi-
mum PFL signal without clipping.

Figure 3. Echo/delay accent analysis of Kittens by Underworld


Placing a cue in the second
song Beat mixing the second song random, some magic things can be done.
Now that the second song plays, we need BpmDj has taken care to play the new song For instance, it is possible to jump back and
to determine which section of the song we at the tempo of the first song. This means forth by measures, or jump to a cue whilst
would like to use. The start of this section that our second song can now naturally be preserving the relative positioning within
will be our cue-position. To set a cue, it is blended with the first one, without explicite- a measure. Pressing 1,2,4,5 or 7,8 makes the
important to listen to the music and syn- ly watching their tempo. However, to have player jump back or forth by respectively
chronize to the beginning of every 4th or 8th a proper blend we need to wait for the right 1,4 or 8 measures (try to do this on turn-
measure (8 measures = 32 beats). When such moment to kick in the new song. A beatmix tables, or with CD's !).
a phrase starts, press the '/' key. BpmDj will superimposes the beats of two songs over This can be used for well-planned breaks.
stop the song and remember this position. a longer period, during which a slow cross- If one listens to the first song and start the
Pressing space will jump back to that cue fade can be performed. Practically: second song in phase with the first, then
and restart the song. There are 4 persistent one can jump back the second song before
cues. These are called the Z-cue, the X-cue, • Put on the PFL of both channels. the snare-roll and nicely mix it into the final
the C-cue and the V-cue. Pressing the capital • Find the beginning of a phrase in the stream. Without the ability to jump back
'Z', 'X', 'C' or 'V' stores the current cue into first song. When the next phrase starts, measures, this could be quite complicated.
that memory position. Jumping to a cue is press the space bar to start the song. BpmDj also provides a set of Low Fre-
done by pushing the small 'z', 'x', 'c' or 'v'. • Very likely, the song will not exaclty quency Oscilators (LFO's) that synchronize
Shortly, you should: start synchronized. If the song is some- to the songs' tempo. Those LFO's are: pan,
what too late or too early, nudge it saw-up, saw-down and break. The saw-
• Listen to the second song and find the back/forth with the '-'/'+' key. down LFO forms an excellent tool to posi-
beginning of a phrase. Then press '/' • Once the two songs are properly super- tion cues accurately. If you have set a cue,
• To position the cue accurately, use the imposed, we crossfade and close the one can stop the music and press 'r'. Now
'(' and ')' keys. These will shift the cue player of the first song. During crossfa- the music will be sliced into segments with
forth or back with 1/64 note. (One can ding, don't forget to turn off both PFL's. the size of a beat. If the cue is too early, one
also shift the cue 8 full measures using • During the crossfade the two songs perceives some noise, a beat and then the
'{' and '}' keys) remain synchronized for some time, rest (press ')' in that case). If the cue is too
but not forever. If a song starts drifting late, one tends to miss the punch of the beat
too early, use the nudge keys ('-' and '+') (press '('). An LFO can be switched off by
to reposition it, thereby watching the hi- pressing 'n'.
hats (these are easy detectable and tend
to provide a greater accuracy than the Beatgraphs
temporal wide sound of bass drums). BpmDj contains a feature, the beatgraph,
• Now our second song has become the which can help to spot breaks and tempo
main song. Therefore we should re- changes. Horizontally, the beatgraph visua-
turn it to its normal tempo by pressing
lizes the different measures, while vertically
the fade button in the second player.the content of one such measure is visual-
Once the button becomes green, it hasized. The intensity of a pixel reflects the RMS
reached its normal tempo. energy at that position. If the measured
• Quit the first song by pressing escape
tempo is correct, the beatgraph shows dis-
on the player window. Once the main tinct visual bands. When the tempo is wrong
song closes, the monitor will become or multiple tempos are present (or the dru-
the main song. mmer of the group doesn't care about his ac-
curacy), then the beatgraph will show a dis-
Bpm Tricks tinctive drifting look. The beatgraph can be
Figure 2. The wavelet beatgraph of the song Because BpmDj has exact tempo informa- accessed as a tab in all players. When wave-
Summer98 by California Sunshine tion and can access the audio stream at lets are used to visualize the beatgraph,

4 January 2007
Multimediabox
BpmDj

then red colors are low frequencies and


blue colors are high frequencies. All other
colors lie in between. A beatgraph should
be read from top to bottom and from left to
right: the song starts playing in the topleft
corner goes down for one measure and then
continues in the next column until it finishes
bottomright.
Figure 2 shows 4 bassdrums in every
measure (the red boxes). Every beat has
multiple frequencies at the start (yellow)
which then fade out into the bass frequen-
cies (the red tail). The purple boxes show
the position of hi-hats and claps. The two
green strokes indicate some bars contain-
ing high frequencies. The yellow stroke Figure 4. Rhythm and composition map
covers an area without bassdrum, while of which autocorrelation and ray-shoot- • Histogram Analysis – measures for every
the orange stroke covers an area with ing are most appropriate. Both deter- Bark band the distribution of sound
double bassdrums (every 1/8 of a note mine the tempo by horizontalizing the intensity in the song, and thus in a way
instead of every 1/4th). When DJ-ing, the beathgraph. A tapping Bpm counter is reflects the kind of echo, delays and
beatgraphs reveals in advance gaps, breaks available if the automatic one picks the accents present. Figure 3 has 24 bark
and tempo switches. wrong harmonic. bands (0 being low, 24 being high fre-
• Sound Color – is measured through quencies). The first band shows how the
The BpmDj Analyzers spectrum analysis, which measures the lower bass has a relative uniform occur-
We will now briefly turn our attention to the presence of specific frequencies in a rence (the bass of a bassdrum decreases
various properties analyzed by BpmDj: song. To respect the sensitivity of the slowly and thus occurs at a wide ran-
human ear, the output of the spectrum ge of intensities). The second bark band
• Tempo – The BpmDj BPM counter is acce- analysis is binned into the 24 critical (covering the body of a bassdrum)
ssible via the BPM-counter button of the bands of the Bark psychoacoustic scale. shows a large probability to always oc-
player window. Five different tempo In this scale tones with a pitch in the cur with the same intensity. From band
measurement techniques are available same band will mask each other. 12 on a split in the diagram occurs, in-

REKAMA

www.lpmagazine.org 5
Multimediabox
BpmDj

About the author


Dr. Werner Van Belle, originally from Bel-
gium, has been researching mobile multi-
agent systems and open distributed sys-
tems. Now he lives in Norway, where he
works as a researcher at Norut IT, which is
a group specialized in signal processing for
Earth observation and life sciences. In his
spare time he is passionate about digital
signal processing for audio applications. He
likes to describe himself as a multidiscipli-
nary researcher and is always interested in
Figure 5. Automatic generated playlist. Red songs are 'ankers'. Yellow ones are filled in automatically
job offers and/or interesting projects to work
dicating that the hi-hats have an accent ity that the intensity at a specific bark in. The author can be contacted by email:
(they can occur at -6 dB or at -48 dB). band changes after a number of mea- werner@onlinux.be, werner.van.belle@gmail.
• Rhythm Analysis (Figure 4) – pressing sures. Position D shows a large prob- com or werner@itek.norut.no. His homep-
the Rhythm button in the main player ability that the low frequencies change age is at http://werner.onlinux.be/.
window accesses the rhythm analyzer. after 4 measures, which can either mean
The window contains three distinct pa- that the beat stops or starts. After 7 all songs in the Queue tab, click right and
nels, all with a vertical Bark scale. Panel measures (F) the higher frequences of- choose insert random songs. This feature
A shows the overall content of one mea- ten change, in order to change again at is often used to create playlists for aerobics
sure. Horizontally, one measure is visu- the next measure. This is a typical break practices (These classes seem to depend on
alized with 4 beats (position G is the 3th that cuts the hihat (measure 7) before a scientifically engineered tempo changes).
beat). The hihats are spaced between break (measure 8).
the beats (E), and a 1/16 monotone ba0 Automatic Mixing
seline is present (H). Every 2 beats has Playlist Automation BpmDj contains an experimental submod-
a crash cymbal (the longer green trail Because BpmDj has these well-defined ule, the automixer (see Figure 6), which can
after the E). properties, together with a distance metric, automatically glue together a set of songs.
• Composition Analysis - Panel B shows the it is possible to automatically find song This can be useful for online radio stations,
bark intensity for all measures. It shows that belongs between two other songs, and or to create mixes for portable MP3 players.
the entire song from left to right. In this thus create playlists automatically. To cre- The process itself works offline and suc-
particular case some filter upsweeps are ate such a playlist, select a number of songs ceeds in about 80% of the times (20% of the
present. The information calculated in B in the Songs tab and add them to the queue
then to the composition property in the (press the right mouse button and click
next panel. Panel C shows the probabil- Add To Queue). See Figure 5. After selecting
On the Net
• BpmDj homepage:
http://bpmdj.sourceforge.net/
• BpmDj Setup:
http://werner.onlinux.be/BpmDj/
setup.html
• Step-wise tempo changes:
http://werner.onlinux.be/Papers/
tempochange06/index.html
• Spectrum/echo analysis:
http://bio6.itek.Norut.no/werner/
Papers/spectrum05/index.html
• Tempo analysis:
http://werner.onlinux.be/Papers/
bpm04/index.html
• Meta-data extraction:
http://werner.onlinux.be/Papers/
bpm05q1/BpmDjQ1.html
• Signal processing techniques in BpmDj:
http://werner.onlinux.be/Papers/
insomnia05/siframes.html
Figure 6. The automix dialog will mix together the current playlist according to the presented schematics

6 January 2007
Multimediabox
BpmDj

automated mixes are wrong, which shows


why DJ's can be actually useful). Good resul-
ts can be expected when songs have a com-
patible rhythm and sound color. To use the
automixer, one must first queued a playlist.
Then, pressing the Fully Automatic Mix but-
ton in the Queue tab will pop up the automix-
er. The program can output one big stream
or split that stream into small submodules.
Normally, one big raw file (little endian, 16
bits, 2 channels) is created by gradually ap-
pending new songs to the end of an already
existing file. Optionally, this file can be split
into pieces and encoded again. After filling
in all options, one can press OK and execute
the process_mix.sh script on disk.

Conclusion
We have presented you with a step-by-step
guide on using BpmDj to mix music. Al-
though this is easy, it requires the dedicated
practice. Insight in some more experimental
features, such as automixing and playlist
automation should allow you to start your
own DJ-ing quickly.

www.lpmagazine.org 7

S-ar putea să vă placă și