1.2.1 release to support some ShoeGaze features

This commit is contained in:
2026-07-02 10:20:40 -07:00
parent 032b7c39d3
commit 676e8d3278
12 changed files with 673 additions and 10 deletions
@@ -0,0 +1,39 @@
// DbAmpTests.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import Testing
import Foundation
@testable @_spi(LyrebirdExtensions) import LyrebirdSynth
@MainActor
@Suite("DbAmp")
struct DbAmpTests {
let engine: SynthesisEngine = makeTestEngine(blockSize: 8)
var graph: SynthGraph { makeSynthGraph(engine: engine) }
init() throws { try engine.start() }
@Test func zeroDbReachesUnityGain() {
let s: [[Double]] = DbAmp.Control(ConstantAudioGen(0.0)).calculatedSamples(graph: graph, count: 8)
#expect(abs(s[0][7] - 1.0) < 1e-10)
}
@Test func minusTwentyDbReachesOneTenth() {
let s: [[Double]] = DbAmp.Control(ConstantAudioGen(-20.0)).calculatedSamples(graph: graph, count: 8)
#expect(abs(s[0][7] - 0.1) < 1e-9)
}
@Test func mulAddAppliedAfterConversion() {
let mulValue: Double = 2.0
let addValue: Double = 0.5
let s: [[Double]] = DbAmp.Control(
ConstantAudioGen(0.0),
mul: mulValue,
add: addValue
).calculatedSamples(graph: graph, count: 8)
#expect(abs(s[0][7] - (1.0 * mulValue + addValue)) < 1e-10)
}
}