<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jesse Pinkman</title>
    <description>The latest articles on DEV Community by Jesse Pinkman (@jphfa).</description>
    <link>https://dev.to/jphfa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3909215%2F3c174be7-9d57-4771-a884-3f08ae721835.png</url>
      <title>DEV Community: Jesse Pinkman</title>
      <link>https://dev.to/jphfa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jphfa"/>
    <language>en</language>
    <item>
      <title>rekordbox Auto Gain evens out your tracks on the laptop and never reaches the CDJ</title>
      <dc:creator>Jesse Pinkman</dc:creator>
      <pubDate>Sat, 07 Nov 2026 17:49:44 +0000</pubDate>
      <link>https://dev.to/jphfa/rekordbox-auto-gain-evens-out-your-tracks-on-the-laptop-and-never-reaches-the-cdj-1mp2</link>
      <guid>https://dev.to/jphfa/rekordbox-auto-gain-evens-out-your-tracks-on-the-laptop-and-never-reaches-the-cdj-1mp2</guid>
      <description>&lt;p&gt;Same set, same USB stick. One track needs the trim at three o'clock and the next one sits at noon. On the laptop they were even.&lt;/p&gt;

&lt;p&gt;That is rekordbox Auto Gain doing its job in one place and not the other. &lt;strong&gt;Auto Gain is a setting inside rekordbox.&lt;/strong&gt; It evens out the levels while rekordbox is the thing playing the music, on its own decks in PERFORMANCE mode and in the DUAL PLAYER layout of EXPORT mode. The number it works out is never written into the audio file, so a CDJ reading the stick has no idea it exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the number lives
&lt;/h2&gt;

&lt;p&gt;The switch is &lt;em&gt;Preferences &amp;gt; Controller &amp;gt; Mixer &amp;gt; Auto Gain&lt;/em&gt; (rekordbox 7.2.18 Instruction Manual, p. 242). Each track's value shows up, and can be changed by hand, on the Auto Gain knob in the GRID EDIT panel (p. 140). The DUAL PLAYER layout of EXPORT mode has its own AUTO GAIN control (p. 122). All of it lives in rekordbox's library, next to the track, not in it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where it lives&lt;/th&gt;
&lt;th&gt;Survives the USB export&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The Auto Gain value, on the rekordbox side&lt;/td&gt;
&lt;td&gt;✗ no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Beatgrid and cues, in the file and the XML&lt;/td&gt;
&lt;td&gt;✓ yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gain written into the file&lt;/td&gt;
&lt;td&gt;✓ yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Turn Auto Gain off for a minute and you hear the level that is actually in the file. That is the level a CDJ plays.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it aims for, measured
&lt;/h2&gt;

&lt;p&gt;rekordbox does not document a target. I read the GRID EDIT value for six tracks on 2026-10-02 and measured each track's integrated loudness. Every value came out as about &lt;strong&gt;-10 LUFS minus the track's integrated loudness&lt;/strong&gt;, to within 0.1 dB. So Auto Gain is loudness matching at playback: it raises quiet tracks as well as lowering loud ones. Six tracks is a small sample, but the fit was tight enough to be useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not copy that number into the file?
&lt;/h2&gt;

&lt;p&gt;Inside rekordbox that works because the gain is applied in the mixer. Written into a file, gain has a hard ceiling at 0 dBFS, and loudness matching runs into it.&lt;/p&gt;

&lt;p&gt;Take a dynamic track with 14 dB between its integrated loudness and its true peak. To bring it to -10 LUFS, its peak would have to go to +4 dBTP. A file cannot hold that, so the track either gets a limiter or stays below the target. Any track whose peak-to-loudness ratio is bigger than the gap between the target and the ceiling has the same problem.&lt;/p&gt;

&lt;p&gt;So the tool I built aligns something else: &lt;strong&gt;one true peak ceiling for every track&lt;/strong&gt;, -0.5 dBTP by default, which is the AES TD1008 §7B figure. Quiet tracks come up, loud ones come down, and nothing goes over 0 dB. The trim stays at twelve o'clock.&lt;/p&gt;

&lt;p&gt;The trade-off, stated plainly: this is &lt;strong&gt;not loudness matching&lt;/strong&gt;. A heavily compressed master still sounds louder than a dynamic one that only touches the ceiling on transients. The difference left is the difference between the masters, and the rest is still your ears. The two approaches are compared in more detail in &lt;a href="https://baken.ravers.workers.dev/loudness-normalization" rel="noopener noreferrer"&gt;Loudness normalization for DJs: a LUFS target or a true peak ceiling?&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What the tool does to the file
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exactly one gain change per track, no limiter.&lt;/strong&gt; The waveform keeps its shape and the dynamics stay as the master left them&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MP3 and AAC are not re-encoded.&lt;/strong&gt; For MP3 the tool rewrites the global_gain field in each frame, so the decoded audio is identical apart from the gain. That field moves in 1.5 dB steps, so MP3 and AAC land within one step of the ceiling rather than exactly on it&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lossless files&lt;/strong&gt; (FLAC, AIFF, WAV, and ALAC) get the exact gain through ffmpeg and are written back in their original sample format&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Files are rewritten in place&lt;/strong&gt;, so cues and beatgrids stay linked, and every run is backed up first
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ baken headroom --backup ~/Music/DJ
✓ Found 318 audio files
✓ Backup directory: ~/Music/DJ/backup
✓ Done! 254 files processed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Measurement is in-process BS.1770-4, not ffmpeg loudnorm. &lt;a href="https://baken.ravers.workers.dev/measurement" rel="noopener noreferrer"&gt;How Headroom measures loudness and true peak&lt;/a&gt; has the parity numbers against ffmpeg.&lt;/p&gt;

&lt;h2&gt;
  
  
  One step on the rekordbox side
&lt;/h2&gt;

&lt;p&gt;After the level in the file changes, rekordbox's stored Auto Gain value still describes the old file. Either re-analyse the tracks, or switch Auto Gain off so the laptop plays what the CDJ will play. The second option is the honest preview of the booth.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general move
&lt;/h2&gt;

&lt;p&gt;This is the same shape as &lt;a href="https://baken.ravers.workers.dev/sort" rel="noopener noreferrer"&gt;key and BPM sorting&lt;/a&gt;: anything rekordbox does in software stops at the laptop. Auto Gain stays in the library, a sort stays on the screen, and the CDJ reads only what is on the stick. The fix is to bake it into the thing that travels.&lt;/p&gt;

&lt;p&gt;The tool is &lt;code&gt;baken&lt;/code&gt;, MIT, Rust, macOS, Windows, and Linux: &lt;a href="https://github.com/M-Igashi/baken" rel="noopener noreferrer"&gt;https://github.com/M-Igashi/baken&lt;/a&gt;. There is also a native Mac app, &lt;a href="https://apps.apple.com/app/baken-deck/id6808813823" rel="noopener noreferrer"&gt;Bake'n Deck&lt;/a&gt;, which lets you pick a playlist, check every row, and then apply. The command line does the same work and stays free.&lt;/p&gt;

&lt;p&gt;Full version of this write-up, which is the canonical one: &lt;a href="https://baken.ravers.workers.dev/auto-gain" rel="noopener noreferrer"&gt;https://baken.ravers.workers.dev/auto-gain&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;rekordbox, CDJ, and Pioneer DJ are trademarks of AlphaTheta Corporation. This project is not affiliated with or endorsed by AlphaTheta Corporation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>cli</category>
      <category>music</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Export rekordbox playlists to a USB stick without opening rekordbox</title>
      <dc:creator>Jesse Pinkman</dc:creator>
      <pubDate>Sat, 07 Nov 2026 17:41:53 +0000</pubDate>
      <link>https://dev.to/jphfa/export-rekordbox-playlists-to-a-usb-stick-without-opening-rekordbox-4m1h</link>
      <guid>https://dev.to/jphfa/export-rekordbox-playlists-to-a-usb-stick-without-opening-rekordbox-4m1h</guid>
      <description>&lt;p&gt;&lt;strong&gt;You can write a USB stick for CDJs without launching rekordbox.&lt;/strong&gt; A player reads a stick through a handful of files: the Device Library (&lt;code&gt;export.pdb&lt;/code&gt;), a set of analysis files for each track, the audio and your My Settings. rekordbox normally writes them when you export in EXPORT mode. &lt;strong&gt;&lt;code&gt;baken expressport&lt;/code&gt;&lt;/strong&gt;, part of the free &lt;code&gt;baken&lt;/code&gt; command line, writes the same files straight from the &lt;code&gt;collection.xml&lt;/code&gt; rekordbox exports, and the &lt;strong&gt;USB Export&lt;/strong&gt; page in Bake'n Deck for Mac runs the same code in a window. Your prep stays in rekordbox. Analysis, beat grids, cues and playlists are made there as always, and only the last step, writing the stick, happens elsewhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Device Library by default.&lt;/strong&gt; Players that need OneLibrary (CDJ-3000X, XDJ-AZ, OPUS-QUAD, OMNIS-DUO) get it with &lt;code&gt;--onelibrary&lt;/code&gt; (command line, since 4.5.0) or Write OneLibrary too (Mac app, since 1.3.0), which no such player has read yet; without it a CDJ-3000X shows "OneLibrary not found". Sticks written by &lt;code&gt;expressport&lt;/code&gt; have played on a CDJ-3000 and on CDJ-2000NXS2 players&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rekordbox's database is never read or written.&lt;/strong&gt; The export reads the collection XML and rekordbox's analysis files, and writes only to the stick&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give it a stick of its own.&lt;/strong&gt; rekordbox rewrites a library it opens, so keep one stick for rekordbox and another for baken&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the stick on a player before a gig&lt;/strong&gt;, as you would with any stick&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What a CDJ reads from a stick
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;On the stick&lt;/th&gt;
&lt;th&gt;What the player gets from it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PIONEER/rekordbox/export.pdb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The Device Library: each track's title, artist, album, BPM, key, colour, rating and file path, and the playlists. The browse screen and search read this&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;PIONEER/USBANLZ/…/ANLZ0000.DAT&lt;/code&gt;, &lt;code&gt;.EXT&lt;/code&gt;, &lt;code&gt;.2EX&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The analysis of one track: beat grid, waveforms, cues and loops, phrases. The player finds the folder from a hash of the track's path on the stick&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Contents/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The audio files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PIONEER/Artwork/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Artwork thumbnails. baken writes them with &lt;code&gt;--artwork&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;PIONEER/MYSETTING.DAT&lt;/code&gt;, &lt;code&gt;MYSETTING2.DAT&lt;/code&gt;, &lt;code&gt;DJMMYSETTING.DAT&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;My Settings: the player and mixer preferences a CDJ loads from the stick, waveform colour among them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;PIONEER/rekordbox/exportLibrary.db&lt;/code&gt; (with &lt;code&gt;-wal&lt;/code&gt;, &lt;code&gt;-shm&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;OneLibrary, a second library rekordbox 7 writes for the players that read it. baken writes it only with &lt;code&gt;--onelibrary&lt;/code&gt; (in the Mac app, Write OneLibrary too)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PIONEER/rekordbox/exportExt.pdb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;rekordbox's extension tables for its Device Library. baken does not write it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;None of this comes from the audio alone. &lt;code&gt;export.pdb&lt;/code&gt; is a binary database in AlphaTheta's own format, and the analysis files are rekordbox's analysis of each track, rewritten for the stick at export time. rekordbox builds both from its own library. That is why an export normally means launching rekordbox, switching to EXPORT mode and waiting while it copies.&lt;/p&gt;

&lt;h2&gt;
  
  
  How baken writes it from collection.xml
&lt;/h2&gt;

&lt;p&gt;rekordbox exports its whole collection as XML with File → Export Collection in xml format. That file holds nearly everything the Device Library needs, and baken builds the stick from it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;From the XML&lt;/strong&gt;: title, artist, BPM, key, colour, rating, playlists, beat grid and cues. The key shows on the player the way the XML spells it, &lt;code&gt;Am&lt;/code&gt; as &lt;code&gt;Am&lt;/code&gt; and &lt;code&gt;8A&lt;/code&gt; as &lt;code&gt;8A&lt;/code&gt;, as on a stick rekordbox exports&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Copied from rekordbox&lt;/strong&gt;: the waveforms and phrases, from the analysis rekordbox keeps on your computer (&lt;code&gt;~/Library/Pioneer/rekordbox/share/PIONEER/USBANLZ&lt;/code&gt; on a Mac, or &lt;code&gt;PIONEER/Master/share/PIONEER/USBANLZ&lt;/code&gt; on a library drive). On the way the path is rewritten, the cues are filled in from the XML and the phrase data is masked, exactly as rekordbox does at export time. Tracks rekordbox never analysed are listed and left out&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My Settings&lt;/strong&gt; are copied from rekordbox's settings folder, where rekordbox writes them once Preferences → DJ System → My Settings has been opened in EXPORT mode. Leave them out and the player keeps its own settings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audio&lt;/strong&gt; is copied only when it is missing from the stick or differs in size, so a second run after a playlist change is quick. &lt;code&gt;export.pdb&lt;/code&gt; is rebuilt on every run&lt;/li&gt;
&lt;li&gt;The result is byte-checked against real rekordbox exports (design record: &lt;a href="https://github.com/M-Igashi/baken/issues/115" rel="noopener noreferrer"&gt;#115&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tracks rekordbox has never seen, such as a Mixxx or Traktor library converted to &lt;code&gt;collection.xml&lt;/code&gt;, can have their analysis generated from the audio instead: &lt;code&gt;--generate-analysis&lt;/code&gt; on the command line, Generate missing analysis in the Mac app.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Copied (the default)&lt;/th&gt;
&lt;th&gt;Generated&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Source&lt;/td&gt;
&lt;td&gt;rekordbox's own analysis files&lt;/td&gt;
&lt;td&gt;Computed from the audio by baken&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Beat grid and cues&lt;/td&gt;
&lt;td&gt;From the XML&lt;/td&gt;
&lt;td&gt;From the XML. A track with no &lt;code&gt;TEMPO&lt;/code&gt; in the XML gets no beat grid&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Waveforms&lt;/td&gt;
&lt;td&gt;rekordbox's own&lt;/td&gt;
&lt;td&gt;The scrolling waveform matches rekordbox's to the pixel on the tracks checked; the colour, three-band and preview waveforms are close approximations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Phrases&lt;/td&gt;
&lt;td&gt;rekordbox's own&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Played on CDJs by testers&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A track that has a rekordbox analysis is copied even with generation on, because copying is exact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Format the stick: FAT32 on a Master Boot Record
&lt;/h2&gt;

&lt;p&gt;Format the stick as &lt;strong&gt;FAT32 with a Master Boot Record (MBR) partition table&lt;/strong&gt;, the one combination every player reads. A CDJ-2000NXS2 or older reads neither exFAT nor a GPT disk and does not show such a stick at all. (The players' manuals also list FAT16 and HFS+.)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stick&lt;/th&gt;
&lt;th&gt;CDJ-2000NXS2 and older&lt;/th&gt;
&lt;th&gt;CDJ-3000&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;FAT32, MBR&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;exFAT&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT partition table&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;✗ (AlphaTheta lists it as unsupported)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NTFS&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On a Mac, open Disk Utility, choose View → Show All Devices, select the stick itself rather than its volume, and Erase it with Format MS-DOS (FAT) and Scheme Master Boot Record. In Terminal, &lt;code&gt;diskutil eraseDisk FAT32 MYUSB MBRFormat /dev/diskN&lt;/code&gt; does the same. Find N with &lt;code&gt;diskutil list&lt;/code&gt; first, because the wrong number erases the wrong disk. &lt;code&gt;expressport&lt;/code&gt; (on macOS and Linux) and the Mac app's pre-flight read the stick's filesystem and partition table before writing, and warn when they rule out a player.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which players
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Player&lt;/th&gt;
&lt;th&gt;Library it reads&lt;/th&gt;
&lt;th&gt;A stick written by baken&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CDJ-3000&lt;/td&gt;
&lt;td&gt;Device Library&lt;/td&gt;
&lt;td&gt;✓ Played, firmware 3.22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CDJ-2000NXS2&lt;/td&gt;
&lt;td&gt;Device Library&lt;/td&gt;
&lt;td&gt;✓ Played, firmware 1.85 and 1.87&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XDJ-XZ and older Device Library players&lt;/td&gt;
&lt;td&gt;Device Library&lt;/td&gt;
&lt;td&gt;Same format, no player report yet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CDJ-3000X, XDJ-AZ, OPUS-QUAD, OMNIS-DUO&lt;/td&gt;
&lt;td&gt;OneLibrary&lt;/td&gt;
&lt;td&gt;Written with &lt;code&gt;--onelibrary&lt;/code&gt; (4.5.0) or the Mac app's Write OneLibrary too (1.3.0), no player report yet (without it, CDJ-3000X: "OneLibrary not found")&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On the CDJ-3000 and the CDJ-2000NXS2, testers checked playlists, beat grid, waveforms, cues, keys, search and My Settings, with copied and with generated analysis, on libraries of up to 1,121 tracks (&lt;a href="https://github.com/M-Igashi/baken/issues/116" rel="noopener noreferrer"&gt;#116&lt;/a&gt;, where reports on other players are welcome). Those sticks were written by the command line; the Mac app runs the same export code. Players older than the NXS2 are only dependable with MP3: &lt;code&gt;--cdjsafe&lt;/code&gt;, CDJ Safe in the Mac app, converts every track to 320 kbps CBR MP3 on the way and keeps the source track's analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  rekordbox 7: "We have found a library inconsistency on the device you are using"
&lt;/h2&gt;

&lt;p&gt;rekordbox 7 can show this when a stick is attached, followed by two lists, &lt;em&gt;Playlists found only in Device Library&lt;/em&gt; and &lt;em&gt;Playlists found only in OneLibrary&lt;/em&gt;, and an offer to export the playlists that differ. It means the stick carries two libraries that no longer agree.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why it happens
&lt;/h3&gt;

&lt;p&gt;rekordbox 7 writes two libraries on a stick, side by side in &lt;code&gt;PIONEER/rekordbox&lt;/code&gt;. The &lt;strong&gt;Device Library&lt;/strong&gt; (&lt;code&gt;export.pdb&lt;/code&gt; and &lt;code&gt;exportExt.pdb&lt;/code&gt;) is what the CDJ-3000, the CDJ-2000NXS2 and older players read. &lt;strong&gt;OneLibrary&lt;/strong&gt; (&lt;code&gt;exportLibrary.db&lt;/code&gt;, with &lt;code&gt;exportLibrary.db-wal&lt;/code&gt; and &lt;code&gt;exportLibrary.db-shm&lt;/code&gt; next to it) is what the CDJ-3000X, XDJ-AZ, OPUS-QUAD and OMNIS-DUO read. Each keeps its own copy of the playlists, so when something rewrites one and leaves the other, the two disagree. On our side that was &lt;code&gt;baken expressport&lt;/code&gt; up to 4.3.1: it replaced &lt;code&gt;export.pdb&lt;/code&gt; on a stick rekordbox had exported to and left rekordbox's OneLibrary and &lt;code&gt;exportExt.pdb&lt;/code&gt; where they were (&lt;a href="https://github.com/M-Igashi/baken/issues/208" rel="noopener noreferrer"&gt;#208&lt;/a&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  What it breaks
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;rekordbox flags the stick. Accept its offer and it writes its own playlists back onto the stick&lt;/li&gt;
&lt;li&gt;OneLibrary players read &lt;code&gt;exportLibrary.db&lt;/code&gt;, so they show the old library rather than the one written last. If old files were pruned since, its tracks can point at audio that is gone&lt;/li&gt;
&lt;li&gt;What a player makes of a stale &lt;code&gt;exportExt.pdb&lt;/code&gt; next to a newer &lt;code&gt;export.pdb&lt;/code&gt; is not known, and neither is which of the two libraries a CDJ-3000 reads when a stick carries both&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to fix it
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;The stick is&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Exported by rekordbox, and stays a rekordbox stick&lt;/td&gt;
&lt;td&gt;Let rekordbox write both libraries again: export the playlists again from rekordbox (accepting its offer does that for the ones that differ). For a clean start, format the stick as FAT32 on MBR and export from rekordbox&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Written by baken&lt;/td&gt;
&lt;td&gt;Run the export again with baken 4.4.0 or later, or Bake'n Deck for Mac 1.2.0. It removes the stale OneLibrary files once &lt;code&gt;export.pdb&lt;/code&gt; is written. By hand, delete &lt;code&gt;exportLibrary.db&lt;/code&gt;, &lt;code&gt;exportLibrary.db-wal&lt;/code&gt;, &lt;code&gt;exportLibrary.db-shm&lt;/code&gt; and &lt;code&gt;exportExt.pdb&lt;/code&gt; from &lt;code&gt;PIONEER/rekordbox&lt;/code&gt;. Accepting rekordbox's offer on this stick would write rekordbox's playlists onto it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Since 4.4.0, &lt;code&gt;expressport&lt;/code&gt; lists those files in its plan, and in &lt;code&gt;--dry-run&lt;/code&gt;, before anything is written. It removes them only after &lt;code&gt;export.pdb&lt;/code&gt; is written, so a cancelled or failed run leaves both libraries as they were. The Mac app names them in its pre-flight and asks before it replaces the library. A CDJ-3000X then shows "OneLibrary not found" rather than the old library, unless the command line ran with &lt;code&gt;--onelibrary&lt;/code&gt;, which writes a new OneLibrary in their place. The warning can come back if rekordbox opens the stick again, because rekordbox rewrites a library it opens (see the questions below).&lt;/p&gt;

&lt;h2&gt;
  
  
  How to export to USB without opening rekordbox
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prep in rekordbox and export the XML&lt;/strong&gt;
Analyse the tracks and set beat grids, cues and playlists in rekordbox as usual, then File → Export Collection in xml format. Save it to the same path every time, for example ~/Music/rekordbox/collection.xml.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Format a stick of its own&lt;/strong&gt;
FAT32 with a Master Boot Record partition table, so every player reads it. Keep it separate from the stick rekordbox exports to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run the export&lt;/strong&gt;
On the command line: baken expressport ~/Music/rekordbox/collection.xml --device /Volumes/MYUSB --playlist "Sets/Friday". In the Mac app: open USB Export, choose the XML and the stick, tick the playlists and Validate, read the pre-flight, then Export.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Eject and check it on a player&lt;/strong&gt;
Before the gig, put the stick in a player and look at the playlists, waveforms, beat grid, cues and search. Check it on the player rather than in rekordbox, which rewrites a library it opens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run it again after a change&lt;/strong&gt;
When playlists change, export the XML again and run the same export. Only new audio and changed analysis files are written; export.pdb is rebuilt every run.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Terminal: expressport
$ baken expressport ~/Music/rekordbox/collection.xml --device /Volumes/MYUSB --playlist "Sets/Friday"
▸ Device: /Volumes/MYUSB (name MYUSB)
▸ Playlists: Sets/Friday
▸ Tracks: 62 (3312 analysis files indexed under ~/Library/Pioneer/rekordbox/share/PIONEER/USBANLZ)
▸ My Settings from ~/Library/Application Support/Pioneer/rekordbox6
✓ Done! 62 tracks in the device library.
• 62 audio files copied
• 186 analysis files written
• /Volumes/MYUSB/PIONEER/rekordbox/export.pdb
• 4 My Settings files in /Volumes/MYUSB/PIONEER/
$ baken expressport ~/Music/rekordbox/collection.xml --device /Volumes/OLDSTICK --playlist "Sets/Friday" --dry-run
▸ Device: /Volumes/OLDSTICK (name OLDSTICK)
⚠ This stick also carries rekordbox's OneLibrary (exportLibrary.db, exportLibrary.db-wal, exportLibrary.db-shm, exportExt.pdb). expressport writes the Device Library only, so writing export.pdb removes them. OneLibrary players (CDJ-3000X, XDJ-AZ, OPUS-QUAD, OMNIS-DUO) will then show "OneLibrary not found" instead of rekordbox's old library.
▸ Playlists: Sets/Friday
ℹ Dry run; nothing written.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Flags worth knowing
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Flag&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--playlist PATH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A playlist to export; repeat it for more. Without it, every playlist in the XML&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--dry-run&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Resolve and report, write nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--generate-analysis&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Compute the analysis from the audio for tracks rekordbox never analysed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--cdjsafe&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;320 kbps CBR MP3 for every track (needs ffmpeg)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--no-settings&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Write no My Settings; the player keeps its own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--prune&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delete audio and analysis on the stick that this export no longer references&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;baken expressport --help&lt;/code&gt; lists them all. Installation is on the &lt;a href="https://baken.ravers.workers.dev/#install" rel="noopener noreferrer"&gt;front page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  USB Export in Bake'n Deck for Mac
&lt;/h2&gt;

&lt;p&gt;The USB Export page in &lt;a href="https://apps.apple.com/app/baken-deck/id6808813823" rel="noopener noreferrer"&gt;Bake'n Deck for Mac&lt;/a&gt; (1.2.0 and later) runs the same export code in a window, for DJs who would rather not open a Terminal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose the collection XML and the stick itself (for example &lt;code&gt;/Volumes/REKORDBOX&lt;/code&gt;), tick the playlists and Validate. The first time, the app asks for access to rekordbox's analysis folder, and to its settings folder when My Settings are copied. It remembers both&lt;/li&gt;
&lt;li&gt;The pre-flight shows the stick's format (with a warning for exFAT, NTFS or a GPT disk), the tracks that will be skipped and why, how much audio will be written and roughly how long it will take. On a stick rekordbox exported to, it names the OneLibrary files that will be removed&lt;/li&gt;
&lt;li&gt;Options: CDJ Safe (320 kbps CBR MP3 on the way), Generate missing analysis, Copy My Settings and Remove old files. The last three stay off until you turn them on&lt;/li&gt;
&lt;li&gt;If the stick carries a library the app did not write last, or rekordbox's OneLibrary files, a dialog asks before the library is replaced and says that the OneLibrary files go too&lt;/li&gt;
&lt;li&gt;The report counts the audio files copied, converted and already on the stick, the analysis files written, and the rekordbox library files removed. Reveal and Eject follow the run, and a re-run writes only what changed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How long it takes
&lt;/h2&gt;

&lt;p&gt;An export runs at the stick's write speed plus about 0.4 s per track, which is what a FAT32 stick takes to create the folder and the three analysis files the format wants for each track (measured on macOS 26: a new directory 150 ms, a file create 27 ms, a write and close 25 ms).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A USB 3 stick that writes 25 MB/s needs about 40 s per GB&lt;/li&gt;
&lt;li&gt;Many sticks slow down once warm. A 62-track, 3.3 GB playlist took 339 s on a cold stick and about 450 s later; copying the same files with &lt;code&gt;cp -R&lt;/code&gt; took 410 to 533 s&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--cdjsafe&lt;/code&gt; adds the encoding, a few seconds per track&lt;/li&gt;
&lt;li&gt;A second run copies only new or changed audio, so it is much quicker&lt;/li&gt;
&lt;li&gt;On Linux, check the mount options: udisks2 mounts FAT sticks with &lt;code&gt;flush&lt;/code&gt;, which sends every closed file to the device at once, and cheap sticks are slow at that (&lt;a href="https://github.com/M-Igashi/baken/issues/173" rel="noopener noreferrer"&gt;#173&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Mac app's pre-flight estimates a little more conservatively, about half a second per track.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does this touch my rekordbox library?
&lt;/h3&gt;

&lt;p&gt;No. baken never reads or writes rekordbox's own database. It reads the collection XML you export from rekordbox, copies rekordbox's analysis files and My Settings, and writes only to the stick. Your prep stays in rekordbox, and so does the management of your library.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is this a replacement for rekordbox?
&lt;/h3&gt;

&lt;p&gt;No. Analysis, beat grids, cues and playlists are made in rekordbox, and the waveforms on the stick are rekordbox's own analysis files, copied. baken only takes over the last step, writing the stick, from the collection XML rekordbox exports. Where rekordbox is still the safer route, such as a gig stick for a OneLibrary player, this guide says so.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it work with the CDJ-3000X, XDJ-AZ, OPUS-QUAD or OMNIS-DUO?
&lt;/h3&gt;

&lt;p&gt;Not confirmed yet. Those players read OneLibrary (exportLibrary.db) instead of the Device Library (export.pdb). Since baken 4.5.0 the command line also writes OneLibrary with --onelibrary, but no such player has read one yet, so please report what yours shows in issue #139 on GitHub. The Mac app does the same with Write OneLibrary too, since 1.3.0. Without either, the stick carries the Device Library only, and a CDJ-3000X shows OneLibrary not found. Until reports come in, export a gig stick for those players from rekordbox.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use the same stick with rekordbox too?
&lt;/h3&gt;

&lt;p&gt;No. Give baken a stick of its own. rekordbox rewrites a device library it opens, and even changes a stick that is only mounted while it runs: rbsync measured it deleting 768 of 5,825 playlist entries from a stick it opened and adding an exportLibrary.db. Check a baken stick on a player, not by opening it in rekordbox. If rekordbox did get to it, run the export again: it rewrites export.pdb and removes the exportLibrary.db.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does rekordbox 7 say it found a library inconsistency on my stick?
&lt;/h3&gt;

&lt;p&gt;Because the stick carries rekordbox 7's two libraries, the Device Library and OneLibrary, and they no longer list the same playlists, usually because something rewrote one and left the other. If the stick belongs to rekordbox, export again from rekordbox, or format the stick and export from scratch. On a baken stick, run the export again with baken 4.4.0 or later or Bake'n Deck for Mac 1.2.0, which removes the stale OneLibrary files, or delete exportLibrary.db, its -wal and -shm files and exportExt.pdb by hand.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are hot cues, memory cues and loops exported?
&lt;/h3&gt;

&lt;p&gt;Yes, from the XML, with hot cues A to H and, since 4.5.0, the colours set in rekordbox. Active loops have no field in the XML, so a memory loop whose comment starts with [active] becomes the track's active loop, and the marker is left out of the comment the player shows. rekordbox's XML does not say which loop is active, so a loop set active in rekordbox needs the marker in its comment as well. Active loops are new in baken 4.4.0 and have not been tried on a player yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is artwork exported?
&lt;/h3&gt;

&lt;p&gt;By the command line, since baken 4.5.0: --artwork puts the picture embedded in each audio file on the stick, in the sizes rekordbox writes. MP3, AIFF, FLAC and M4A are covered, WAV is not. The Mac app does the same with Add artwork, since 1.3.0.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need rekordbox installed?
&lt;/h3&gt;

&lt;p&gt;Normally yes, on the same computer or on an attached library drive, because the waveforms and My Settings are copied from rekordbox's own files. Without rekordbox, for example with a Mixxx or Traktor library converted to collection.xml, use --generate-analysis for the waveforms, and either --settings-dir pointing at the My Settings files from any stick rekordbox once exported, or --no-settings. In the Mac app, turn on Generate missing analysis and leave Copy My Settings off.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is it free?
&lt;/h3&gt;

&lt;p&gt;The baken command line, expressport included, is free and MIT licensed for macOS, Windows and Linux. Bake'n Deck for Mac, with its USB Export page, is a one-time purchase on the Mac App Store, with no subscription.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get USB Export
&lt;/h2&gt;

&lt;p&gt;Bake'n Deck for Mac 1.3.1 is on the Mac App Store: USB Export with its pre-flight and report, next to Headroom, Sort and CDJ Safe. The baken command line, expressport included, is free and MIT licensed: &lt;code&gt;brew install M-Igashi/tap/baken&lt;/code&gt; on macOS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://apps.apple.com/app/baken-deck/id6808813823" rel="noopener noreferrer"&gt;Download on the Mac App Store&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://baken.ravers.workers.dev/" rel="noopener noreferrer"&gt;See all the tools →&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related guides
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://baken.ravers.workers.dev/auto-gain" rel="noopener noreferrer"&gt;rekordbox Auto Gain: why it does not reach your CDJ&lt;/a&gt;: Where the number stops, and what writing the gain into the file changes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://baken.ravers.workers.dev/loudness-normalization" rel="noopener noreferrer"&gt;Loudness normalization for DJs: a LUFS target or a true peak ceiling?&lt;/a&gt;: Two ways to even out levels in the file, what each changes, what each leaves to the DJ, and where rekordbox's Auto Gain fits.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://baken.ravers.workers.dev/sort" rel="noopener noreferrer"&gt;How to sort a rekordbox playlist by key and BPM&lt;/a&gt;: Alphanumeric key, then BPM, written into the playlist so the CDJ plays it in that order.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://baken.ravers.workers.dev/measurement" rel="noopener noreferrer"&gt;How Headroom measures loudness and true peak&lt;/a&gt;: In-process BS.1770-4 instead of ffmpeg loudnorm: 15x faster per file, 1,036 tracks in 20 s, with the parity numbers.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>rust</category>
      <category>cli</category>
      <category>opensource</category>
      <category>music</category>
    </item>
    <item>
      <title>What a USB export touches: Bake'n Deck and rbxport, measured on the same stick</title>
      <dc:creator>Jesse Pinkman</dc:creator>
      <pubDate>Fri, 06 Nov 2026 09:22:17 +0000</pubDate>
      <link>https://dev.to/jphfa/what-a-usb-export-touches-baken-deck-and-rbxport-measured-on-the-same-stick-4eee</link>
      <guid>https://dev.to/jphfa/what-a-usb-export-touches-baken-deck-and-rbxport-measured-on-the-same-stick-4eee</guid>
      <description>&lt;p&gt;There are now two ways to make a CDJ stick without rekordbox's own export. One reads what rekordbox hands out: the collection XML it exports and the analysis files it writes. That is how Bake'n Deck works. The other opens rekordbox's library database, &lt;code&gt;master.db&lt;/code&gt;, directly. That is how rbxport works, by its own description "a music library management app inspired by rekordbox" that edits the rekordbox library in place.&lt;/p&gt;

&lt;p&gt;We built Bake'n Deck on the first approach and say so on every page, so we owed a measurement rather than an argument. We exported the same rekordbox playlist with both tools onto the same USB stick, timed every run, and recorded every file each tool changed outside the stick.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Machine:&lt;/strong&gt; MacBook Air 13-inch (M3, 24 GB), macOS 27.0.1, on mains power. Both tools ran in a fresh macOS user account created for the test, so neither could reach our working rekordbox library.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stick:&lt;/strong&gt; SanDisk USB 3.2 Gen 1, 61.5 GB, FAT32 on MBR, emptied before every run except the re-export runs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Library:&lt;/strong&gt; rekordbox 7.2.18 in the test account, 200 tracks copied from a working DJ library (9.0 GB), imported and analysed by rekordbox, one playlist with all 200. The mix is what that library holds: 91 FLAC (16 and 24-bit, 44.1 and 48 kHz), 82 AIFF, 16 MP3, 10 M4A, and 1 WAV. Four of the M4A files turned out to be damaged, which became part of the result (see below).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bake'n Deck:&lt;/strong&gt; the &lt;code&gt;baken expressport&lt;/code&gt; command line at 4.8.0, the engine inside Bake'n Deck for Mac 1.4.0, reading the collection XML rekordbox exported. For conversion it called Homebrew's ffmpeg 9.0.2; the Mac app bundles its own ffmpeg build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rbxport:&lt;/strong&gt; 1.9.0 with its defaults (Library Protection on), driven through its own AppleScript &lt;code&gt;export&lt;/code&gt; command, which returns when the export is done. rbxport always writes both the OneLibrary and the Device Library databases, so Bake'n Deck was run with &lt;code&gt;--onelibrary&lt;/code&gt; too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runs:&lt;/strong&gt; three of each scenario, the tool that went first alternating between rounds, 45 seconds of rest between runs. rbxport's conversion cache was deleted before each conversion run, so every conversion was cold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audit:&lt;/strong&gt; before and after every run, a SHA-256 of every file in rekordbox's library folder (&lt;code&gt;master.db&lt;/code&gt;, the analysis files), rekordbox's settings folder, and the 200 music files, plus a list of every file modified anywhere in the test account's home folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The scripts and the raw results are on GitHub: &lt;a href="https://github.com/M-Igashi/baken/tree/main/bench" rel="noopener noreferrer"&gt;https://github.com/M-Igashi/baken/tree/main/bench&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Speed
&lt;/h2&gt;

&lt;p&gt;Median of three runs, range in brackets. Wall time is from the command until the tool reported the export finished.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Bake'n Deck&lt;/th&gt;
&lt;th&gt;rbxport&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Full export&lt;/strong&gt; onto an empty stick&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;818.6 s&lt;/strong&gt; (735.1 to 821.8), 197 tracks, 9.68 GB&lt;/td&gt;
&lt;td&gt;959.5 s (955.5 to 1071.9), 200 tracks, 9.71 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU time for the full export&lt;/td&gt;
&lt;td&gt;4.8 s&lt;/td&gt;
&lt;td&gt;32.5 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Re-export&lt;/strong&gt; right after, nothing changed&lt;/td&gt;
&lt;td&gt;3.6 s (2.8 to 3.6)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;0.6 s&lt;/strong&gt; (0.6 to 0.6)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;With conversion for older players&lt;/strong&gt; onto an empty stick&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;382.7 s&lt;/strong&gt; (365.1 to 415.8): 188 tracks converted to 320 kbps MP3, 9 MP3s copied, 2.68 GB&lt;/td&gt;
&lt;td&gt;1913.3 s (1899.3 to 1916.4): 97 tracks converted to 320 kbps MP3, 99 copied as they were, 6.52 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU time for the conversion run&lt;/td&gt;
&lt;td&gt;638.6 s&lt;/td&gt;
&lt;td&gt;1093.9 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The full export is mostly waiting for the stick.&lt;/strong&gt; Both tools spent most of the run writing about 9.7 GB to a USB stick, at 11.8 MB/s for Bake'n Deck and 10.1 MB/s for rbxport. Bake'n Deck finished 141 seconds sooner (15%) and used about a seventh of the CPU time. rbxport wrote three more tracks (see below) and one more database file (&lt;code&gt;exportExt.pdb&lt;/code&gt;), about 37 MB more in all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rbxport re-exports faster.&lt;/strong&gt; With nothing changed, rbxport reported "Already up to date" in 0.6 seconds. Bake'n Deck copied no audio again either but rewrote its two databases, &lt;code&gt;export.pdb&lt;/code&gt; and OneLibrary, in 3.6 seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The conversion runs did different work, so read them with that in mind.&lt;/strong&gt; Bake'n Deck's CDJ Safe turns every track that is not already a compliant MP3 into a 320 kbps CBR MP3, AIFF and WAV included. rbxport's Maximum CDJ compatibility, set to MP3, converts what it considers incompatible (here FLAC and M4A) and copies MP3, AIFF, and WAV as they are. Bake'n Deck converted almost twice as many tracks and still finished in a fifth of the time, using several CPU cores at once, and its stick holds 2.68 GB against 6.52 GB because everything on it is MP3.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What each tool wrote outside the stick
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Bake'n Deck&lt;/th&gt;
&lt;th&gt;rbxport&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;master.db&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Never opened. The source code contains no reference to it&lt;/td&gt;
&lt;td&gt;Opened. On its first launch rbxport created &lt;code&gt;master.db-wal&lt;/code&gt; (0 bytes) and &lt;code&gt;master.db-shm&lt;/code&gt; (32 KB) beside it, which stay after it quits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;master.db&lt;/code&gt; contents during 9 exports&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rekordbox's analysis files and settings&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The 200 music files&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elsewhere in the home folder&lt;/td&gt;
&lt;td&gt;Nothing&lt;/td&gt;
&lt;td&gt;Its own records in &lt;code&gt;~/Library/Application Support/rbxport&lt;/code&gt;: 362 files during a full export, about 590 during a conversion run (its conversion cache)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With its default Library Protection on, rbxport did not change rekordbox's database while exporting. That is the measured result and we report it as such. The difference that remains is the one the two approaches are built on: rbxport opens rekordbox's encrypted database and, with Library Protection off, writes to it (track edits, and its Import from a stick, which brings cues, beat grids, play history, and ratings back into the library), as its own documentation describes. Bake'n Deck never opens that database at all, with protection or without, because it never needs to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Damaged files
&lt;/h2&gt;

&lt;p&gt;A working library is not a clean one. Three of the M4A files in the sample were truncated (no &lt;code&gt;moov&lt;/code&gt; atom, unplayable anywhere), and a fourth opens normally but carries corrupt audio data: ffmpeg decodes it as noise.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Bake'n Deck&lt;/th&gt;
&lt;th&gt;rbxport&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3 truncated M4A, full export&lt;/td&gt;
&lt;td&gt;Left out, each named in a warning&lt;/td&gt;
&lt;td&gt;Copied onto the stick&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 truncated M4A, conversion&lt;/td&gt;
&lt;td&gt;Left out, each named in a warning&lt;/td&gt;
&lt;td&gt;Reported as failed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AAC with corrupt audio, full export&lt;/td&gt;
&lt;td&gt;Copied as it is&lt;/td&gt;
&lt;td&gt;Copied as it is&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AAC with corrupt audio, conversion&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Converted into noise without a warning (a bug, now fixed, see below)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Reported as failed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The bug this test found in Bake'n Deck.&lt;/strong&gt; CDJ Safe handed the damaged file to ffmpeg, which decoded it as noise, logged 1,667 decoding errors, and still exited normally. Bake'n Deck trusted the exit status and counted the track as converted. The resulting MP3 is 334 seconds of noise at an average of -9.5 dB (the original is 373 seconds), which a CDJ would play as loud noise in the booth. rbxport reported the same file as failed. We fixed it the day we found it: since baken 4.10.0 a conversion fails when ffmpeg reports more than ten decoding errors, and the track is left out and named with the reason (&lt;a href="https://github.com/M-Igashi/baken/pull/299" rel="noopener noreferrer"&gt;#299&lt;/a&gt;). Bake'n Deck for Mac 1.4.1 ships the fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we take from it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If you want your library to stay rekordbox's, written only by rekordbox, Bake'n Deck is built for that: it reads the XML rekordbox exports and never opens &lt;code&gt;master.db&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;On this machine and this stick, Bake'n Deck wrote a full stick 15% faster and converted for older players about five times faster; rbxport re-exported an unchanged stick six times faster.&lt;/li&gt;
&lt;li&gt;rbxport left the database untouched during these exports with its default protection, and it caught the damaged file that Bake'n Deck did not, until 4.10.0.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits of this test
&lt;/h2&gt;

&lt;p&gt;One machine, one stick, one library sample of 200 tracks, three runs each. The sticks were not played on hardware for this test; sticks written by Bake'n Deck have been read on a CDJ-3000 and a CDJ-2000NXS2 before. Bake'n Deck was measured through its command line, which runs the same engine as the Mac app. Memory use is not compared, because one tool is a desktop app with a window and the other was a command line. rbxport was measured at 1.9.0 and changes quickly; anyone can rerun the same scripts.&lt;/p&gt;

&lt;p&gt;Measured 2026-11-05 and 06. Sources for rbxport's behaviour: its README, its USB export and AppleScript guides, and its release notes, read 2026-11-05.&lt;/p&gt;

</description>
      <category>performance</category>
      <category>software</category>
      <category>tools</category>
    </item>
    <item>
      <title>rekordbox sorts by key or by BPM, never both, and the sort never reaches the CDJ</title>
      <dc:creator>Jesse Pinkman</dc:creator>
      <pubDate>Fri, 18 Sep 2026 17:51:27 +0000</pubDate>
      <link>https://dev.to/jphfa/rekordbox-sorts-by-key-or-by-bpm-never-both-and-the-sort-never-reaches-the-cdj-bm7</link>
      <guid>https://dev.to/jphfa/rekordbox-sorts-by-key-or-by-bpm-never-both-and-the-sort-never-reaches-the-cdj-bm7</guid>
      <description>&lt;p&gt;A warm-up set usually wants two things at once: keys that sit next to each other on the Camelot wheel, and BPM rising inside each key. rekordbox cannot express that, and neither can the players.&lt;/p&gt;

&lt;p&gt;Press &lt;em&gt;Sort by Key&lt;/em&gt; on a CDJ and the tracks group by key, but inside &lt;code&gt;1A&lt;/code&gt; the BPMs come out in whatever order you dragged them into the playlist. Press &lt;em&gt;Sort by BPM&lt;/em&gt; and the BPM lines up while the keys scatter. There is no compound sort in the UI, on the desktop or on the deck.&lt;/p&gt;

&lt;p&gt;That is the visible half of the problem. The half that costs you a set is this: &lt;strong&gt;sorting on a player is a view.&lt;/strong&gt; It never changes the order stored in the playlist, and the order stored in the playlist is what a CDJ reads off the USB stick. Toggle &lt;em&gt;Sort by Key&lt;/em&gt; on the laptop, export, and the deck plays the original order back at you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Six tracks, three sorts
&lt;/h2&gt;

&lt;p&gt;Registration order, which is also the stored order:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Track&lt;/th&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;BPM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;1A&lt;/td&gt;
&lt;td&gt;130&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;2A&lt;/td&gt;
&lt;td&gt;124&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;1A&lt;/td&gt;
&lt;td&gt;124&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;2B&lt;/td&gt;
&lt;td&gt;130&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;E&lt;/td&gt;
&lt;td&gt;2A&lt;/td&gt;
&lt;td&gt;128&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;F&lt;/td&gt;
&lt;td&gt;2B&lt;/td&gt;
&lt;td&gt;124&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The same six tracks under each sort:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Sort by Key&lt;/th&gt;
&lt;th&gt;Sort by BPM&lt;/th&gt;
&lt;th&gt;Compound (key → BPM)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;A · 1A · 130&lt;/td&gt;
&lt;td&gt;C · 1A · 124&lt;/td&gt;
&lt;td&gt;C · 1A · 124&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;C · 1A · 124&lt;/td&gt;
&lt;td&gt;B · 2A · 124&lt;/td&gt;
&lt;td&gt;A · 1A · 130&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;B · 2A · 124&lt;/td&gt;
&lt;td&gt;F · 2B · 124&lt;/td&gt;
&lt;td&gt;B · 2A · 124&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;E · 2A · 128&lt;/td&gt;
&lt;td&gt;E · 2A · 128&lt;/td&gt;
&lt;td&gt;E · 2A · 128&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;D · 2B · 130&lt;/td&gt;
&lt;td&gt;A · 1A · 130&lt;/td&gt;
&lt;td&gt;F · 2B · 124&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;F · 2B · 124&lt;/td&gt;
&lt;td&gt;D · 2B · 130&lt;/td&gt;
&lt;td&gt;D · 2B · 130&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Sort by key and the BPM inside &lt;code&gt;1A&lt;/code&gt; and &lt;code&gt;2B&lt;/code&gt; runs 130 → 124, the opposite direction of a warm-up. Sort by BPM and the key walks &lt;code&gt;1A → 2A → 2B → 2A → 1A → 2B&lt;/code&gt;, a tour of the wheel that ignores harmonic adjacency. Only the third column keeps the keys ascending and the BPM rising inside each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where you can write the order
&lt;/h2&gt;

&lt;p&gt;rekordbox exports its library as an XML file, and it will read that file back in as a second tree in the sidebar, the &lt;code&gt;rekordbox xml&lt;/code&gt; tree, alongside your real library. The playlists in that file are lists of &lt;code&gt;&amp;lt;TRACK Key="…"/&amp;gt;&lt;/code&gt; references, and their order is the stored order.&lt;/p&gt;

&lt;p&gt;So the fix is to rewrite the references:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;baken rbsort ~/Music/rekordbox/collection.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Camelot key ascending as the primary key, BPM ascending as the tiebreaker inside each key group. Tracks with no Camelot key sort after all known keys. Nothing else in the file changes: names, folder structure, &lt;code&gt;Count&lt;/code&gt; and &lt;code&gt;Entries&lt;/code&gt; attributes and whitespace are all preserved byte for byte, which means running it twice is a no-op and it can safely run on every export.&lt;/p&gt;

&lt;p&gt;Your actual library is never touched. The sorted playlists show up in the separate &lt;code&gt;rekordbox xml&lt;/code&gt; tree, you drag the one you want into your real playlists, switch to EXPORT mode and write the USB. The deck plays it in that order in its default browse screen, with nothing to do on the night.&lt;/p&gt;

&lt;p&gt;Two things worth knowing before you run it. Keys have to be in Camelot notation, which is &lt;em&gt;Preferences → View → Key display format → Alphanumeric&lt;/em&gt;; if they are not, the tool stops rather than guessing. And the &lt;code&gt;rekordbox xml&lt;/code&gt; tree is a different sidebar tree from &lt;code&gt;Playlists&lt;/code&gt;, which is the single most common reason people think nothing happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not just ask for the feature
&lt;/h2&gt;

&lt;p&gt;Even if rekordbox shipped a compound sort tomorrow, it would be a view, and the CDJ would still read the stored order. The same is true of Auto Gain: rekordbox works out a per-track gain, applies it in performance mode, and never writes it into the file, so a player reading USB has no idea it exists. Anything that lives only in the laptop app does not follow the music onto the deck. The general move is to bake it into the thing that travels.&lt;/p&gt;

&lt;p&gt;The tool is &lt;code&gt;baken&lt;/code&gt;, MIT, Rust, macOS, Windows and Linux: &lt;a href="https://github.com/M-Igashi/baken" rel="noopener noreferrer"&gt;https://github.com/M-Igashi/baken&lt;/a&gt;. &lt;code&gt;rbsort&lt;/code&gt; needs nothing but the XML, not even ffmpeg. There is a native Mac app too, which shows the resulting order before it writes anything, but the command line does the same sort and stays free.&lt;/p&gt;

&lt;p&gt;Full version of this write-up, which is the canonical one: &lt;a href="https://baken.ravers.workers.dev/sort" rel="noopener noreferrer"&gt;https://baken.ravers.workers.dev/sort&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;rekordbox, CDJ and Pioneer DJ are trademarks of AlphaTheta Corporation. This project is not affiliated with or endorsed by AlphaTheta Corporation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>cli</category>
      <category>opensource</category>
      <category>music</category>
    </item>
    <item>
      <title>I rewrote mp3gain in Rust — 'compatible' turned out to be three different things</title>
      <dc:creator>Jesse Pinkman</dc:creator>
      <pubDate>Sat, 02 May 2026 21:29:13 +0000</pubDate>
      <link>https://dev.to/jphfa/i-rewrote-mp3gain-in-rust-compatible-turned-out-to-be-three-different-things-4fbc</link>
      <guid>https://dev.to/jphfa/i-rewrote-mp3gain-in-rust-compatible-turned-out-to-be-three-different-things-4fbc</guid>
      <description>&lt;p&gt;If you maintain a podcast, music server, or any audio pipeline that needs consistent volume across files, there's a non-trivial chance you have one of these somewhere:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;RUN &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; mp3gain
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Or in a beets config:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;replaygain&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;command&lt;/span&gt;
  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mp3gain&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Or buried in a cron job from 2014.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mp3gain&lt;/code&gt; was written in C by Glen Sawyer in 2003. Upstream development stopped around 2009. Distributors (Debian, Ubuntu, Homebrew) keep it alive with security patches, but no new features have shipped in 15+ years. Its AAC counterpart &lt;code&gt;aacgain&lt;/code&gt; died around the same time and doesn't even build cleanly on modern 64-bit systems.&lt;/p&gt;

&lt;p&gt;People keep using both because the popular alternatives — &lt;code&gt;loudgain&lt;/code&gt;, &lt;code&gt;rsgain&lt;/code&gt;, &lt;code&gt;ffmpeg loudnorm&lt;/code&gt; — solve a &lt;em&gt;related&lt;/em&gt; problem (writing ReplayGain tags) but not the &lt;em&gt;same&lt;/em&gt; problem. A tag-only tool doesn't help when your players ignore tags entirely: DJ hardware, smart speakers, most car audio, podcast publishing pipelines that bake volume into the file. For those, you need the bitstream itself rewritten — losslessly, reversibly, fast.&lt;/p&gt;

&lt;p&gt;Rather than CVE-patch a 22-year-old C codebase one more time, I spent the last year writing &lt;a href="https://github.com/M-Igashi/mp3rgain" rel="noopener noreferrer"&gt;mp3rgain&lt;/a&gt;, a Rust implementation that reads and writes the same files mp3gain does. Halfway through, I realized the word "compatible" was hiding three completely different things.&lt;/p&gt;
&lt;h2&gt;
  
  
  Layer 1 — byte-identical output
&lt;/h2&gt;

&lt;p&gt;The strictest compatibility claim is that the &lt;em&gt;output file&lt;/em&gt; is bit-for-bit identical:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp &lt;/span&gt;original.mp3 a.mp3 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cp &lt;/span&gt;original.mp3 b.mp3
mp3gain  &lt;span class="nt"&gt;-g&lt;/span&gt; 2 a.mp3
mp3rgain &lt;span class="nt"&gt;-g&lt;/span&gt; 2 b.mp3
&lt;span class="nb"&gt;sha256sum &lt;/span&gt;a.mp3 b.mp3
&lt;span class="c"&gt;# → same hash&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To get there, the Rust implementation has to match every detail of the C version's bitstream rewrite: synchronization word detection, MPEG version dispatch, side-information size calculation (which differs by MPEG version × channel mode), and bit-level reads/writes that span byte boundaries.&lt;/p&gt;

&lt;p&gt;I wanted to "clean up" something the C code did awkwardly more than once. Every time I had to remind myself: the moment I lose byte-identical output, I lose the right to call this a drop-in replacement. There's a CI script (&lt;code&gt;scripts/compatibility-test.sh&lt;/code&gt;) that diffs SHA-256 hashes between both tools across MPEG1/2/2.5, mono/stereo/joint stereo, CBR/VBR, and a range of gain values. If even one case mismatches, the PR doesn't merge.&lt;/p&gt;
&lt;h2&gt;
  
  
  Layer 2 — tag interoperability
&lt;/h2&gt;

&lt;p&gt;mp3gain stores undo information in APEv2 tags:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;mp3gain_undo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;-3,-2,N&lt;/span&gt;
&lt;span class="py"&gt;mp3gain_minmax&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;100,148&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If I run &lt;code&gt;mp3gain -g 2&lt;/code&gt;, then later &lt;code&gt;mp3rgain -u&lt;/code&gt;, the undo has to work — and vice versa. This is a different layer from byte-identical output: it's about the &lt;em&gt;metadata block&lt;/em&gt;, not the audio frame data.&lt;/p&gt;

&lt;p&gt;mp3rgain reads and writes the same APEv2 fields with the same string format. There's one intentional break: after &lt;code&gt;-u&lt;/code&gt;, mp3gain leaves an empty APEv2 tag block in place (probably because rewriting it would shift downstream frame offsets). mp3rgain removes the tag completely. The audio data is identical either way and the bidirectional undo property still holds, so I judged this as still "compatible enough."&lt;/p&gt;
&lt;h2&gt;
  
  
  Layer 3 — text protocol
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;mp3gain -o&lt;/code&gt; (no argument) prints a tab-separated table:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csvs"&gt;&lt;code&gt;&lt;span class="k"&gt;File&lt;/span&gt;    &lt;span class="k"&gt;MP&lt;/span&gt;&lt;span class="mf"&gt;3&lt;/span&gt; &lt;span class="k"&gt;gain&lt;/span&gt;    &lt;span class="k"&gt;dB&lt;/span&gt; &lt;span class="k"&gt;gain&lt;/span&gt; &lt;span class="k"&gt;Max&lt;/span&gt; &lt;span class="k"&gt;Amplitude&lt;/span&gt;   &lt;span class="k"&gt;Max&lt;/span&gt; &lt;span class="k"&gt;global&lt;/span&gt;&lt;span class="err"&gt;_&lt;/span&gt;&lt;span class="k"&gt;gain&lt;/span&gt; &lt;span class="k"&gt;Min&lt;/span&gt; &lt;span class="k"&gt;global&lt;/span&gt;&lt;span class="err"&gt;_&lt;/span&gt;&lt;span class="k"&gt;gain&lt;/span&gt;
&lt;span class="k"&gt;song&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="k"&gt;mp&lt;/span&gt;&lt;span class="mf"&gt;3&lt;/span&gt;    &lt;span class="mf"&gt;0&lt;/span&gt;   &lt;span class="mf"&gt;0.0&lt;/span&gt; &lt;span class="mf"&gt;17234&lt;/span&gt;   &lt;span class="mf"&gt;148&lt;/span&gt; &lt;span class="mf"&gt;100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://beets.io/" rel="noopener noreferrer"&gt;beets&lt;/a&gt; parses this with regex. So do an unknown number of personal scripts that have run unmodified for a decade. Change the column order, the header text, or the separator, and you break all of them silently.&lt;/p&gt;

&lt;p&gt;mp3rgain emits the exact same header — one &lt;code&gt;println!&lt;/code&gt; line at &lt;a href="https://github.com/M-Igashi/mp3rgain/blob/master/src/main.rs#L1275" rel="noopener noreferrer"&gt;main.rs:1275&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"File&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s"&gt;MP3 gain&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s"&gt;dB gain&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s"&gt;Max Amplitude&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s"&gt;Max global_gain&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s"&gt;Min global_gain"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;New structured output lives behind &lt;code&gt;-o json&lt;/code&gt;, opt-in, never the default.&lt;/p&gt;
&lt;h2&gt;
  
  
  What I deliberately &lt;em&gt;didn't&lt;/em&gt; keep
&lt;/h2&gt;

&lt;p&gt;Compatibility isn't free, and not every quirk is worth preserving:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AAC support&lt;/strong&gt;: mp3gain has none. mp3rgain rewrites AAC &lt;code&gt;global_gain&lt;/code&gt; in place (the same idea aacgain used) and stores undo info in MP4 freeform metadata atoms because APEv2 doesn't fit MP4 containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;-o json&lt;/code&gt; and &lt;code&gt;--dry-run&lt;/code&gt;&lt;/strong&gt;: new flags for automated pipelines. Preview safely, then apply — something the original CLI didn't really support.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ID3v2 RVA2 / TXXX ReplayGain tags (&lt;code&gt;-s i&lt;/code&gt;)&lt;/strong&gt;: opt-in. foobar2000, mpd, and other ReplayGain-aware players read these; APEv2 tags are invisible to them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Migrating: what it actually looks like
&lt;/h2&gt;

&lt;p&gt;For most pipelines, migration is one substitution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shell scripts:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/\bmp3gain\b/mp3rgain/g'&lt;/span&gt; your_pipeline.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Dockerfile&lt;/strong&gt; — replace the apt-installed binary with a 2 MB static image:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;- RUN apt-get install -y mp3gain &amp;amp;&amp;amp; rm -rf /var/lib/apt/lists/*
- ENTRYPOINT ["mp3gain"]
- FROM ghcr.io/m-igashi/mp3rgain:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That's it. The image is &lt;code&gt;FROM scratch&lt;/code&gt; with a musl-static binary: no shell, no glibc, no apt cache to clean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;beets&lt;/strong&gt; — change one line in &lt;code&gt;~/.config/beets/config.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;replaygain&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;command&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mp3gain&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mp3rgain&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The full migration guide is at &lt;a href="https://github.com/M-Igashi/mp3rgain/blob/master/docs/migrating-from-mp3gain.md" rel="noopener noreferrer"&gt;docs/migrating-from-mp3gain.md&lt;/a&gt;, with sed patterns, CI snippets, and the apt/dnf/pacman/brew/winget/cargo install matrix.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why bother
&lt;/h2&gt;

&lt;p&gt;Three reasons that mattered to me:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Memory safety&lt;/strong&gt;. mp3gain's history includes a stream of CVEs — heap overflows in the side-info parser, mostly. Patching those in 2025 means tracking down a long-quiet maintainer's intent. A Rust rewrite removes the whole class from the picture.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AAC&lt;/strong&gt;. Most personal libraries on Apple platforms are AAC, and there's been no working tool to volume-normalize them losslessly since aacgain stopped building. DJ hardware, car audio, and smart speakers all ignore ReplayGain tags, so tag-only tools don't help.&lt;br&gt;
For DJ libraries, I compared the two ways to bake gain into the file itself in &lt;a href="https://baken.ravers.workers.dev/loudness-normalization" rel="noopener noreferrer"&gt;Loudness normalization for DJs: a LUFS target or a true peak ceiling?&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Distribution&lt;/strong&gt;. Static binary in a 2 MB image, plus packages on Homebrew / Winget / AUR / PPA / Docker / Cargo. No "build from source on this niche distro" required.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/M-Igashi" rel="noopener noreferrer"&gt;
        M-Igashi
      &lt;/a&gt; / &lt;a href="https://github.com/M-Igashi/mp3rgain" rel="noopener noreferrer"&gt;
        mp3rgain
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Lossless MP3 volume adjustment - a modern mp3gain replacement written in Rust
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/M-Igashi/mp3rgain/docs/branding/mp3rgain-banner.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FM-Igashi%2Fmp3rgain%2FHEAD%2Fdocs%2Fbranding%2Fmp3rgain-banner.png" alt="mp3rgain: lossless MP3/AAC volume normalization" width="800"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;mp3rgain&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="https://opensource.org/licenses/MIT" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667" alt="License: MIT"&gt;&lt;/a&gt;
&lt;a href="https://www.rust-lang.org" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/75e154b22c4bfb1d71dbd84eabf7098b524f3ac84e0eceae97228ea2055acfd7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f727573742d312e38352532422d626c75652e737667" alt="Rust"&gt;&lt;/a&gt;
&lt;a href="https://crates.io/crates/mp3rgain" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f16970b9fc048f70836d37c0cb580b789bba45a4f9772930075eb239edd27bd3/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f762f6d7033726761696e2e737667" alt="crates.io"&gt;&lt;/a&gt;
&lt;a href="https://m-igashi.github.io/mp3rgain/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/4b7c8a4625158be8ddf1562ee096b922b43f056e139064a2c31aa5cdc417348b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f4d2d4967617368692f6d7033726761696e2f746f74616c3f6c6162656c3d646f776e6c6f61647326636f6c6f723d627269676874677265656e" alt="GitHub Downloads"&gt;&lt;/a&gt;
&lt;a href="https://github.com/M-Igashi/mp3rgain/docs/compatibility-report.md" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/07e0a0ee53a70ca6498fea85204a336e9677e28cc7c9c3119aa3491c7cc3dbcc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d70336761696e2d636f6d70617469626c652d627269676874677265656e2e737667" alt="mp3gain compatible"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lossless MP3/AAC volume adjustment - a modern mp3gain / aacgain replacement written in Rust&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;mp3rgain changes the volume of MP3 and AAC files without re-encoding. It rewrites the &lt;code&gt;global_gain&lt;/code&gt; value stored in each frame, the same field mp3gain and aacgain edit, so the audio is never decoded and compressed again and no quality is lost. It runs ReplayGain track and album analysis, writes standard &lt;code&gt;REPLAYGAIN_*&lt;/code&gt; tags, and stores an undo tag so the change can be reverted.&lt;/p&gt;
&lt;p&gt;🌐 &lt;strong&gt;Website:&lt;/strong&gt; &lt;a href="https://mp3rgain.tyna.ninja/" rel="nofollow noopener noreferrer"&gt;mp3rgain.tyna.ninja&lt;/a&gt;: install guide, &lt;a href="https://mp3rgain.tyna.ninja/docs/cli" rel="nofollow noopener noreferrer"&gt;CLI reference&lt;/a&gt;, &lt;a href="https://mp3rgain.tyna.ninja/faq" rel="nofollow noopener noreferrer"&gt;FAQ&lt;/a&gt;, and &lt;a href="https://mp3rgain.tyna.ninja/vs-mp3gain" rel="nofollow noopener noreferrer"&gt;tool comparison&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lossless&lt;/strong&gt;: only the per-frame &lt;code&gt;global_gain&lt;/code&gt; field changes. Works on MP3, AAC in M4A/MP4 (including the audio track of a video MP4), and raw ADTS &lt;code&gt;.aac&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reversible&lt;/strong&gt;: &lt;code&gt;-u&lt;/code&gt; restores the original gain from the undo tag. A frame whose gain would pass the 0..255 limit is clamped instead, cannot be restored exactly, and triggers a warning.&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/M-Igashi/mp3rgain" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  What I'd love to hear
&lt;/h2&gt;

&lt;p&gt;If you have mp3gain or aacgain in a pipeline somewhere, I'd be curious which of the three compatibility layers actually matters to you in practice — and whether anyone is relying on &lt;code&gt;-s i&lt;/code&gt; ID3v2 ReplayGain tags I should know about. Issues and migration reports welcome.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: prose drafted and generated descriptive cover.png with AI editorial assistance. Code, design decisions, and the SHA-256 verification setup are my own.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>podcast</category>
      <category>showdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
