<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Level Up Coding - Medium]]></title>
        <description><![CDATA[Coding tutorials and news. The developer homepage gitconnected.com &amp;&amp; skilled.dev &amp;&amp; levelup.dev - Medium]]></description>
        <link>https://levelup.gitconnected.com?source=rss----5517fd7b58a6---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Level Up Coding - Medium</title>
            <link>https://levelup.gitconnected.com?source=rss----5517fd7b58a6---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:23:56 GMT</lastBuildDate>
        <atom:link href="https://levelup.gitconnected.com/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[What Is an Audio Codec? From MP3 to the Tokens Behind AI Music]]></title>
            <link>https://levelup.gitconnected.com/what-is-an-audio-codec-from-mp3-to-the-tokens-behind-ai-music-aa5d7255be2a?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/aa5d7255be2a</guid>
            <category><![CDATA[multimodal]]></category>
            <category><![CDATA[music-technology]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[audio]]></category>
            <dc:creator><![CDATA[Dorien Herremans]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 16:01:26 GMT</pubDate>
            <atom:updated>2026-11-16T16:01:24.859Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y97waAwFj2mGoqPggtNfhw.png" /></figure><p><em>Sampling, bit depth, lossless prediction, auditory masking and MP3, each worked by hand and then measured, and this is still not enough for a model that has to write the music itself.</em></p><p>One second of CD audio is 88,200 numbers. A three-minute song is 15,876,000 of them.</p><p>A language model writing a long essay produces a few thousand tokens. If we asked the same kind of model to write a song one audio sample at a time, it would have to stay coherent over a sequence thousands of times longer than anything it writes in text, and a single wrong number would be audible as a click.</p><p>Every AI music generator gets around this in the same way. It never touches raw audio. It works on a compressed version, produced by a component called a <strong>codec</strong>, and most of what these systems can and cannot do follows from how that compression works.</p><p>This is the first article in my guide to how AI music generators work, and it starts at the bottom of the stack. I will define each term when it first appears, work each idea with numbers small enough to check by hand, then measure it on real audio. The scripts behind every measurement are linked at the end.</p><h3>1. Sound as numbers: sampling</h3><p>Sound is air pressure changing over time. A microphone turns that pressure into a voltage. To store it, we measure the voltage at regular intervals and write each measurement down. Each measurement is a <strong>sample</strong>. The number of samples per second is the <strong>sample rate</strong>, in hertz (Hz, “per second”).</p><p>How many samples are enough? A pure tone is a wave that repeats. Its <strong>frequency</strong> is the number of repetitions per second, which we hear as pitch. The <strong>sampling theorem</strong> (Shannon, 1949 [1]) says: to capture a tone, you need more than two samples per repetition. Put the other way round, a sample rate of R can represent frequencies up to R/2 and nothing above. R/2 is called the <strong>Nyquist frequency</strong>.</p><p>Human hearing reaches about 20,000 Hz in young ears. A CD samples 44,100 times per second, so it can represent everything up to 22,050 Hz.</p><p>What happens to a tone above the limit is instructive. It does not vanish. It comes back as a different, lower tone, an effect called <strong>aliasing</strong>. A tone at frequency f above the limit shows up at R − f. I generated a 30,000 Hz tone, inaudible to anyone, sampled it at 44,100 Hz, and looked for the strongest frequency in the result:</p><pre>44,100 − 30,000 = 14,100 Hz     (measured: 14,100 Hz)</pre><p>An ultrasonic tone has turned into a clearly audible whistle. This is why every recording device removes everything above the Nyquist frequency before sampling, and why CD’s rate leaves a margin above 20,000 Hz: the filter that does the removing needs room to work.</p><h3>2. Bit depth and quantization noise</h3><p>Each sample must be stored with finite precision. The <strong>bit depth</strong> is the number of bits used per sample. With b bits you can write 2ᵇ different values, so every measurement is rounded to the nearest of 2ᵇ levels. A CD uses 16 bits, 65,536 levels.</p><p>Rounding introduces an error. Over thousands of samples that error behaves like a faint hiss added to the signal, called <strong>quantization noise</strong>. This idea carries the rest of the article, so it is worth making concrete.</p><p>The usual measure is the <strong>signal-to-noise ratio</strong> (SNR): the energy of the signal divided by the energy of the noise. It is expressed in <strong>decibels</strong> (dB), which are 10 × log₁₀ of an energy ratio. 10 dB means ten times the energy, 20 dB a hundred times, 60 dB a million times.</p><p>I rounded a full-volume tone to different bit depths and measured the SNR:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/0*cmf9x0I331IL9cLr.png" /></figure><p>The rule in the last column is a textbook result and the measurement matches it. The part to remember is the slope.</p><p>Every bit you add pushes the noise down by 6 dB. Every bit you remove lets it rise by 6 dB.</p><p>The code for this experiment is three lines:</p><pre>import numpy as np</pre><pre>def quantize(x, bits):              # x between -1 and 1<br>    levels = 2 ** (bits - 1) - 1<br>    return np.round(x * levels) / levels</pre><h3>3. What a codec is, and the bitrate</h3><p>Samples written out one after another are called <strong>PCM</strong> (pulse-code modulation). A WAV file is PCM with a short header. For a stereo CD:</p><pre>44,100 samples × 16 bits × 2 channels = 1,411,200 bits per second</pre><p>That is about 10.6 megabytes per minute. On a 28.8 kbit/s modem in 1995, a four-minute song would have taken over three hours to download.</p><p>A <strong>codec</strong> (coder-decoder) is a pair of programs. The <strong>encoder</strong> turns audio into a smaller representation. The <strong>decoder</strong> turns that representation back into audio. The number of bits used per second of sound is the <strong>bitrate</strong>, written in kbit/s (thousands of bits per second). The history of audio coding is the history of pushing that number down.</p><h3>4. Lossless compression: store only the surprise</h3><p>A <strong>lossless</strong> codec returns exactly the samples that went in. It can still save space, because audio samples are predictable from their neighbours.</p><p>Take five consecutive samples: 100, 104, 109, 113, 116. Storing them directly needs numbers up to 116. Now have the encoder and decoder agree on a prediction rule, and store only the <strong>residual</strong>, the difference between each sample and its prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LcQ-f1wrLQWYSvcr.png" /></figure><p>For the second rule: the line through 100 and 104 continues to 108, and the real value is 109, so the residual is 1. The decoder makes the same prediction and adds the residual back, so nothing is lost. Small numbers need fewer bits than large ones, and that is where the saving comes from.</p><p>How many bits exactly? The measure is <strong>entropy</strong>: the average number of bits per sample needed if you give short codes to common values and long codes to rare ones. I computed it on five real recordings, each stored at 16 bits per sample:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mUfZH4CRmEi9xc7M.png" /></figure><p><strong>FLAC</strong>, the standard lossless codec, uses the same idea with better predictors that it fits to each short block of audio [2]. It gets the trumpet down to 28% of its size. A single instrument playing sustained notes is highly predictable. The dense mix with vocals only reaches 57%.</p><p>There is a floor, and the table shows it. Whatever the predictor cannot predict has to be stored in full, and real recordings contain noise, breath, room sound and the irregular detail of real instruments.</p><p>Lossless compression roughly halves music. To do better, something has to be thrown away, and the question is what.</p><h3>5. Lossy idea one: describe sound by frequency</h3><p>A <strong>lossy</strong> codec gives back audio that differs from the original. Its craft is choosing differences that do not matter.</p><p>The first step is to stop describing sound sample by sample. Any short stretch of audio can be rewritten as a sum of pure tones at different frequencies, each with its own strength. The mathematical tool is a <strong>transform</strong>. Audio codecs use the <strong>MDCT</strong> (modified discrete cosine transform [3]), which converts a block of samples into the same number of <strong>coefficients</strong>, one per frequency. No information is lost by doing this. It is the same audio, written in a different language.</p><p>The reason to switch languages is that music is far more compact in the frequency language. I cut three recordings into blocks of 2,048 samples (46 milliseconds), transformed each block, and asked how many coefficients are needed to hold 99% of the block’s energy (energy being the sum of squared values):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/0*HhNnv3vg2MP4tmQt.png" /></figure><p>For comparison, in the time domain the largest 10% of samples hold only about 42% of the energy. In time, the signal is spread everywhere. In frequency, it is concentrated in a few places, because a note is a handful of frequencies sustained for a while.</p><p>That concentration is the first source of savings: spend bits on the few coefficients that matter. The second source is much larger, and it has nothing to do with the signal.</p><h3>6. Lossy idea two: what the ear cannot hear</h3><p><strong>Psychoacoustics</strong> is the study of how physical sound relates to what we perceive. Three of its findings make MP3 possible.</p><p><strong>The threshold in quiet.</strong> Sound level is measured in <strong>dB SPL</strong> (sound pressure level), a decibel scale where 0 is roughly the quietest 1,000 Hz tone a young person can hear, a conversation is about 60 and a loud concert about 110. The quietest audible level depends strongly on frequency. A standard formula [4] gives:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*8I7K-cMBysdU2O9_.png" /></figure><p>A 15,000 Hz component at 40 dB is simply not heard, at any time, by anyone. An encoder can delete it.</p><p><strong>Critical bands.</strong> The inner ear works like a row of overlapping filters, each responding to a range of frequencies. These ranges are the <strong>critical bands</strong>, a model developed by Eberhard Zwicker on top of earlier work by Harvey Fletcher at Bell Labs [5]. They are narrow at low frequencies (about 100 Hz wide) and wide at high ones (roughly a fifth of the centre frequency). About 24 of them cover the range of hearing. A scale named the <strong>Bark</strong> scale numbers them, so that one Bark is one critical band: 100 Hz is at 1 Bark, 1,000 Hz at 8.5, 10,000 Hz at 22.4 [6].</p><p><strong>Masking.</strong> Within and near a critical band, a loud sound raises the threshold for everything else. A quieter sound that would be perfectly audible alone becomes inaudible. This is <strong>frequency masking</strong>. Alfred Mayer reported it in 1894 [7].</p><p>Here is a worked case using a simplified textbook model [8]. An 80 dB tone plays at 1,000 Hz. Directly at its own frequency, the new threshold is</p><pre>80 − 14.5 − 8.5 (its Bark number) = 57 dB</pre><p>Moving away from the tone, the threshold drops by about 25 dB per Bark towards lower frequencies and only about 10 dB per Bark towards higher ones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kWuSvkde2eDty_MZ.png" /></figure><p>A 40 dB sound at 1,170 Hz is easy to hear in a quiet room. Next to this tone it is 7 dB under the threshold and gone. The lopsided shape matters: a loud sound hides things above it in pitch far more than things below it.</p><figure><img alt="Graph of sound level against frequency. A grey curve shows the threshold in quiet, lowest near 3 kHz. An 80 dB tone at 1 kHz creates a blue tent-shaped raised threshold from about 700 Hz to 2.5 kHz." src="https://cdn-images-1.medium.com/max/1024/0*pyKgJFw9a8IH5CQq.png" /><figcaption>A loud tone raises the hearing threshold around it, further towards high frequencies than towards low ones. Anything in the shaded area is inaudible while the tone plays. Computed from the formulas in [4], [6] and [8]; code linked below.</figcaption></figure><p>Masking also works in time. After a loud sound stops, the ear stays less sensitive for roughly a tenth of a second (<strong>forward masking</strong>). More surprisingly, a loud sound masks quiet ones that came a few milliseconds <em>before</em> it (<strong>backward masking</strong>), because the brain processes loud sounds faster than quiet ones [8].</p><h3>7. From masking to bits</h3><p>Sections 2 and 6 now meet, and the meeting point is the whole trick of perceptual coding.</p><p>Section 2: removing a bit raises the quantization noise by 6 dB. Section 6: around a loud sound, there is a level below which nothing is heard. So in each frequency band, the encoder can remove bits until the noise sits just under the masking threshold.</p><p>Take the band around that 80 dB tone. The threshold there is 57 dB. The noise can be as loud as 57 dB, so the signal only needs to stand 80 − 57 = 23 dB above the noise.</p><pre>bits needed = 23 dB ÷ 6.02 dB per bit ≈ 3.8, so 4 bits</pre><p>Four bits where the CD used sixteen. And a band whose entire content lies below the threshold gets zero bits.</p><p>People often say MP3 “removes sounds you cannot hear”. That is the smaller half. Mostly it stores sounds you can hear with deliberately rough precision, and arranges for the resulting noise to land where masking covers it.</p><p>An MP3 encoder is a machine for hiding noise.</p><p>You can hear the principle without any codec. I took ten seconds of a song and added noise to it in two ways. In one version the noise is <strong>white</strong>: equally strong at all frequencies. In the other, the noise is shaped to follow the music’s own spectrum from moment to moment, strong where the music is strong and absent where it is quiet. Both versions have exactly the same amount of noise: an SNR of 20.00 dB, measured.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2439069306%26show_artwork%3Dtrue%26secret_token%3Ds-Y89OaOXU6B3&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fsoundcloud.com%2Fdorien-herremans%2Fnoise_original%2Fs-Y89OaOXU6B3%3Fsi%3D9150105c01f940ed8349113e07136c17%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c21d66ae314b3a1d985bef3c7d94459/href">https://medium.com/media/7c21d66ae314b3a1d985bef3c7d94459/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2439069123%26show_artwork%3Dtrue%26secret_token%3Ds-xWpg9H5CCQz&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fsoundcloud.com%2Fdorien-herremans%2Fnoise_white_20db%2Fs-xWpg9H5CCQz%3Fsi%3D9150105c01f940ed8349113e07136c17%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/d07ec5d5086f624bfe96eb0310c0c1d0/href">https://medium.com/media/d07ec5d5086f624bfe96eb0310c0c1d0/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F2439068904%26show_artwork%3Dtrue%26secret_token%3Ds-LoMtbVwzCLF&amp;display_name=SoundCloud&amp;url=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fsoundcloud.com%2Fdorien-herremans%2Fnoise_shaped_20db%2Fs-LoMtbVwzCLF%3Fsi%3D9150105c01f940ed8349113e07136c17%26utm_source%3Dclipboard%26utm_medium%3Dtext%26utm_campaign%3Dsocial_sharing&amp;image=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fsoundcloud.com%2Fimages%2Ffb_placeholder.png&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/b3ec27e4f373b73b2126836e418debde/href">https://medium.com/media/b3ec27e4f373b73b2126836e418debde/href</a></iframe><p>The shaped version sounds much cleaner.</p><p>Two recordings with identical signal-to-noise ratios can sound nothing alike, which is why SNR alone has never been a good measure of audio quality. I come back to that in a later article, where two standard metrics rank the same codecs in opposite order.</p><h3>8. MP3, measured</h3><p>MP3 (formally MPEG-1 Audio Layer III, standardised in 1993 [9]) combines everything above:</p><ol><li>Cut the audio into overlapping blocks and transform each into 576 frequency coefficients.</li><li>In parallel, run a <strong>psychoacoustic model</strong>: analyse the block’s spectrum and compute the masking threshold in each band, as in section 6.</li><li>Quantize each band’s coefficients with just enough bits to keep the noise under the threshold, as in section 7. If the bitrate does not allow that, let the noise exceed the threshold where it does least harm.</li><li>Compress the resulting integers losslessly, giving short codes to common values (<strong>Huffman coding</strong>).</li></ol><p>Karlheinz Brandenburg, who led much of the work at Fraunhofer, tuned the codec on Suzanne Vega’s a cappella “Tom’s Diner”, because a solo voice with no accompaniment has nothing to hide artifacts behind. The file extension .mp3 was chosen on 14 July 1995 [10].</p><p>I encoded a 20-second mono drum and bass clip at four bitrates. (For mono, halve the familiar stereo numbers: 64 kbit/s mono corresponds to the classic 128 kbit/s stereo file.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ip9qZ8DcQ-_VdY4W.png" /></figure><p>The last column shows what an encoder does when bits run short. Before it lets noise become audible, it gives up the top of the spectrum. At 32 kbit/s, everything above 8.5 kHz is gone: no cymbal shimmer, no air.</p><h3>The characteristic failure: pre-echo</h3><p>Quantization noise is created per block, and it spreads over the whole block. Usually the music in the block masks it. Now put silence followed by a sharp attack in one block. The noise spreads into the silence <em>before</em> the attack, where nothing covers it. This is <strong>pre-echo</strong>.</p><p>I made the worst case, half a second of digital silence followed by a sharp click, and encoded it at 64 kbit/s:</p><figure><img alt="Two waveforms aligned in time. The original is flat until a click at time zero. The MP3 version shows growing noise in the 7 milliseconds before the click." src="https://cdn-images-1.medium.com/max/1024/0*u08JjSKP38-rHmMx.png" /><figcaption>Top: the original. Bottom: after MP3. Noise appears before the click that caused it.</figcaption></figure><p>In the decoded file the noise begins 6.7 milliseconds before the click, at 34 dB below the click’s peak.</p><p>That it is only 6.7 milliseconds is by design. MP3’s normal blocks span about 26 milliseconds. When the encoder detects an attack, it switches to <strong>short blocks</strong> of 192 samples (4.4 milliseconds), which confines the noise to the few milliseconds where backward masking can hide it [9]. The engineers knew the ear’s blind spot before the attack and sized the fallback to fit inside it. On castanets or applause at low bitrates, it does not always fit, and you hear a soft smear ahead of each hit.</p><h3>9. Where hand-designed codecs stop</h3><p>Later codecs improved on MP3 with the same recipe. AAC uses better transforms. <strong>Opus</strong>, standardised in 2012, covers 6 to 510 kbit/s and carries most voice calls on the internet today [11].</p><p>All of them are built from decisions made by engineers: which transform, which masking model, which rules for spending bits. For music, the recipe stops working somewhere between 6 and 12 kbit/s. In a benchmark of thirteen codecs that I ran for a later article, Opus at 12 kbit/s scores in the same range as the neural codecs on music. At 6 kbit/s its error on a spectrogram-based score more than doubles, the worst result of the thirteen systems I tested. There are simply too few bits to describe the frequency content, and no cleverness about hiding noise can help when there is nothing left to hide it behind.</p><h3>10. What a generative model needs</h3><p>A model that generates music needs something far smaller than 6 kbit/s, and in a different form.</p><p>An MP3 file is compact, but it is a terrible thing to ask a neural network to write. Its bits are variable-length codes whose meaning depends on everything before them. One wrong bit corrupts a whole block.</p><p>A generative model wants one of two things:</p><ul><li>a short sequence of <strong>discrete symbols</strong> from a fixed vocabulary, like words, so a language model can predict the next one, or</li><li>a short sequence of <strong>continuous vectors</strong> (lists of real numbers), so a diffusion model can refine them.</li></ul><p>Both need “short”. Two early systems show the cost of not having it. WaveNet (2016) generated raw audio one sample at a time: 16,000 passes through the network for each second of sound [12]. OpenAI’s Jukebox (2020) learned its own compression, shrinking 44.1 kHz audio by factors of 8, 32 and 128, and still needed about 9 hours to render one minute of music [13].</p><h3>11. Codecs that are learned</h3><p>The breakthrough was to stop designing the codec and train it.</p><p>A <strong>neural audio codec</strong> is an encoder network, a <strong>quantizer</strong> that rounds the encoder’s output to entries in a learned table, and a decoder network. All three are trained together with one goal: the output should sound like the input. Nobody tells the network about critical bands or masking. It discovers what can be discarded from the data.</p><p>Google’s SoundStream (2021) was the first to beat the classic codecs convincingly. In listening tests, the authors report that SoundStream at 3 kbit/s outperformed Opus at 12 kbit/s [14]. Meta’s EnCodec followed in 2022 with open code and weights [15] and became the front end of MusicGen.</p><p>Here is what MusicGen’s codec does [16]. It takes 32 kHz mono audio and outputs 50 <strong>frames</strong> per second (a frame is one short slice of sound). Each frame is described by 4 symbols, each chosen from a table of 2,048 entries, which costs 11 bits.</p><pre>50 frames × 4 symbols × 11 bits = 2,200 bits per second</pre><p>The raw input was 32,000 × 16 = 512,000 bits per second, so this is a 233-fold reduction. Against a stereo CD it is more than 600-fold. A 30-second clip becomes 1,500 frames, and a language model can handle a sequence of 1,500.</p><p>To put the whole ladder on one scale, here is the same 20 seconds of drum and bass in every format from this article:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K5-6Dm8MfSxqOeht.png" /></figure><p>Twenty seconds of music in 5,500 bytes, less than two pages of plain text.</p><h3>What this costs</h3><p>Neural codecs fail differently from MP3, and the difference matters once you generate with them.</p><p>When MP3 runs out of bits, it cuts the high frequencies and lets noise through. You hear dullness and smearing. When a neural codec runs out of bits, its decoder fills the gaps with something plausible. It has learned what music usually sounds like, and it invents detail to match. The result can sound clean and still be wrong: a slightly different vocal timbre, a softened snare, a metallic sheen on a sustained note.</p><p>That also sets a ceiling. Everything a token-based music model produces passes through the codec’s decoder on the way to your ears.</p><p>A music model can never sound better than the decoder of its codec.</p><p>This is why, when a new music model sounds markedly cleaner than the last, the improvement is often in the codec and not in the part that composes.</p><h3>Try it yourself</h3><p>Hear what bitrate does, with ffmpeg:</p><pre>ffmpeg -i song.wav -b:a 128k song_128.mp3<br>ffmpeg -i song.wav -b:a 32k  song_32.mp3</pre><p>Then a neural codec at a fraction of that. It runs on a laptop CPU:</p><pre>pip install encodec<br>encodec -b 1.5 song.wav song.ecdc   # encode at 1.5 kbit/s<br>encodec song.ecdc song_1.5k.wav     # decode</pre><p>I ran this on a 10-second clip. The WAV was 882,044 bytes and the .ecdc file 1,942 bytes.</p><p>Compare song_32.mp3 with song_1.5k.wav. The neural version uses about a twentieth of the bits. Listen to the cymbals and to the consonants of the vocal. The two fail in different ways, and once you can tell them apart, you will start hearing the codec in AI-generated music.</p><h3>What to remember</h3><ul><li>A sample rate of R captures frequencies up to R/2. Anything higher folds back as a false tone.</li><li>Each bit of depth is worth 6 dB of noise. That exchange rate is what every lossy codec trades on.</li><li>Lossless coding stores the difference from a prediction. It roughly halves music (28% to 58% on my five recordings) and can go no further.</li><li>A loud sound raises the hearing threshold around it, more towards higher frequencies. MP3 removes bits until the rounding noise sits just under that threshold.</li><li>When a classic codec runs short of bits, it first drops the high frequencies. At 32 kbit/s mono, MP3 kept nothing above 8.5 kHz.</li><li>Hand-designed codecs stop working for music below about 6 to 12 kbit/s. Trained codecs go several times lower, and invent plausible detail when they run short.</li><li>The codec’s decoder is the quality ceiling for any model built on top of it.</li></ul><p><strong>Coming next:</strong> how a neural codec reaches these bitrates. Codebooks and residual vector quantization, worked by hand.</p><h3>Reproduce the numbers</h3><p>The quickest way to try everything in this article is the notebook, which runs in the browser: <a href="https://colab.research.google.com/github/dorienh/music-ai-explained/blob/main/01-what-is-an-audio-codec/notebook.ipynb">open it in Colab</a>. It includes audio players, so you can hear each result.</p><p><a href="https://github.com/dorienh/music-ai-explained/tree/main/01-what-is-an-audio-codec">experiments.py</a> prints every measurement in this article and draws both figures. The recordings are the freely licensed examples that ship with librosa.</p><h3>More from this guide</h3><p>This is the first article in a set on how AI music generators work. New ones are added to <a href="https://medium.com/@dorien-herremans/list/music-ai-3fb88d4826dd">my Music &amp; AI list on Medium</a> as they come out.</p><h3>If you want to learn more</h3><p>If you want to learn more about how music audio generation works, we wrote a 132-page tutorial that covers the methods and systems of the last two to three years, from neural codecs through token and diffusion models to evaluation: M. Modrzejewski, J. Kurkowska, D. Herremans (2026), <a href="https://arxiv.org/abs/2610.38252">A Tutorial on Generative Models for Music Audio</a>. The rest of my lab’s research on music AI is at <a href="https://dorienherremans.com/biblio">dorienherremans.com/biblio</a>.</p><h3>References</h3><p>[1] C. E. Shannon (1949). “Communication in the Presence of Noise.” <em>Proceedings of the IRE</em> 37(1), 10–21.</p><p>[2] M. van Beurden, A. Weaver (2024). “Free Lossless Audio Codec (FLAC).” RFC 9639. <a href="https://www.rfc-editor.org/rfc/rfc9639">https://www.rfc-editor.org/rfc/rfc9639</a></p><p>[3] J. Princen, A. Bradley (1986). “Analysis/synthesis filter bank design based on time domain aliasing cancellation.” <em>IEEE Transactions on Acoustics, Speech, and Signal Processing</em> 34(5), 1153–1161.</p><p>[4] E. Terhardt (1979). “Calculating virtual pitch.” <em>Hearing Research</em> 1(2), 155–182. (Source of the threshold-in-quiet formula.)</p><p>[5] E. Zwicker (1961). “Subdivision of the audible frequency range into critical bands (Frequenzgruppen).” <em>Journal of the Acoustical Society of America</em> 33(2), 248.</p><p>[6] E. Zwicker, E. Terhardt (1980). “Analytical expressions for critical-band rate and critical bandwidth as a function of frequency.” <em>Journal of the Acoustical Society of America</em> 68(5), 1523–1525.</p><p>[7] A. M. Mayer (1894). “Researches in acoustics.” <em>Philosophical Magazine</em>, series 5, vol. 37.</p><p>[8] T. Painter, A. Spanias (2000). “Perceptual coding of digital audio.” <em>Proceedings of the IEEE</em> 88(4), 451–515. (The best single survey of the field; the simplified masking model in section 6 follows its description of the MPEG psychoacoustic model.)</p><p>[9] ISO/IEC 11172–3:1993, “Coding of moving pictures and associated audio for digital storage media at up to about 1.5 Mbit/s, Part 3: Audio”.</p><p>[10] K. Brandenburg (1999). “MP3 and AAC explained.” <em>AES 17th International Conference on High-Quality Audio Coding</em>. For the Tom’s Diner story and the naming date, see also <a href="https://en.wikipedia.org/wiki/MP3">https://en.wikipedia.org/wiki/MP3</a></p><p>[11] J.-M. Valin, K. Vos, T. Terriberry (2012). “Definition of the Opus Audio Codec.” RFC 6716. <a href="https://www.rfc-editor.org/rfc/rfc6716">https://www.rfc-editor.org/rfc/rfc6716</a></p><p>[12] A. van den Oord et al. (2016). “WaveNet: A Generative Model for Raw Audio.” <a href="https://arxiv.org/abs/1609.03499">https://arxiv.org/abs/1609.03499</a></p><p>[13] P. Dhariwal et al. (2020). “Jukebox: A Generative Model for Music.” <a href="https://arxiv.org/abs/2005.00341.">https://arxiv.org/abs/2005.00341.</a> Rendering time from the accompanying post: <a href="https://openai.com/research/jukebox">https://openai.com/research/jukebox</a></p><p>[14] N. Zeghidour, A. Luebs, A. Omran, J. Skoglund, M. Tagliasacchi (2021). “SoundStream: An End-to-End Neural Audio Codec.” <em>IEEE/ACM TASLP</em>. <a href="https://arxiv.org/abs/2107.03312">https://arxiv.org/abs/2107.03312</a></p><p>[15] A. Défossez, J. Copet, G. Synnaeve, Y. Adi (2022). “High Fidelity Neural Audio Compression.” <em>TMLR</em>. <a href="https://arxiv.org/abs/2210.13438">https://arxiv.org/abs/2210.13438</a></p><p>[16] J. Copet et al. (2023). “Simple and Controllable Music Generation.” <em>NeurIPS</em>. <a href="https://arxiv.org/abs/2306.05284">https://arxiv.org/abs/2306.05284</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa5d7255be2a" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/what-is-an-audio-codec-from-mp3-to-the-tokens-behind-ai-music-aa5d7255be2a">What Is an Audio Codec? From MP3 to the Tokens Behind AI Music</a> was originally published in <a href="https://levelup.gitconnected.com">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Transportive AI: A Cleaner Way to Code with Agents]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/building-transportive-ai-a-cleaner-way-to-code-with-agents-6dbb28b4ab21?source=rss----5517fd7b58a6---4"><img src="https://cdn-images-1.medium.com/max/2600/1*KbLiDVeeoEe5_AxsOXNN8Q.png" width="4020"></a></p><p class="medium-feed-snippet">Rules first, then tests the agent did not write</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/building-transportive-ai-a-cleaner-way-to-code-with-agents-6dbb28b4ab21?source=rss----5517fd7b58a6---4">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/building-transportive-ai-a-cleaner-way-to-code-with-agents-6dbb28b4ab21?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/6dbb28b4ab21</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Fareed Khan]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 16:01:14 GMT</pubDate>
            <atom:updated>2026-11-16T16:01:12.693Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[8 Important Metrics to Evaluate Your RAG System.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/8-important-metrics-to-evaluate-your-rag-system-cbff37739a38?source=rss----5517fd7b58a6---4"><img src="https://cdn-images-1.medium.com/max/2600/1*Ymong9X1tWnTA_OiEtiXcg.png" width="3200"></a></p><p class="medium-feed-snippet">Evaluating Your RAG System Using Both Traditional NLP and LLM-Based Metrics.</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/8-important-metrics-to-evaluate-your-rag-system-cbff37739a38?source=rss----5517fd7b58a6---4">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/8-important-metrics-to-evaluate-your-rag-system-cbff37739a38?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/cbff37739a38</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[gen-ai-for-business]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Adediwura Boluro-Ajayi]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 16:01:00 GMT</pubDate>
            <atom:updated>2026-11-16T19:54:02.051Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to calculate abnormal returns for large stocks without bias]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/how-to-calculate-abnormal-returns-for-large-stocks-without-bias-b91752e46687?source=rss----5517fd7b58a6---4"><img src="https://cdn-images-1.medium.com/max/800/0*C9taKLjh6UP5mUl0.png" width="800"></a></p><p class="medium-feed-snippet">The market model can understate or overstate a large stock&#x2019;s abnormal returns in an event study because the assumptions needed to estimate&#x2026;</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/how-to-calculate-abnormal-returns-for-large-stocks-without-bias-b91752e46687?source=rss----5517fd7b58a6---4">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/how-to-calculate-abnormal-returns-for-large-stocks-without-bias-b91752e46687?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/b91752e46687</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Alexander Hübbert]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 16:00:30 GMT</pubDate>
            <atom:updated>2026-11-16T16:00:28.819Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why Your Machine Learning Model’s Accuracy Might Be Lying]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/why-your-machine-learning-models-accuracy-might-be-lying-b30ed182977a?source=rss----5517fd7b58a6---4"><img src="https://cdn-images-1.medium.com/max/2455/1*heZioJAtGy4jAO9Jio2AJw.png" width="2455"></a></p><p class="medium-feed-snippet">Building Train/Test Splits, Confusion Matrices, Precision, Recall, F1 Scores and Cross-Validation fromScratch &#x2014; and Discovering How Data&#x2026;</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/why-your-machine-learning-models-accuracy-might-be-lying-b30ed182977a?source=rss----5517fd7b58a6---4">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/why-your-machine-learning-models-accuracy-might-be-lying-b30ed182977a?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/b30ed182977a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Rahul Juyal]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 16:00:14 GMT</pubDate>
            <atom:updated>2026-11-16T16:00:13.126Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Every Film Starts as a Poster]]></title>
            <link>https://levelup.gitconnected.com/every-film-starts-as-a-poster-f6de71076fde?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/f6de71076fde</guid>
            <category><![CDATA[3d]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[cameras]]></category>
            <dc:creator><![CDATA[Hardik Verma]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 15:59:57 GMT</pubDate>
            <atom:updated>2026-11-16T15:59:56.660Z</atom:updated>
            <content:encoded><![CDATA[<h4>I built an open-source Claude Code plugin that turns a sentence into a flat illustration, then opens it into a 3D world with a moving camera</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RddtLdD8XxLXbPuaUSObiw.png" /></figure><p><em>One sentence in, this film out. No photo, no 3D model, no image generator, nothing drawn by hand.</em></p><p>Watch the first second of the film above. It looks like a printed poster: a flat illustration of a village under the mountains.</p><p>Then the camera moves, and the poster turns out to be a place. You fly down a lane between the chalets, over the ski slope, past the gondola and into the square. Then the camera pulls back, the world flattens, and you are looking at the poster again. The loop starts over without a seam.</p><p>That moment, when a flat picture opens into a world, is the whole idea behind <strong>Depth Diorama</strong>, a plugin I built for Claude Code. You describe a place or a product in one sentence. Claude builds it as a real 3D scene. The engine films it with that poster-to-world camera move.</p><p>Here is the sentence behind the village:</p><blockquote>A mountain ski village at night in falling snow: wooden chalets with glowing windows climbing the slope, a gondola lift with cabins gliding up to the peak, skiers coming down a lit piste, a small clock tower and a church spire in the square, string lights across the lane, a frozen pond where people skate, pine trees heavy with snow, and the mountain under a starry sky.</blockquote><p>About twenty minutes after I gave Claude that sentence, it handed back a film at <strong>60 frames a second</strong>. In between, it built the village, reviewed its own frames over eleven rounds of fixes, and rendered only once every automatic check passed.</p><h4>The poster is not a fake</h4><p>The flat picture and the deep world are the same thing. Nothing is swapped and nothing is faked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CDAgSro1MElnzUS9ecEh1g.png" /></figure><p><em>The same scene. Left: the first frame. Right: three seconds later.</em></p><p>It is an old camera trick. <strong>Film a scene from very far away through a very long lens, and everything in it, near or far, ends up about the same distance from the camera. Depth disappears, and the scene stacks into one flat picture.</strong></p><p>Then move the camera in while widening the lens. The subject stays the same size, but the space behind it stretches open. Filmmakers call this a <strong>dolly zoom</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2XnzlAFal8aNmf8SaZ-hg.png" /></figure><p>Depth Diorama does this with a real 3D scene. The poster you see in the first frame really is the 3D world, seen from kilometres away.</p><h4>Claude builds the world, the engine films it</h4><p>The split is simple. Claude is the art director. The engine is the camera crew.</p><p><strong>1. Claude writes the world as a small scene file.</strong> It is plain JavaScript that builds the place from a kit of parts: buildings, curved shapes, people, lights, snow, drawn pictures for signs and screens, and a camera path. A shortened example:</p><pre>export default {<br>  name: &quot;Lantern Street&quot;,<br>  look: &quot;night&quot;,<br>  build(k) {<br>    k.ground(300, 400, &quot;#2B2D44&quot;);<br>    for (let i = 0; i &lt; 6; i++) {<br>      const z = -i * 12;<br>      k.building(10, 18, 10, [-11, z], { wall: &quot;#4A4D73&quot;, lit: &quot;#FFD98A&quot; });<br>      k.building(10, 22, 10, [11, z], { wall: &quot;#5A4C78&quot;, lit: &quot;#FFC3A0&quot; });<br>      k.light([0, 4, z], 9, &quot;#FFB060&quot;, 1.2);   // warm light spilling onto the street<br>    }<br>    k.crowd(120, { x: [-5, 5], z: [-60, 4], umbrellas: 0.5 });<br>    k.particles({ count: 3000, fall: 2, sway: 2 });   // falling snow<br>  },<br>};</pre><p>Real scenes run much longer. The ski village is about 860 lines: around 30 chalets, 400 snowy pines and 90 people, a gondola with 18 moving cabins, skiers, skaters, a sleigh and chimney smoke.</p><p><strong>2. Claude reviews its own frames, round after round.</strong> It renders a still at every key moment of the film and looks at each one. Is anything empty, muddy, clipped or stiff? It names the three weakest things in each frame, fixes them and renders again. The plugin asks for at least six rounds, because a first version always looks empty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F9Y7dzoj8JifoVviWlSG4A.png" /><figcaption><em>Four moments from one film: a rainy neon crossing.</em></figcaption></figure><p>3. The engine checks the film. Before the final render, it tests what a person would miss:</p><pre>PASS  Flat shot reads as flat<br>PASS  Flat shot fills the frame<br>PASS  Every move opens real depth<br>PASS  Camera is never inside an object<br>PASS  Same time renders the same image<br>PASS  Scene returns to its start<br>PASS  No frozen stretches, no pops, no flicker<br>PASS  Loop seam is invisible</pre><p>When a check fails, it says what is wrong and at which second, so Claude can fix it without guessing.</p><p><strong>4. The engine renders.</strong> A 12-second film at 1080p and 60 frames a second takes three to four minutes on a laptop.</p><h4>What I learned building it</h4><p><strong>Give the agent abilities, not templates</strong></p><p>My first instinct was to write helpers for particular things: a billboard maker, a building maker, a crowd maker. That never ends. Someone will ask for a bakery, a harbour or a product launch, and there will be no helper for it.</p><p>So I built general abilities instead:</p><ul><li><strong>Draw any picture.</strong> Claude draws screens, posters, labels and logos as SVG, which language models write surprisingly well.</li><li><strong>Move the camera anywhere.</strong> A camera path is a short list of shots: dives, orbits, crane moves, low angles.</li><li><strong>Fill a place with people.</strong> Hundreds of walkers are drawn in one pass, so a crowd costs almost nothing.</li><li><strong>Light it and give it weather.</strong> Point lights for windows and lamps, and particles for snow, embers, petals, dust and smoke.</li></ul><p>Claude combines them for whatever you ask for.</p><p><strong>Let the machine check the camera</strong></p><p>The checks caught bugs I would never have spotted by eye:</p><ul><li><strong>Two screens fighting.</strong> A video screen meant to switch between two pictures showed both at once, flickering.</li><li><strong>A stuck traffic light.</strong> Its red bulb never went off.</li><li><strong>A camera that flew through a building.</strong> It happened between two shots, where nobody was looking.</li></ul><p>Each one became a clear error message and a line in the plugin’s guide, so the next run avoids it.</p><h4>Test with an agent that knows nothing</h4><p>This was the most useful habit of all. After each improvement, I gave a brand-new Claude, with no memory of my work, one sentence and the plugin, nothing else. If its film was weak, the problem was in my guide or my tools, not in that scene.</p><p>Every fresh run came back with a list of what was unclear, missing or wrong. That list became the next round of fixes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZKy52nSjDehPCH5DHENkA.png" /><figcaption><em>The same prompt. Left: an early version of the engine. Right: the latest, made by a fresh agent.</em></figcaption></figure><h4>Ask for effort</h4><p>The biggest single jump in quality came from one line: asking for more review rounds. A run that stopped after four rounds made a nice film. One that kept going for eleven made a great one. The guide now says: “Do not stop at better. Stop when a full round turns up nothing you would be embarrassed to show.”</p><h4>More posters that open</h4><p><strong>A rainy neon crossing.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*LyVrlJQVQpsOivgY1xH1cQ.gif" /><figcaption>A wall of neon screens opens into a rainy crossing; the camera dives over hundreds of umbrellas.</figcaption></figure><blockquote>A rainy scramble crossing in a Tokyo-style shopping district at dusk. Tall buildings covered in neon signs and giant video screens, a lit gateway over the shopping street, a round glass tower on the corner, crowds with umbrellas crossing in every direction, buses and taxis waiting, and a wet road reflecting the neon.</blockquote><p><strong>A product, vertical for Reels.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*YArIRD-nuQ4_oCIWKAYeRA.gif" /></figure><blockquote><em>A running shoe that comes apart layer by layer.</em></blockquote><h4>Try it</h4><p>You need Claude Code, Node 20 or newer, and ffmpeg. Install the plugin with one line inside Claude Code:</p><pre>/plugin install depth-diorama --marketplace hardikverma22/depth-diorama</pre><p>Or add it as a plain skill, for Claude Code and other coding agents:</p><pre>npx skills add hardikverma22/depth-diorama -g</pre><p>There is no setup step. The first run installs what it needs by itself, in about a minute.</p><p><strong>Then describe what you want:</strong></p><blockquote><em>Make a depth diorama of a lighthouse on a stormy coast at dusk, vertical for Reels.</em></blockquote><p>It works for places, products, characters and title sequences, in 16:9, 9:16, 1:1 or 4:5, and everything runs on your own machine.</p><h4>Honest limits</h4><ul><li>Drawn, not painted. Claude draws the signs and screens in SVG. They look good, but not like a painted illustration.</li><li>It takes time. A rich scene takes Claude thirty to forty minutes of building and reviewing, then a few minutes to render.</li><li>One style. It makes illustrated, ink-and-colour films, not photoreal video.</li></ul><p>Depth Diorama is open source under the MIT licence: <a href="https://github.com/hardikverma22/depth-diorama">github.com/hardikverma22/depth-diorama</a></p><p>If you make a poster that opens into something, I would love to see it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6de71076fde" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/every-film-starts-as-a-poster-f6de71076fde">Every Film Starts as a Poster</a> was originally published in <a href="https://levelup.gitconnected.com">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Capacity Planning for Kubernetes Ingress Controllers: A Practical Guide]]></title>
            <link>https://levelup.gitconnected.com/capacity-planning-for-kubernetes-ingress-controllers-a-practical-guide-d870026883dc?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/d870026883dc</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[traefik]]></category>
            <category><![CDATA[capacity-planning]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[performance-testing]]></category>
            <dc:creator><![CDATA[Roland Hewage]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 15:59:43 GMT</pubDate>
            <atom:updated>2026-11-16T15:59:42.278Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Tuning, scaling up vs out, and how much headroom is enough.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yvmq_CfmzqucoBfe-_6exg.png" /><figcaption><em>Scaling</em> <em>up</em> <em>or</em> <em>out, matched to the headroom you already trust.</em></figcaption></figure><p>Capacity planning for Kubernetes ingress controllers. Two ways to add capacity, scaling up with fewer larger pods or scaling out with more smaller pods, aimed at the same headroom target and validated with soak and spike tests.</p><p>In the <a href="https://medium.com/gitconnected/nginx-vs-traefik-a-fair-ingress-controller-benchmark-with-k6-7366772ab06f">previous article</a>, Traefik met the performance objectives for our workload, as long as it ran with enough replicas. NGINX still did about twice the work per CPU core. The verdict was <em>“fast enough, if you size it right.”</em></p><p>This article is about the <em>“size it right”</em> part.</p><p>Our real traffic was never the problem. It sat more than 50 times below even the smallest setup I tested. The real question was different: <strong>how much Traefik do we need to keep the same safety margin our NGINX setup gave us?</strong></p><p>Answering it took four steps. Get what’s free from tuning, pick the right way to scale, turn the results into a replica plan, and prove the plan holds over time and under spikes. My example is Traefik replacing NGINX, but the same four steps work for any ingress controller.</p><h3>Start With the Target</h3><p>A capacity plan needs a target, just like a benchmark does. Without one, “enough” turns into whatever number feels safe on the day.</p><p>Our target was simple: <strong>match the headroom of the controller we were replacing.</strong> Headroom is the gap between the traffic you expect and the most traffic the system can handle while still healthy. NGINX had been running 5 to 10 pods with 1 CPU core each, and its headroom had served us well. Traefik had to offer about the same.</p><p>“Healthy” matters here. In the last article, I separated the <strong>ceiling</strong>, the highest throughput reached while still healthy, from the <strong>optimum</strong>, the point just below it where latency is still close to its minimum. The capacity numbers in this article are ceilings, taken while errors were zero and latency was still low. Real traffic should then sit near the optimum, well below them.</p><p>I kept the same method as before. k6, an open-source load-testing tool, sent load straight to the controller pods, swept from a few users up to thousands, and every level ran three times, reported as the median, to smooth out run-to-run noise. The autoscaler was pinned so the pod count couldn’t change mid-run.</p><p>The setup itself was stronger this time, with a bigger backend behind the controllers, so nothing else could become the limit at higher throughput. Measured side by side again, NGINX came out about 2.2× faster on 1-core pods and 2.1× on 2-core pods, a little less than the 2.4× in the last article. The ratio held, which is why ratios, not absolute numbers, drive the plan.</p><p>With the target fixed, the first question was whether Traefik could do more with what it already had.</p><h3>Step 1: Tune Before You Scale</h3><p>Tuning is free. Scaling costs CPU every hour of every day. So before adding resources, I looked for configuration changes that let Traefik do more on the same budget.</p><p>I picked what to test from the symptoms, not from a list of popular tips. In the last article, Traefik’s memory grew under load while its throughput fell, which pointed to the garbage collector competing for CPU. Access logs were the other obvious cost paid on every request. I tried the popular tips too, and they’re covered below.</p><p>The method matters as much as the result. The baseline was the configuration we actually ran: access logs on, buffered, and no garbage collector tuning. From there, I changed <strong>one setting at a time</strong> on identical resources, 2 pods with 1 core each, then combined the ones that helped. The winning combination was then confirmed over three trials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqCchc_yKfUgpUeiTWeZjg.png" /><figcaption><em>Each setting tested alone, then together, on the same 2 pods × 1 core. Confirmed over 3 trials: 4,255 → 6,145 req/s.</em></figcaption></figure><p>Two changes made the difference:</p><ul><li><strong>Access logs off: about 28% more throughput.</strong> Traefik ships with access logs off, but many teams turn them on for debugging, as we had. Traefik then writes a log line for every request, and even with buffering, that work competes with request handling on a single core.</li><li><strong>Garbage collector tuning: about 16% more.</strong> Traefik is written in Go, and Go’s garbage collector, or GC, frees unused memory in the background using the same CPU. Raising GOGC makes it run less often. GOMEMLIMIT sets a soft memory limit, so the collector still steps in before the pod runs out of memory.</li></ul><p>Together, they lifted the peak by <strong>44%</strong>, from about 4,250 to about 6,150 requests per second, with no extra CPU. p95 latency, the response time that 95% of requests beat, also halved at the peak, from 30 ms to 16 ms.</p><p>In Kubernetes, both are a few lines on the Traefik container. The first line only matters if you turned access logs on:</p><pre>args:<br>  - --accesslog=false<br>env:<br>  - name: GOMEMLIMIT<br>    value: &quot;2560MiB&quot;   # about 83% of the 3 GiB limit<br>  - name: GOGC<br>    value: &quot;300&quot;</pre><p>Here’s how I picked the two values:</p><ul><li><strong>GOGC=300.</strong> The default of 100 runs the collector when the heap reaches twice its live size. At 300, it waits until four times, so it runs far less often. The pods had memory to spare, using at most about two-thirds of their limit, so I chose a clear step up rather than a small one. GOMEMLIMIT is what makes a bold value safe. I tested only this one value, so treat it as a starting point and try a few on your own setup.</li><li><strong>GOMEMLIMIT=2560MiB.</strong> That’s about 83% of the 3 GiB pod limit, in line with the common Go advice of 80 to 90%. The gap leaves room for short memory spikes, such as when Traefik reloads its routing configuration, so the pod isn’t killed for running out of memory.</li></ul><p>Neither change is free of trade-offs. GC tuning swaps memory for CPU, and Traefik’s memory nearly doubled, coming close to the 3 GiB limit under heavy load. Turning access logs off means losing per-request logs, which you may miss during an incident.</p><p>Just as useful was learning what <strong>didn’t</strong> help:</p><ul><li><strong>GOMAXPROCS,</strong> which controls how many CPU threads a Go program uses, made no difference. Recent Go versions already set it from the container’s CPU limit.</li><li><strong>A bigger backend connection pool</strong> made no difference. The default was already more than enough.</li><li><strong>FastProxy,</strong> an experimental faster proxy engine in Traefik, cut throughput by about 40% on our setup. Popular tuning tips don’t always carry over, so measure them.</li><li><strong>HTTPS itself</strong> cost about 24% compared with plain HTTP. That’s the price of encryption, not a setting to tune away.</li></ul><p>In the end, the capacity plan used the baseline configuration, and the tuning gain became extra margin on top. That’s the safer way to plan. Access logs earn their keep during an incident, and a plan shouldn’t depend on settings someone might change later.</p><p>Tuning showed how much more Traefik could do on the same CPU. The next question was the best way to add CPU when you need more.</p><h3>Step 2: Scale Up or Scale Out?</h3><p>There are two ways to add capacity. <strong>Scaling up</strong> gives each pod more CPU. <strong>Scaling out</strong> adds more pods. Most teams default to scaling out, because that’s what an autoscaler does. I measured both, on the baseline configuration:</p><ul><li><strong>Up:</strong> 2 pods, with 1, 2 and then 4 cores each</li><li><strong>Out:</strong> 1 core per pod, with 2, 4 and then 8 pods</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9MCf3LdnmHDaIK8iweJkKA.png" /><figcaption><em>Peak req/s, baseline configuration, median of 3 trials.</em></figcaption></figure><p>Doubling CPU per pod, from 1 core to 2, added <strong>80%</strong>. Doubling the number of pods, from 2 to 4, added <strong>about 50%</strong>. More CPU per pod was the more efficient lever.</p><p>Neither lever scales in a straight line. The third and fourth cores added 43%, and going from 4 to 8 pods added 47%. Every step bought a bit less than the one before.</p><p>So the rule for Traefik is <strong>prefer fewer, larger pods,</strong> up to about 2 cores, where the biggest jump happened. Keep at least two pods so one can restart or fail without an outage.</p><p>Now I knew which lever to pull. The next step was working out how far to pull it.</p><h3>Step 3: Turn the Curves Into a Plan</h3><p>To match NGINX’s headroom, I compared both controllers <strong>per pod,</strong> measured with the same load setup:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y4cyGqpfNLpPWKK5UvDYjQ.png" /><figcaption><em>Peak req/s per pod, baseline configuration, both controllers measured with the same load setup.</em></figcaption></figure><p>A 1-core Traefik pod delivered about <strong>45%</strong> of a 1-core NGINX pod. Matching NGINX on 1-core pods would need roughly twice as many pods, and the last step showed that adding pods is the less efficient lever.</p><p>A 2-core Traefik pod delivered about <strong>80%</strong> of a 1-core NGINX pod. That led to a simple plan:</p><ul><li><strong>Keep the same replica range,</strong> 5 to 10 pods, so nothing changes for the people running it.</li><li><strong>Give each pod 2 CPU cores</strong> instead of 1.</li><li><strong>Keep 3 GiB of memory per pod,</strong> because Traefik uses nearly twice as much memory as NGINX and it grows under load.</li></ul><p>That gets close to NGINX’s headroom with the same number of pods. If you need exact parity, raise the maximum to about 12 pods, because 12 Traefik pods at 80% roughly match 10 NGINX pods.</p><p>Measured against real traffic, even the smallest Traefik setup tested had more than 50 times the headroom we needed. The plan wasn’t about surviving today’s load. It was about keeping the same safety margin we already trusted.</p><p>Your own ratios will differ with your controller, hardware and traffic, so measure them rather than reusing mine. The way you get from curves to a plan stays the same.</p><p>On paper, the plan worked. A plan on paper is still a prediction, so the last step was to test it the way production would.</p><h3>Step 4: Prove the Plan Holds</h3><p>Short peak tests don’t show memory leaks, and they don’t show what happens when traffic jumps without warning. So I ran two more tests on 2 pods with 2 cores each, the smallest version of the plan, where any weakness would show first. Both used the baseline configuration.</p><h3>Steady Load for Three Hours</h3><p>A soak test holds a steady load for hours to catch slow problems, such as memory that creeps up or latency that drifts. I ran 2,000 requests per second for three hours, long enough for slow problems to surface. That rate is about a quarter of this setup’s peak, comfortably below it, where you’d want real traffic to sit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvtZXVavuUJJ9TCTy7pFqw.png" /><figcaption><em>2 pods × 2 cores, baseline configuration, one point per 15 minutes.</em></figcaption></figure><p>Nothing drifted. p95 stayed between 2.2 and 2.4 ms, errors stayed at 0%, and no pod restarted. Memory settled at about 1.5 GiB per pod, half the limit, and CPU sat at about 28% of the budget.</p><h3>Sudden Spikes</h3><p>For spikes, I switched to <strong>open-loop</strong> load, where requests arrive at a fixed rate whether or not the controller keeps up. That’s how a real spike behaves, and it lets errors show up under overload instead of being hidden by clients that wait. Starting from 500 requests per second, I jumped to 6,000, below this setup’s measured peak, then dropped back. Next I jumped to 10,000, well past the peak, to see how it fails when overloaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l2rIBnrgAwvdoxlrmeR8zA.png" /><figcaption><em>Open-loop load on 2 pods × 2 cores. Dashed outline = requested rate, filled bar = served rate.</em></figcaption></figure><p>Traefik slowed down during each jump but didn’t fall over. At 10,000 requests per second it capped throughput at about 5,400, with errors at 0.51% and no restarts. As soon as the spike ended, latency was back to 2 to 3 ms.</p><p>One detail is worth noticing. Even the 6,000 spike, below the measured peak, wasn’t fully served. A sudden jump forces thousands of new HTTPS connections at once, and setting those up costs far more than serving steady traffic over connections that already exist. <strong>A peak measured with a gradual ramp overstates what you can absorb in a sudden spike.</strong></p><p>The plan held up under both tests. That leaves the question in the subtitle.</p><h3>How Much Headroom Is Enough?</h3><p>There’s no single magic number, but these tests gave me four practical rules:</p><ul><li><strong>Plan around the optimum, not the ceiling.</strong> Real peak traffic should sit near the optimum, where latency is still low. The ceiling is your safety buffer, not your plan.</li><li><strong>Keep at least the margin you already trust.</strong> If you’re replacing a system, match its headroom. If you have service-level objectives, size against those.</li><li><strong>Leave extra room for spikes.</strong> A gradual-ramp peak overstates spike capacity, so don’t plan right up to it.</li><li><strong>Treat tuning as a bonus.</strong> Plan on the configuration you’ll actually run and let tuning gains add margin on top.</li></ul><p>Following these rules, 5 to 10 pods with 2 cores each gave close to the margin we had with NGINX, with room to go to 12 pods for full parity. Spike behaviour and long-run stability were measured instead of assumed.</p><h3>Checklist</h3><p>Before you trust a capacity plan, check each of these. Each one closes a gap that could otherwise surprise you in production.</p><ul><li><strong>Set the target first.</strong> Decide what “enough” means, such as matching the system you’re replacing or meeting a service-level objective, before you measure anything.</li><li><strong>Tune before you scale.</strong> Test one setting at a time on identical resources, confirm the winners over several trials, and write down the trade-offs.</li><li><strong>Measure both ways to scale.</strong> Test more CPU per pod and more pods separately, because the more efficient lever depends on the controller.</li><li><strong>Compare per pod.</strong> Express capacity per pod against the system you’re replacing, so the replica plan follows directly.</li><li><strong>Plan on what you’ll run.</strong> Size against the configuration you’ll actually run in production, and keep tuning gains as extra margin.</li><li><strong>Prove it over time and under spikes.</strong> Run a soak test for hours, and an open-loop spike test that goes past the peak.</li></ul><p>Together, they turn a set of benchmark curves into a plan you can defend.</p><h3>Final Thoughts</h3><p>I expected capacity planning to be about finding the biggest number Traefik could reach. It turned out to be about three smaller questions. What can it do for free? Which resource buys the most? Does the plan still hold after three hours and a sudden spike?</p><p>The answers weren’t obvious in advance. A popular tuning tip made things worse, scaling up beat the autoscaler’s default habit of scaling out, and a spike exposed a limit the gradual ramp never showed.</p><p>So don’t size an ingress controller from its peak. <strong>Tune what’s free, add CPU before pods, plan on what you’ll actually run, and prove it holds before you trust it.</strong></p><h3>What’s Next</h3><p>Every number in this article came from a test cluster. Production is different: a bigger cluster, other workloads on the same nodes and far more network rules. In the next article, I’ll show how to check these results in production safely, without touching real users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d870026883dc" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/capacity-planning-for-kubernetes-ingress-controllers-a-practical-guide-d870026883dc">Capacity Planning for Kubernetes Ingress Controllers: A Practical Guide</a> was originally published in <a href="https://levelup.gitconnected.com">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Prefer Table-Driven Tests Over Any Go Testing Framework]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/why-i-prefer-table-driven-tests-over-any-go-testing-framework-45e6e2f4af9f?source=rss----5517fd7b58a6---4"><img src="https://cdn-images-1.medium.com/max/2600/0*hPowbvE5Em9k6vPz" width="8256"></a></p><p class="medium-feed-snippet">Stdlib testing plus slices of structs. Boring, readable, impossible to over-engineer.</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/why-i-prefer-table-driven-tests-over-any-go-testing-framework-45e6e2f4af9f?source=rss----5517fd7b58a6---4">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/why-i-prefer-table-driven-tests-over-any-go-testing-framework-45e6e2f4af9f?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/45e6e2f4af9f</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[backend-engineering]]></category>
            <dc:creator><![CDATA[syarif]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 15:59:29 GMT</pubDate>
            <atom:updated>2026-11-16T15:59:28.262Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A practical guide to OpenAI’s Decisions API]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/a-practical-guide-to-openais-decisions-api-ea379c14aeb8?source=rss----5517fd7b58a6---4"><img src="https://cdn-images-1.medium.com/max/1672/1*fGhqmttlfjP-CsCDiKxJow.png" width="1672"></a></p><p class="medium-feed-snippet">Is this the JEV killer?</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/a-practical-guide-to-openais-decisions-api-ea379c14aeb8?source=rss----5517fd7b58a6---4">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/a-practical-guide-to-openais-decisions-api-ea379c14aeb8?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/ea379c14aeb8</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Thomas Reid]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 15:59:16 GMT</pubDate>
            <atom:updated>2026-11-16T15:59:14.999Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I built the same API in 5 Node.js]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/i-built-the-same-api-in-5-node-js-8a26438bfeb6?source=rss----5517fd7b58a6---4"><img src="https://cdn-images-1.medium.com/max/880/1*ebICGSJZ6OyDFGJDr2b-Eg.gif" width="880"></a></p><p class="medium-feed-snippet">Express, Koa, Hono, Fastify and NestJS on both adapters, same routes and same bytes. Switching the NestJS adapter was a one-file change&#x2026;</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/i-built-the-same-api-in-5-node-js-8a26438bfeb6?source=rss----5517fd7b58a6---4">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/i-built-the-same-api-in-5-node-js-8a26438bfeb6?source=rss----5517fd7b58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/8a26438bfeb6</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Muhammad Mozzammel Haque]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 15:58:38 GMT</pubDate>
            <atom:updated>2026-11-16T15:58:37.287Z</atom:updated>
        </item>
    </channel>
</rss>