prep for 1.2.0 release updates
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
// LFCurveNoiseAudioGenFreqTests.swift
|
||||
// Lyrebird
|
||||
//
|
||||
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import Testing
|
||||
@testable @_spi(LyrebirdExtensions) import LyrebirdSynth
|
||||
|
||||
@MainActor
|
||||
@Suite("LFCurveNoise.Audio generator freq")
|
||||
struct LFCurveNoiseAudioGenFreqTests {
|
||||
|
||||
@Test func generatorFreqDoesNotCrash() throws {
|
||||
let engine: SynthesisEngine = makeTestEngine(blockSize: 64)
|
||||
try engine.start()
|
||||
defer { engine.stop() }
|
||||
|
||||
let freqNode: ParameterNode = ParameterNode(2.0)
|
||||
let noise: LFCurveNoise.Audio = LFCurveNoise.Audio(freq: freqNode)
|
||||
|
||||
let g: SynthGraph = makeSynthGraph(engine: engine)
|
||||
let out: [[Double]] = noise.calculatedSamples(graph: g, count: 64)
|
||||
let samples: [Double] = Array((out.first ?? []).prefix(64))
|
||||
#expect(samples.allSatisfy { $0.isFinite }, "LFCurveNoise.Audio output must be finite")
|
||||
}
|
||||
|
||||
@Test func generatorFreqRampChangesOutput() throws {
|
||||
let engine: SynthesisEngine = makeTestEngine(blockSize: 64, sampleRate: 44100)
|
||||
try engine.start()
|
||||
defer { engine.stop() }
|
||||
|
||||
let freqNode: ParameterNode = ParameterNode(0.0)
|
||||
let noise: LFCurveNoise.Audio = LFCurveNoise.Audio(freq: freqNode, seed: 7)
|
||||
|
||||
let g1: SynthGraph = makeSynthGraph(engine: engine)
|
||||
_ = noise.calculatedSamples(graph: g1, count: 64)
|
||||
advanceBlock(engine)
|
||||
|
||||
freqNode.value = 3000.0
|
||||
let g2: SynthGraph = makeSynthGraph(engine: engine)
|
||||
let out2: [[Double]] = noise.calculatedSamples(graph: g2, count: 64)
|
||||
|
||||
let samples2: [Double] = Array((out2.first ?? []).prefix(64))
|
||||
#expect(samples2.allSatisfy { $0.isFinite }, "LFCurveNoise.Audio output finite after freq ramp")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user