Tonegrid Pattern Renderer
Render a Tonegrid project to a stereo WAV file and measure the mix.
Try an example: Lo-fi pattern loop with pad reverb and the beat panned right · Three-part song in a concert hall
How it works
Turns a Tonegrid project — the JSON file or a share link — into a 16-bit stereo WAV file: one seamless pattern loop or the whole song arrangement, with the Tonegrid synth voices, drums, pan and reverb send. The result reports peak and RMS levels per channel, crest factor, clipped samples, the strongest spectral lines, a spectrum chart and a waveform overview. It is the same renderer as the WAV export in the Tonegrid app, so both give identical files.
- Every step is a sixteenth note at the project tempo; swing delays every second step. Melody notes and drum hits are synthesized sample by sample at 44.1 kHz with the same recipes the app plays live through Web Audio: sine, triangle and band-limited (PolyBLEP) sawtooth oscillators, exponential attack and decay envelopes, an exponentially falling low-pass on the pluck, pitch-swept kick, tom and rim, and high-passed seeded noise for snare, hats, clap and shaker.
- Mixer: each track has a level and an equal-power pan (with +3 dB make-up so a centred track is as loud as before), and a send into one mono reverb bus. The reverb is the Freeverb-style room reverb of the shared audio engine with the chosen preset’s reverberation time, 100 % wet; the master volume scales the sum.
- Pattern range: exactly one full cycle (until melody and drum grids line up again); everything that rings past the end — long pad notes and the reverb tail — is added back onto the start, so the loop repeats seamlessly. Song range: all parts in order plus at least 1.5 s ring-out (longer with reverb) and a 10 ms fade at the very end.
- The mix is written as 16-bit PCM WAV (rounded, no dither; samples beyond full scale clip and are counted). Levels, crest factor, the spectrum (Hann window, 4096-point Welch average of the mono mix) and the waveform come from the shared audio engine analysis.
Tonegrid sounds are simple synthesizers. Live playback in a browser uses Web Audio and can differ very slightly from this file (oscillator tables, reverb impulse length).
Sources
- Web Audio API 1.0 — AudioParam automation (exponentialRampToValueAtTime), OscillatorNode, BiquadFilterNode, StereoPannerNode (W3C)
- V. Välimäki, A. Huovilainen (2007): Antialiasing oscillators in subtractive synthesis, IEEE Signal Processing Magazine 24(2) (IEEE)
- Julius O. Smith: Freeverb (Physical Audio Signal Processing) (CCRMA, Stanford University)
Part of Tonegrid
-
Tonegrid Tone matrix & beat sequencer
Light up squares to build looping melodies and beats, then arrange them into songs.
Related tools
- Tonegrid Pattern Builder – Turn x-and-dot step notation into a Tonegrid project and a MIDI file.
- Audio Spectrum Analyzer – Upload audio and see its spectrum, peak frequencies, centroid, RMS/peak and waveform.
- Universal Audio Converter – Convert MP3, WAV, FLAC, Ogg, Opus, M4A and AIFF with bitrate and sample-rate control.
- Audio Loudness Normalizer – Measure LUFS and true peak, then normalise to Spotify, podcast or EBU R 128 targets.
How to use the Tonegrid Pattern Renderer
Render a Tonegrid project or share link to a stereo WAV loop or song, and read its peak, RMS and spectrum before you publish it.
What it is for
The Tonegrid Pattern Renderer turns a Tonegrid project into a finished audio file without opening the app. You paste the project — the content of a .tonegrid.json file, the project object the Tonegrid Pattern Builder returns, or a Tonegrid share link — choose one pattern loop or the whole song, and get a 16-bit stereo WAV at 44.1 kHz.
It is the same renderer the Tonegrid app uses for its WAV export, so a file made here and a file exported in the app are byte for byte identical. That makes it handy for scripts and AI agents: build a pattern with the Pattern Builder, render it here, and pass the WAV on to a converter or a video.
It does not record anything, load samples or change the music. Projects longer than 120 seconds or with more than 3,000 notes and drum hits in the chosen range are refused here; the app renders up to five minutes on your own device.
Worked example
The first example uses the Lo-fi evening template with the reverb room set to Living room, a melody send of 0.35, a drum send of 0.08 and the drums panned to 0.3 (right). With Range set to the pattern loop, the tool returned:
- File length 2.93 s, a seamless loop with 24 notes and drum hits.
- Peak level −12.9 dBFS and RMS level −32.1 dBFS, crest factor 19.2 dB, no clipped samples.
- Per channel: left peak −17.5 dBFS, right peak −12.9 dBFS — the drums sit on the right, as panned.
- Strongest spectral lines at 293.3 Hz and 522.5 Hz, the D and C of the pad chords.
To see the headroom getting tight, I took the Shuffle blues template, raised volume, melody and drum level to 100 %, and panned the drums to −0.4. The loop peaked at −6.2 dBFS on the left channel, still with zero clipped samples. Any clipping would show up as a warning and in the clipped-samples count.
How to read the result
The metrics at the top give the file length, the number of events, peak and RMS level, crest factor and clipped samples. Peak is the loudest single sample; RMS is the average level; a large crest factor (around 20 dB) is normal for sparse, percussive loops.
The levels table splits peak and RMS into left and right, so you can confirm panning decisions. The spectrum chart shows where the energy sits, with the strongest lines marked; the waveform overview shows the shape over time. seamlessLoop is true for pattern renders: the ring-out of long notes and the reverb tail is folded back onto the start, so the file repeats without a gap. Song renders add at least 1.5 s of ring-out (longer with reverb) and a 10 ms fade at the very end.
Tips and common mistakes
- Render the pattern for loops in games, videos or DAWs, and the song for a finished piece.
- A reverb send only sounds if the room is not set to none; a send of 0 leaves the file identical to a dry render.
- Peaks above −1 dBFS leave little room for MP3 encoding. Lower the master volume before converting.
- The renderer reads share links directly, so you can paste the link the Pattern Builder returns.
- Live playback in a browser uses Web Audio; tiny differences from this file (oscillator tables, reverb length) are expected.
FAQ
Is the WAV the same as the app's export?
Yes. The app and this tool call the same rendering function, and the test suite checks that both produce identical bytes for the same project.
Why is my loop not exactly a whole number of milliseconds?
The loop length follows the tempo exactly and is rounded to whole samples, so it can be a fraction of a sample shorter or longer than the ideal length.
Can I get MP3 instead of WAV?
Render the WAV here, then convert it with the Universal Audio Converter, or match streaming loudness with the Audio Loudness Normalizer.
Which project versions are accepted?
Every Tonegrid project from version 1 to 3. Files without pan or reverb settings render centred and dry.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://tonegridpatternrender.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://tonegridpatternrender.usefulweb.site/mcp· tool nametonegrid_pattern_render
Example request
curl -s -X POST https://tonegridpatternrender.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'