//___FILEHEADER___ import LyrebirdSynth import LyrebirdUI import LyrebirdShoeGaze // MARK: - ___FILEBASENAMEASIDENTIFIER___ /// One-line description of the ___FILEBASENAMEASIDENTIFIER___ pedal. /// /// Subclasses `Pedal`: reads a mono dry signal from its input bus, processes it /// in `effect(_:)`, and lets the base class apply the wet/dry `mix`, click-free /// `bypass`, and output `level`. Publish the effect's knobs via `effectKnobs` /// so `PedalView` renders a control for each one. /// /// ## Usage /// ```swift /// let board = try shoeGaze.addBoard() /// try board.add(___FILEBASENAMEASIDENTIFIER___()) /// try shoeGaze.finalizeBoard(board) /// ``` final class ___FILEBASENAMEASIDENTIFIER___: Pedal { // MARK: - Parameters /// Effect amount. Range [0, 1]. @UIParam var amount: Double = 0.5 // MARK: - Constants /// Knob range for `amount`. private let amountRange: ClosedRange = 0.0 ... 1.0 // MARK: - Init init( inputBus: Int = 0, outputBus: Int = 0 ) { super.init(name: "___FILEBASENAMEASIDENTIFIER___", inputBus: inputBus, outputBus: outputBus) } // MARK: - Effect /// Build and return the processed **mono** signal. Replace the passthrough below. /// /// Fold any stereo generator (reverb, chorus) to mono with `SumChannels` before /// returning. Do not pre-blend with the dry signal — the base class `mix` does that. override func effect(_ dry: any ValidGeneratorInput) -> any ValidGeneratorInput { // TODO: wire your DSP here, e.g.: // return SoftClip.Audio(dry, drive: $amount * 10.0 + 1.0) dry } // MARK: - UI knobs /// Effect-specific knobs shown by `PedalView` before the common Mix / Level knobs. override var effectKnobs: [PedalKnob] { [ PedalKnob(label: "Amount", node: $amount, range: amountRange), ] } }