Bounce (Session::write_one_track) uses bounce_chunk_size = 8192
to process data. This requires gain_automation_buffer, and
scratch buffers that can hold 8k samples.
Previously the buffers were not allocated when bounding MIDI
(no synth), leading to a crash when automation was used.
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
Useful as temporary buffer: This allows a controllable to
get a master's automation-curve and combine it with its own
(gain, trim, send) automation buffer.
When allowing to cross-connect plugin-ports, inplace processing can
no longer be used. We need a complete set of independent input and
output buffers.
Since scratch and silent buffers are used by the various plugin
implementations we cannot re-use them in the PluginInsert.
Besides we need a complete BufferSet which can hold both: ins + outs.
This is needed for gain and pan automation buffers
as well as silent and scratch buffers when bouncing or
exporting with larger chunk size than the current engine
period.
"scratch buffers are by definition scratch and their contents are undefined at all times"
"silent buffers are by definition all-zero and should not be used for real data"
But track & route were using those for actual data; plugins (which may run
in the same thread and may get the same buffers) use them for scratch thereby
overwriting real data.
In particular get_silent_buffers() (used by LadspaPlugin::connect_and_run)
clears the buffer which can holds real data:
e.g. via Route::passthru_silence() -> plugin1 -> plugin2 (clears output of plugin1)