Guidance on DJ-Style 3-Band Waveforms (like Rekordbox/Engine DJ) with lirosa

26 views
Skip to first unread message

Gabriel Juliao

unread,
Mar 25, 2025, 11:37:07 AMMar 25
to librosa

Hi librosa community,


I’m working on a waveform visualization similar to what you see in Rekordbox or Engine DJ—smooth, time-domain amplitude plots, ideally split into 3 color-coded frequency bands (low/mid/high) like in DJ software. I’m new to signal processing and struggling to find clear examples or guides for creating 3-band waveforms like this.


Goals

  • A simple, smoothed waveform like Rekordbox or Engine DJ.
  • Split into 3 bands (low/mid/high) for a colored display.
  • Solid, filled shapes, not just lines.


Questions

  1. What’s the simplest way to achieve a DJ-style waveform with librosa? Would librosa.stft or filters work better for splitting into 3 bands?
  2. For the 3 bands, should I use FFT with frequency binning, or is there a more straightforward method like filtering the signal directly?
  3. How can I smooth the waveform for a polished look? A moving average help?
  4. To draw filled waveforms (like solid shapes under the curve), is there a trick with librosa ?
  5. Any tips on a basic workflow—e.g., load audio → split bands → smooth → plot? What settings (like window size or hop length) should I start with?


This is what I’ve done so far: https://github.com/GabrielJuliao/wavypy

Any advice on algorithms, tools, or steps would be a huge help!

Thanks!

Brian McFee

unread,
Mar 25, 2025, 11:50:35 AMMar 25
to librosa
Responses inline:

On Tuesday, March 25, 2025 at 11:37:07 AM UTC-4 gabriel...@gmail.com wrote:

Hi librosa community,


I’m working on a waveform visualization similar to what you see in Rekordbox or Engine DJ—smooth, time-domain amplitude plots, ideally split into 3 color-coded frequency bands (low/mid/high) like in DJ software. I’m new to signal processing and struggling to find clear examples or guides for creating 3-band waveforms like this.


Goals

  • A simple, smoothed waveform like Rekordbox or Engine DJ.
  • Split into 3 bands (low/mid/high) for a colored display.
  • Solid, filled shapes, not just lines.


Questions

  1. What’s the simplest way to achieve a DJ-style waveform with librosa? Would librosa.stft or filters work better for splitting into 3 bands?
I don't know what exactly a "DJ-style waveform" means, but I'm guessing it's something like an amplitude envelope?  Our waveshow function does that under the hood, at least until you zoom in far enough for a sample plot to be more informative.
 
  1. For the 3 bands, should I use FFT with frequency binning, or is there a more straightforward method like filtering the signal directly?
Filtering the signal directly is probably going to be both faster and more accurate.  I'd look at scipy.signal and the functions to construct, eg, butterworth filters for low-, band-, and high-pass filters.

I have some textbook material on this topic here: https://brianmcfee.net/dstbook-site/content/ch11-iir/intro.html - though you may need to read some previous chapters to fill in background if you're new to this stuff.

  1. How can I smooth the waveform for a polished look? A moving average help?

Sure, though for display purposes, you may want to apply the smoothing after doing an envelope calculation (ie max(abs(x)) over a short frame of audio).
 
  1. To draw filled waveforms (like solid shapes under the curve), is there a trick with librosa ?

librosa uses matplotlib's fill_between artist to make solid shapes out of (symmetrized) amplitude envelopes.  The source code is a little involved at this point because it also handles interactivity and adaptively switching between filled and line plots depending on zoom level, but you might find something useful in reading through it: https://librosa.org/doc/latest/_modules/librosa/display.html#waveshow
 
  1. Any tips on a basic workflow—e.g., load audio → split bands → smooth → plot? What settings (like window size or hop length) should I start with?


The analysis settings (frame / hop sizes) will likely not matter very much here if all you're doing is display.  From the recommendation above, the filtering could be done in the time domain upfront, so these parameters would not affect the filtering.  What they would affect is the detail of the amplitude envelopes (and, relatedly, memory efficiency for the plots).  If you're aiming to smooth these things out anyway (via local averaging), you can probably tolerate a pretty coarse frame rate and still be ok, but start with the defaults and see how it looks.
Reply all
Reply to author
Forward
0 new messages