MCPcopy
hub / github.com/andremichelle/openDAW / step

Function step

packages/studio/core-workers/src/offline-engine-main.ts:45–63  ·  view source on GitHub ↗
(numSamples: int)

Source from the content-addressed store, hash-verified

43 new Function(code)()
44 },
45 async step(numSamples: int): Promise<Float32Array[]> {
46 const engine = state.unwrap()
47 const result: Float32Array[] = Arrays.create(() => new Float32Array(numSamples), engine.numberOfChannels)
48 const outputChannels: Float32Array[] = Arrays.create(() => new Float32Array(RenderQuantum), engine.numberOfChannels)
49 let offset = 0 | 0
50 while (offset < numSamples) {
51 const outputs: Float32Array[][] = [outputChannels]
52 updateFrameTime(engine.totalFrames, engine.sampleRate)
53 engine.processor.process([[]], outputs)
54 engine.totalFrames += RenderQuantum
55 const needed = numSamples - offset
56 const toCopy = Math.min(needed, RenderQuantum)
57 for (let ch = 0; ch < engine.numberOfChannels; ch++) {
58 result[ch].set(outputs[0][ch].subarray(0, toCopy), offset)
59 }
60 offset += toCopy
61 }
62 return result
63 },
64 async render(config: OfflineEngineRenderConfig) {
65 const engine = state.unwrap()
66 const {silenceThresholdDb, silenceDurationSeconds, maxDurationSeconds} = config

Callers

nothing calls this directly

Calls 6

updateFrameTimeFunction · 0.90
unwrapMethod · 0.65
createMethod · 0.65
processMethod · 0.65
setMethod · 0.65
minMethod · 0.45

Tested by

no test coverage detected