1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! ParameterWrite — polymorphic control interface for DSP engines.
//!
//! Decouples parameter dispatch from the concrete engine type,
//! enabling generic controllers (sequencers, MIDI, OSC) to write
//! parameters to oscillators, chip emulators, or any `Algorithm`
//! implementor through a uniform `write_parameter(name, value)` call.
use crate;
/// Polymorphic parameter write interface for DSP engines.
///
/// Implementors accept named parameter writes and apply them
/// immediately to internal state. The set of supported names
/// is engine-specific.
///
/// # Relationship to `Algorithm<T>`
///
/// `ParameterWrite` handles the *control* path (parameter changes
/// from UI, MIDI, OSC, sequencers). `Algorithm<T>` handles the
/// *signal* path (per-block audio generation via `process()`).
/// Engines typically implement both.
///
/// # Example
///
/// ```ignore
/// fn send_cc(target: &mut dyn ParameterWrite, cc: u8, value: u8) {
/// let _ = target.write_parameter(
/// "amplitude",
/// ParamValue::Float(value as f32 / 127.0),
/// );
/// }
/// ```