18 lines
600 B
Swift
18 lines
600 B
Swift
// LFOscillatorHelpers.swift
|
|
// Lyrebird
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// MARK: - LF Oscillator file-scope constants
|
|
|
|
/// Normalised half-phase boundary shared by LFSquare, LFTriangle, and LFDutyCycle.
|
|
let lfHalfPhase: Double = 0.5
|
|
|
|
/// Triangle raw-waveform slope in normalized-phase units.
|
|
/// Amplitude spans 2 over a half period (0.5), so slope = 2 / 0.5 = 4.
|
|
let lfTriangleSlope: Double = 4.0
|
|
|
|
// Phase normalisation is provided by `normalizeOscPhase` in OscBandLimitedHelpers.swift,
|
|
// shared by all LF and band-limited oscillators.
|