pub struct Routing { /* private fields */ }Expand description
One of the ten ways the four engines can be wired.
The FX Routing byte picks one. enums names them
the way the manual does, Parallel 1/2, parallel 3/4, which is for a person
to read. This is the same ten topologies as edge lists, which is what a host
draws a chain from.
use deepmind_midi::effect::{Engine, Routing, Source};
// M-1 is the four in series, and only the fourth reaches the output.
let serial = Routing::for_value(0).expect("ten topologies");
assert_eq!(serial.label(), "M-1");
assert_eq!(serial.feeds(Engine::One), &[Source::Input]);
assert_eq!(serial.feeds(Engine::Two), &[Source::Engine(Engine::One)]);
assert_eq!(serial.output(), &[Engine::Four]);
assert!(!serial.is_feedback());Implementations§
Source§impl Routing
impl Routing
Sourcepub fn all() -> &'static [Self; 10]
pub fn all() -> &'static [Self; 10]
Returns every topology, in the order the FX Routing byte numbers them.
Sourcepub fn for_value(value: u8) -> Option<&'static Self>
pub fn for_value(value: u8) -> Option<&'static Self>
Returns the topology the FX Routing byte selects.
None for a value the parameter does not accept. A lookup rather than an
index, so a firmware that renumbers these has somewhere to say so, the way
the value tables already do.
Sourcepub fn feeds(&self, engine: Engine) -> &'static [Source]
pub fn feeds(&self, engine: Engine) -> &'static [Source]
Returns what reaches this engine: the block’s own input, or other engines.
Sourcepub const fn output(&self) -> &'static [Engine]
pub const fn output(&self) -> &'static [Engine]
Returns the engines whose outputs are summed to leave the block.
What decides whether an engine’s FX n Output Gain reaches the output:
the manual defines a slot’s level as the level of an effect configured
in parallel, or last before the output stage.
Sourcepub const fn is_feedback(&self) -> bool
pub const fn is_feedback(&self) -> bool
Returns whether any engine is in a loop around the main path.
Two of the ten are. A host drawing one of those without knowing it draws a wrong picture confidently.