BpmDj is a program that has grown over a number of years already. BpmDj is a set of programs that can be used to DJ a night. It works under Linux and plays Mp3's. The programs has all kinds of interesting features such as: fully automatic BPM-counting (works on an algorithm invented by me), allows for beatmixing of two or more songs. The program itself requires the availability of two DSP devices. This can be either by plugging two soundcards in one machine or using two machines and playing remotely. The package includes a file selector that can help in determining which songs to play. It keeps track of interesting information such as: how does this song sound like ? -or- what is the tempo of this song ? -or- How did I tag it in the past ? The package itself contains mainly three programs. The first program is the player, the second program is the selector and the third program is the music-analyzer. In this section we will explain the details of the player. The player is typically only concerned with one song at a time.
The player can be started with ./cbpm-play or .kbpm-play. kbpm-play is a graphical variant, while ./cbpm-play is still an old fashioned command line player. However, this might be useful if you play on a remote machine with not enough memory. If kbpm-play is invoked from within the selector kbpm-dj then the song will play at the tempo of the mainsong. However if you want to start it manually you might need to take a look at the command line options.
Nudging+ 1/32 note forward
- 1/32 note backward
* 1/8 note forward. This is useful if you have the two beats interleaving each other.
9 beat forwardShifting Measures
2 One measure forward
1 One measure backward
5 Four measures forward
4 Four measures backward
8 Eight measures forward
7 Eight measures backwardChanging Tempo
, Selects the target tempo of the song. Keybinding only in cbpm-play, in kbpm-play click the Target-button.
. Selects the normal tempo of the song. Keybinding only in cbpm-play, in kbpm-play click the Normal-button.
0 automatically changes the tempo of the song until it is playing at its normal tempo. The key '0', or button '>>' takes 10 seconds to reach the target. The button '>>>' only takes 5 seconds and the '>' button takes 60 seconds.
1 only cbpm-play: shifts the pitch of the song 1/2 note up
k only cbpm-play: shifts the pitch of the song 1/2 note downMiscellaneous bpm-play Features
t only cbpm-play: The first time pressed: starts a timer; otherwise prints the elapsed time since timer-start.
% only cbpm-play: Shows the name of the song and the current playing position in the song
{ only cbpm-play: Restarts the song at its beginning, with a normal tempo.
c only cbpm-play: prints copyright information
h, ? only cbpm-play: prints help informationCues
/ marks the current position and places it in the cue.
<space> stops and starts the song. If a cue is available the song will automatically restart at that position.
<restart-button> can be used to restart the song at position 0.
{ shift the cue 8 measures backward
} shift the cue 8 measures forward
( shift the cue 1/32 backward
) shift the cue 1/32 forward
Z,X,C,V four positions where you can store a cue. You do this by pressing the capital Z, X, C or V. If a cue is present at the given position, the button is colored green, otherwise it is colored red.
z,x,c,v retrieves a cue from the four positions. If the song was not yet playing it immediately starts playing. If it was playing the player will shift back to the cue, respecting the current position in the measure.LFO's
s Slow saw up LFO
S Fast saw up LFO
r Slow saw down LFO
R Fast saw down LFO
b Break LFO (try it)
p Slow panning LFO (mid, right, mid, left)
P Fast panning LFO (mid, right, mid left)
d Differentiator. Low-cut at 11KHz.
m Metronome.
Scenario 1: Simple BeatmixingBefore we can even think of playing we need to generate the index files:
A first song is playing, called A.mp3. We now want to switch to the second song (B.mp3)Go to your DJ directory. Be sure all your music is in ./music and that a directory ./index exists. If this is the case continue Enter 'cbpm-count music/A.mp3' Enter 'cbpm-count music/B.mp3' Move both .idx files to ./index Start song A by typing 'kbpm-play index/A.idx' (instead of using kbpm-play, it would also be possible to use cbpm-play) Scenario 2: cue'sBe sure to switch of the gain of channel B and turn the volume down of channel B. Enter 'kbpm-play -m index/A.idx index/B.mp3' on the computer. If both index files exist he will automatically start playing at the target tempo (the tempo of song A) Listen to song B in your headphone (push PFL of channel B) and press / at the beginning of a phrase. Now we stop song B by pushing <space> Now listen to song A in your headphone (push PFL of channel A). Press <space> at the beginning of a phrase. Now song B will jump back to the first mark. Hence, both songs should be synchronized. Of course this is not the case Slide song B a bit to the left or to the right with +, - . If the beats match, listen a while longer to see which direction you have to nudge to keep them in sync. You can listen two both songs together by pushing the PFL of channel A and channel B. Jump back or forth in song B till you are where you want to be with 7 and 8. Switch all PFL's off. Increase the volume of channel B until maximum. Remove the bass drum of channel A with the low band filter. Slowly remove channel A (or remove channel A abruptly when appropriate) Of course not all music should be beat mixed. Sometimes a switch can be done by kicking in song B at the right moment. This requires the ability to start song B where we want.
There are 4 different cues, which are saved to disk. These are called the Z-cue, the X-cue, the C-cue and the V-cue. Setting a cue to the current cue is done by pushing the capital Z, X, C or V. Retrieving a cue is done by pushing a small x, c, v or z. When retrieving a cue the program will immediately jump to that position. If you leave the program, the cue-configuration will be saved to disk for the next time you start that song. If you are playing a lot of music you might want to develop your own standards for this.Listen to song B, hit '/' or '[' at the position you want to start the song. Push <space>. The music will stop. If you now push <space>) the music will immediately start at the cue. If the position is wrong. Push ' (' (or ')') to shift the cue forward and backward. You can shift the cue 8 measures at a time by using '{' and '}'. Hit <space> again. Turn on the volume of channel B and at the right moment push <space> again. Scenario 3: Using stored cues to do a fast beatmix
Suppose we have a song with a number of cues. Which have been stored to disk. If we want to mix this song at this position over another song we start the song at the right tempo (cbpm-play -m). We load the current cue by pushing the small letter ('z' for example). If this is done we listen to the playing song and at the right moment (the start of a phrase) we push ']'. The beats should be slightly off. This is due to a latency in the transmission of the keypress and the arrival of the keypress at the program (hence, I can't solve this problem). Now start nudging ('+' and '-') until the beats are good.
Scenario 4: LFO's
Some extra fun can be done by using a number of LFO's.
Scenario 5: Using the MetronomeAt the top of a beat push 'p'. You will now hear the music spinning from left to right. If you are tired of this effect, push 'n' At the beginning of a phrase push ' b'. In 4 measures a sound break will occur right before the 5th measure. You can use a build in metronome to check whether your cue's are positioned at the beginning of a measure. To do this load the correct cue (press z, x, c or v) and press 'm' to start the metronome. Now pause the song by pressing spacebar: ' '. Press spacebar again to start at the current cue. The metronome will also restart at its beginning. If the cue is correct the metronome should sound together with a beat. If this isn't the case press ' (' or ' )' to shift the cue a bit back or forth. When you press one of those, you the music will stop. Press spacebar ' ' again to start at the new position. Repeat this process until the beats match the metronome. At last, store the cue in one of the 4 positions.
Scenario 6: Exactly positioning a cue
If you want to place a cue exactly at the beginning of a beat you first need to place it somewhere around the beat. Afterwards you can shift it back and forth with the '(' and ')' keys until it is exactly at the start of the beat. However, there is a tool that can help in deciding whether the start of the beat is exactly the start of the beat and this is the 'r' function. This is a LFO that slowly decreases the volume to zero (over 1 or 2 measures) and then maximizes the volume again. If you have the cue exactly at the beat and you press 'r' you will hear every start with a beat. If it is a bit too early positioned you will hear some noise, a beat and then the rest (press ')' in that case). If the cue is placed a bit too late you will very likely completely miss the entire beat (press '('). After you have positioned a cue at a correct position, press 'n' to bring back the sound to normal and press 'Z','X','C' or 'V' to store it for later retrieval.
The BPM counter of kbpm-play is accessible via the 'BPM-counter' button of the main-pane. The bpm-counter window supports three tools.
A tapping bpm-counter, to get a rough idea of the tempo A fully automatic BPM counter (as described in previous sections) A spectrum analysis to retrieve the color of the song. If you want a rough estimate of the tempo of a song, press the tap button. Make sure that the song is playing at its normal tempo, otherwise your measurement will be wrong. If you want to get into the rhythm before tapping, press the reset key whole the time and suddenly start using the Tap-button. If you want to tap less, set the skip box on some value you like. For instance, if the skip-box is set to 4, the tapping counter will assume that with every tap, four beats have been passed. If you tap the beat, the tempo information will change immediately and give the best estimate of the tempo. However, if you want an exact BPM-count, you should continue with the automatic bpm-counter. Tapping the beat
To use the automatic bpm-counter, first specify the upper and lower bounds of the BPM. You can easily narrow these down by tapping the beat as described in previous section. The automatic counter is started with the Start button. Beware this might take a time ! If you need the tempo of a lot of songs, you should use the file selector kbpm-dj and measure the tempo of songs in batch overnight. The automatic bpm counter
To obtain the color of a song, select a suitable cue-point, go to the bpm-counter window and select 'Fetch Spectrum'. Beware, this takes a while ! If you need to do this in batch, please use the file-selector kbpm-dj. Obtaining the color of a song
In the analysis box you can also modify the tags assigned to a song. When the player quits these tags are updated on disk. Modifying Tags
Normally, the program plays the songs at its normal tempo. If given the -m (match tempo to) argument, the program will change the tempo of the song to play to the tempo of the -m song. The tempo of the song to match to is called the target tempo. The tempo of the song to play is the normal tempo. Command line options
-L The latency expressed in milliseconds. A large latency is difficult to handle, but a very low latency (lets say 1 ms) will stutter a lot. The default latency is 700ms.
-q Be quiet.
-d Device selection. Add a string to this to choose your DSP-device. E.g.. -d /dev/dsp1
-x Mixer device to use
-b Immediately obtain bpm-count, no sound, quit immediately. This option cannot be used if no index file exists already. To create these go to kbpm-dj or start cbpm-count manually.
-l Lowest BPM
-h Highest BPM. The best matching BPM is looked for between the lowest and the highest BPM.
-m Index file to match tempo with. This means that this song will play at the tempo of the song given after the -m switch.
-p <x,y> The position where to place the window.
-s measure the sound color of the song at the existing cue position.
<arg> After the command line options the name of an index file should be supplied.
The pattern analyzer can be used to see how the tempoline changes over time and how well the measured tempo is correct. To analyze a song, the pattern-analyzer will visualize hoirinzotally the different measures, while vertically the content of one such a measure is visualized. If the period (BPM) is correct, the song should show distinct visual lines. However, if the period is worng, or the song contains different tempos, or the drummer of the group doesn't actually care about being correct, then the visualisation will look something different.
The above picture shows the pattern visualisation of AlienPump (Tandu). As can be seen, the white 'strokes' go horizontally, so the period of this song is correct. If this was not the case, the white horizontal strokes would slant down or up. If this were the case then you can manually modify the tempo by using sliders A and B. Slider A is a fine tempo modification. Slider B is a coarse grain tempo modification. Once the music is 'horizontalized', you can press the 'set Tempo' button to make this tempo permanent.
In the two pictures below, we see on the left the song Anniversary Waltz (Status Quo). As can be seen, this song drifts slightly and the drummer clearly didn't think a steady rythm would be good in this piece of music. The right picture below is the pattern visualisation of the song XFile (Chakra & Edimis), this song comes from an 'already mixed' cd and as you can see the DJ who created the mix had to modify the tempo over time. In both pictures, the vertical red lines show where the song was playing at the moment of the snapshot.
In general, all the things that can be done with kbpm-play can be done with cbpm-play and all the things that can be done by using the bpm-counter, can be done by using the cbpm-count program. On top of this, there exists an old-fashioned windows bpm-counter which analyzes .WAV files. These three programs (cbpm-play, cbpm-count and wbpm-count) are still included because they can be useful when playing remote on a machine that has not the opportunity to export a display to another machine. A second reason why they are still included is because they can be very easily used in batch processing. However, it is not guaranteed that they will be supported in the future. So if you can, make the transition towards kbpm-play.cbpm-count requires one parameter: an mp3 file from the music directory. It will output an .idx file in the current directory. Move these .idx files to the index directory before proceeding.
Example:cbpm-count music/test.mp3 will create a file test.idx
mv test.idx index to ensure that the player will find it afterwardcbpm-count command line switches
-v Verbose
-t <int> Autocorrelate the music only till 'to' % of the song. Normally this value is 100
-f <int> Autocorrelate the music only from 'from' % of the song. Normally this value is 0
-l <int> Lowest BPM
-h <int> Highest BPM. The best matching BPM is looked for between the lowest and the highest BPM.
-c Only create the .index file, do not measure anything.
-w <arg> Write the .index file to <argument>