1.0.0 release
This commit is contained in:
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTD/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Kind</key>
|
||||
<string>Xcode.IDEKit.TextSubstitutionFileTemplateKind</string>
|
||||
<key>Platforms</key>
|
||||
<array>
|
||||
<string>com.apple.platform.macosx</string>
|
||||
<string>com.apple.platform.iphoneos</string>
|
||||
</array>
|
||||
<key>Description</key>
|
||||
<string>A pair: a SynthesizerBase subclass with @LiveParam slots + a LyrebirdAudioUnit subclass that wraps it as an AUv3 component. Override only makeSynthesizer() and parameterMetadata(); LyrebirdAudioUnit handles render setup, parameter ramping, and CoreMIDI 2.0 input. Pair with an Info.plist AudioComponents entry (type: aumu, your subtype + manufacturer) to register the AU with the host. See LyrebirdAUv3Demo for a complete project.</string>
|
||||
<key>Summary</key>
|
||||
<string>Lyrebird AUv3 Source-Slot Synth (Synth + LyrebirdAudioUnit)</string>
|
||||
<key>SortOrder</key>
|
||||
<string>35</string>
|
||||
<key>AllowedTypes</key>
|
||||
<array>
|
||||
<string>public.swift-source</string>
|
||||
</array>
|
||||
<key>DefaultCompletionName</key>
|
||||
<string>MyAUSynth</string>
|
||||
<key>MainTemplateFile</key>
|
||||
<string>___FILEBASENAME___.swift</string>
|
||||
<key>Options</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Identifier</key>
|
||||
<string>productName</string>
|
||||
<key>Required</key>
|
||||
<true/>
|
||||
<key>Name</key>
|
||||
<string>AU synth name:</string>
|
||||
<key>Description</key>
|
||||
<string>Name of the Synthesizer + AudioUnit pair (used as the file name and the Synthesizer class; the AU is named <Name>AudioUnit).</string>
|
||||
<key>Type</key>
|
||||
<string>text</string>
|
||||
<key>Default</key>
|
||||
<string>MyAUSynth</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Sources/LyrebirdCLI/Resources/XcodeTemplates/LyrebirdAUv3SynthAU.xctemplate/___FILEBASENAME___.swift
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
//___FILEHEADER___
|
||||
|
||||
import Foundation
|
||||
import AVFoundation
|
||||
import AudioToolbox
|
||||
import LyrebirdSynth
|
||||
|
||||
// MARK: - ___FILEBASENAMEASIDENTIFIER___
|
||||
|
||||
/// Synthesizer driven by the AUv3 host. Each `@LiveParam` slot maps to an
|
||||
/// `AUParameter` exposed by the wrapper class below via
|
||||
/// `parameterMetadata()`. The host writes parameter values through the AU's
|
||||
/// `AUParameterTree`; `LyrebirdAudioUnit` forwards each write to the matching
|
||||
/// `@LiveParam` (atomic, RT-safe).
|
||||
public final class ___FILEBASENAMEASIDENTIFIER___: SynthesizerBase {
|
||||
|
||||
/// Fundamental frequency in Hz. Range [20, 8000].
|
||||
@LiveParam public var frequency: Double = 440.0
|
||||
|
||||
/// Output amplitude (linear gain). Range [0, 1].
|
||||
@LiveParam public var amplitude: Double = 0.3
|
||||
|
||||
public override func build() {
|
||||
let osc = OscSin.Audio(freq: $frequency)
|
||||
let voice = osc * $amplitude
|
||||
// Mono → stereo for AUv3 host compatibility (most hosts negotiate
|
||||
// stereo output buses).
|
||||
output(bus: 0, source: voice)
|
||||
output(bus: 1, source: voice)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - ___FILEBASENAMEASIDENTIFIER___AudioUnit
|
||||
|
||||
/// AUv3 wrapper. Subclasses `LyrebirdAudioUnit`, which handles render setup,
|
||||
/// parameter ramping, and CoreMIDI 2.0 input. Override only the two class
|
||||
/// methods below.
|
||||
///
|
||||
/// To expose this AU to hosts (Logic, GarageBand, AUM, Loopy Pro, …):
|
||||
///
|
||||
/// 1. Make the containing target an Audio Unit App Extension (`.appex`).
|
||||
/// 2. Add an `AudioComponents` array to the extension's Info.plist:
|
||||
/// - `type: aumu` (music device) — change to `aufx` for effects
|
||||
/// - `subtype: ABCD` — 4-char identifier you choose
|
||||
/// - `manufacturer: WXYZ` — 4-char identifier you choose
|
||||
/// - `name: ___FILEBASENAMEASIDENTIFIER___`
|
||||
/// - `factoryFunction: $(PRODUCT_MODULE_NAME).___FILEBASENAMEASIDENTIFIER___AudioUnit`
|
||||
/// - `version: 1`
|
||||
/// 3. Set the extension's `NSExtensionPrincipalClass` to an
|
||||
/// `AUViewController` that returns this AU from `createAudioUnit(with:)`.
|
||||
/// 4. After build, validate with:
|
||||
/// auval -v aumu ABCD WXYZ
|
||||
///
|
||||
/// See `Demos/LyrebirdAUv3Demo/LyrebirdFMExtension/` for a complete working
|
||||
/// example with Info.plist, AUViewController, and a SwiftUI host app.
|
||||
public final class ___FILEBASENAMEASIDENTIFIER___AudioUnit: LyrebirdAudioUnit {
|
||||
|
||||
public override class func makeSynthesizer() -> SynthesizerBase {
|
||||
___FILEBASENAMEASIDENTIFIER___()
|
||||
}
|
||||
|
||||
public override class func parameterMetadata() -> [String: LyrebirdAUParameterInfo] {
|
||||
[
|
||||
"frequency": .init(min: 20, max: 8000, unit: .hertz, displayName: "Frequency"),
|
||||
"amplitude": .init(min: 0, max: 1, unit: .linearGain, displayName: "Amplitude"),
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user