mirror of
https://github.com/storytold/soundcraft.git
synced 2026-11-10 04:14:22 +00:00
* Tempo map: index tempo segments so tick/sample conversions are O(log n) Every tick<->sample conversion walked all earlier tempo changes, so code that converts many positions (MIDI import/export, the tempo ruler, score layout, MIDI scheduling and controller chasing on the audio thread) cost positions x tempo changes. A session or MIDI file with many tempo changes and many notes or tracks could stall the engine or the audio callback. TempoMap now keeps the elapsed time at each tempo change (rebuilt on every edit and on deserialize, never serialized) and binary-searches the segment. MIDI scheduling also skips notes whose on and off both fall outside the block before converting them. * Tempo map: index a file's ticks with saturating subtraction