feat(pedals): Neural Amp pedal (S3) + PedalState resource path; Lyrebird 1.7.1
Bump Lyrebird to 1.7.1 (ProteusModelImporter) and add a neural amp-capture pedal. - NeuralAmpPedal: loads a GuitarML Proteus/NeuralPi model (via ProteusModelImporter) and runs it with LSTMAmp on the gain-trimmed input; passes through clean when no model is loaded. Model files are user-supplied, not bundled (GuitarML = GPL-3.0). - PedalState gains an optional `resourcePath` (backward-compatible, decodeIfPresent) and Pedal a matching `resourcePath` property, wired through captureState/applyState — so the loaded model file persists across rig save/load. The neural pedal reads it at build() (applied on rebuild). This foundation also unblocks a future custom-cabinet-IR path. - Registered in PedalRegistry / PedalType / PedalCategory (.gain) / palette / enclosure color; Help acknowledges the GuitarML model format. Tests: no-model passthrough; loaded model transforms output & differs from passthrough; gain affects modeled output; resourcePath round-trips through PedalState; gain knob exposed; registry resolves "Neural Amp". Full suite 501. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,10 @@ public struct PedalState: Codable, Equatable {
|
||||
/// decode to "all parameters free".
|
||||
public let tempoSync: [String: TempoSync]?
|
||||
|
||||
/// Optional path to an external resource the pedal references (e.g. a neural-amp model file).
|
||||
/// `nil` for pedals that use no external file, and for presets saved before this existed.
|
||||
public let resourcePath: String?
|
||||
|
||||
/// Creates a pedal state snapshot.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -60,6 +64,8 @@ public struct PedalState: Codable, Equatable {
|
||||
/// - selectorValues: Current selector values in `Pedal.effectSelectors` order. Defaults to empty.
|
||||
/// - bypass: Bypass parameter value (`0.0` = engaged, `1.0` = bypassed).
|
||||
/// - tempoSync: Tempo-sync state per syncable parameter, or `nil` for none. Defaults to `nil`.
|
||||
/// - resourcePath: Path to an external resource the pedal references (e.g. a neural-amp
|
||||
/// model file), or `nil`. Defaults to `nil`.
|
||||
public init(
|
||||
id: UUID = UUID(),
|
||||
type: String,
|
||||
@@ -68,7 +74,8 @@ public struct PedalState: Codable, Equatable {
|
||||
sliderValues: [Double] = [],
|
||||
selectorValues: [Double] = [],
|
||||
bypass: Double,
|
||||
tempoSync: [String: TempoSync]? = nil
|
||||
tempoSync: [String: TempoSync]? = nil,
|
||||
resourcePath: String? = nil
|
||||
) {
|
||||
self.id = id
|
||||
self.type = type
|
||||
@@ -78,6 +85,7 @@ public struct PedalState: Codable, Equatable {
|
||||
self.selectorValues = selectorValues
|
||||
self.bypass = bypass
|
||||
self.tempoSync = tempoSync
|
||||
self.resourcePath = resourcePath
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
@@ -89,6 +97,7 @@ public struct PedalState: Codable, Equatable {
|
||||
case selectorValues
|
||||
case bypass
|
||||
case tempoSync
|
||||
case resourcePath
|
||||
}
|
||||
|
||||
/// Decodes a snapshot, tolerating presets saved before `switchValues` / `sliderValues` /
|
||||
@@ -103,5 +112,6 @@ public struct PedalState: Codable, Equatable {
|
||||
self.selectorValues = try container.decodeIfPresent([Double].self, forKey: .selectorValues) ?? []
|
||||
self.bypass = try container.decode(Double.self, forKey: .bypass)
|
||||
self.tempoSync = try container.decodeIfPresent([String: TempoSync].self, forKey: .tempoSync)
|
||||
self.resourcePath = try container.decodeIfPresent(String.self, forKey: .resourcePath)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user