plan_waves

Contents

plan_waves#

pulserver.ir.plan_waves()[source]#

Lay out the waves of the cache beside a sequence file in a playout’s waveform memory.

With budget, the layout is computed for it here, as convert() computes the one a cache carries; without one, it is the layout the cache carries. Every wave is held at once where that fits the budget’s memory on each gradient axis; otherwise each segment position that plays waves holds a ring of slots slots, and the n-th instance of a segment in the scan plays slot n % slots. With a load rate, the loading is checked on the playout’s timeline scaled by the headroom: the scan starts with its first instance’s waves loaded, and the waves of each later instance are loaded one instance after another, from once the instance slots - 1 before it has started, and have to be loaded before it starts.

Returns:

  • budget: the budget it is laid out for, as WaveBudget fields;

  • mode: "none", "resident" or "streamed";

  • samples, resident_samples, streamed_samples: per axis, what the mode holds, every wave at once, and the slots of every position;

  • waves: per subsequence, the region of each wave, for a resident layout;

  • slots: per segment, the ring of regions of each position, for a streamed layout; samples is 0 where the position plays no wave;

  • loading_checked, least_spare_us, tightest: whether the loading was checked; the least, over the instances after the first up to the first whose loading ends after it starts, of how long before its start its loading ends, on the scaled timeline, in µs; and the subsequence and execution-stream position of the instance it is found at.

A region holds samples samples on each axis it drives, from offset in that axis’s memory, -1 on another, sampled at the centres of the raster intervals from start_us, in µs from the block’s start, as sample_wave() samples them.

Return type:

dict of str to Any

Raises:

ValueError – If the cache cannot be loaded, if neither layout fits, or if a segment instance cannot be loaded in time.