34 lines
1.3 KiB
Swift
34 lines
1.3 KiB
Swift
// LyrebirdFMAudioUnit.swift
|
|
// Lyrebird
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import LyrebirdSynth
|
|
import AVFoundation
|
|
import AudioToolbox
|
|
|
|
/// AUv3 wrapper around `LyrebirdFM`. Subclasses ``LyrebirdAudioUnit`` and
|
|
/// only overrides the two required hooks: `makeSynthesizer()` and
|
|
/// `parameterMetadata()`.
|
|
///
|
|
/// The `AudioComponentDescription` (type `aumu`, subtype `LBFM`,
|
|
/// manufacturer `RLZS`) is declared in `Info.plist`'s `AudioComponents`
|
|
/// array; this class is instantiated by the AU host via
|
|
/// `NSExtensionPrincipalClass` resolution.
|
|
public final class LyrebirdFMAudioUnit: LyrebirdAudioUnit {
|
|
|
|
public override class func makeSynthesizer() -> SynthesizerBase {
|
|
LyrebirdFM()
|
|
}
|
|
|
|
public override class func parameterMetadata() -> [String: LyrebirdAUParameterInfo] {
|
|
[
|
|
"carrierFreq": .init(min: 20, max: 8000, unit: .hertz, displayName: "Carrier Freq"),
|
|
"modRatio": .init(min: 0.25, max: 16, unit: .generic, displayName: "Mod Ratio"),
|
|
"modIndex": .init(min: 0, max: 8, unit: .generic, displayName: "Mod Index"),
|
|
"amp": .init(min: 0, max: 1, unit: .linearGain, displayName: "Output Amp"),
|
|
]
|
|
}
|
|
}
|