use mfctl_derive::author; use super::{ arp, cycling_envelope, envelope, filter, global, keyboard, lfo, modulation::Modulations, oscillator::Oscillator, vocoder, }; /// A complete desired patch. Missing sections and fields resolve to defaults, /// never to device state. In particular, spec: {} is the default patch. #[author(no_copy)] #[derive(Default)] #[serde(default, rename_all = "camelCase", deny_unknown_fields)] pub struct Spec { /// Global voice and level controls. #[serde(flatten)] pub global: global::Global, /// Oscillator model and its three controls. pub oscillator: Oscillator, /// Analog filter controls. pub filter: filter::Filter, /// Main amplitude envelope. pub envelope: envelope::Envelope, /// Cycling envelope. pub cycling_envelope: cycling_envelope::CyclingEnvelope, /// Low-frequency oscillator. pub lfo: lfo::Lfo, /// Keyboard and pitch controls. pub keyboard: keyboard::Keyboard, /// Arpeggiator and sequencer controls. pub arp: arp::Arp, /// Vocoder hiss controls. pub vocoder: vocoder::Vocoder, #[garde(dive, custom(|mods: &Modulations, _: &()| mods.validate_for(&self.oscillator)))] /// Modulation matrix destinations and assignments. pub modulations: Modulations, }