/ proof-of-concept / steelsim21
Sign in
proof-of-concept / steelsim21
steelsim21 / matching / README.md
3.4 KBPreviewCodeBlameHistoryRaw

Matching a simulated sound to a recording by post-processing#

This directory holds scripts for imposing the frequency-dependent decay of a recorded sheet on a simulated sound, as a quick way to hear how far the loss model is from the real sheet before changing the model itself. The generated audio and figures are not committed.

Files#

match.py takes --bands N to set the number of bands per octave (default 3). Twelfth-octave bands are narrow enough to weight individual partials, which makes the result closer to the recording but says less about the loss model.

The simulated input should be the raw float pressure that steelsim render writes next to the wav (NAME.f32); a 16-bit wav loses the tail of the simulated sound after a few seconds.

Method and its limits#

For each band the recording's decay rate is fitted from 0.15 s until the band comes within 6 dB of its noise floor (estimated from the pre-onset segment and from the end of the recording). A band that reaches the floor within half a second gives only a lower bound on its decay rate, which is used as is; a band that sits at the floor from the start (the lowest bands of the recording, which are within a few decibels of the room noise) carries no information, and the decay rate of the nearest determined band is borrowed. The gain applied to the simulation is the difference of the two decay rates times the time since the onset (decay mode), or the difference of the two envelopes while the recording is above its floor and the extrapolated slope afterwards (envelope mode). The gains are interpolated across STFT bins linearly in log frequency and the sound is resynthesized by inverse STFT.

The procedure changes envelopes, not partial frequencies: the modes of the simulated sheet stay where they are. It also cannot separate the attack from the early ring, so the first 100 ms are scaled like the early ring.

↑↓ move↵openescclose