MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / construct_processor

Method construct_processor

examples/custom_nodes/src/nodes/noise_gen.rs:81–94  ·  view source on GitHub ↗

Construct the realtime processor counterpart using the given information about the audio stream. This method is called before the node processor is sent to the realtime thread, so it is safe to do non-realtime things here like allocating.

(
        &self,
        config: &Self::Configuration,
        _cx: ConstructProcessorContext,
    )

Source from the content-addressed store, hash-verified

79 // This method is called before the node processor is sent to the realtime
80 // thread, so it is safe to do non-realtime things here like allocating.
81 fn construct_processor(
82 &self,
83 config: &Self::Configuration,
84 _cx: ConstructProcessorContext,
85 ) -> Result<impl AudioNodeProcessor, NodeError> {
86 // Seed cannot be zero.
87 let seed = if config.seed == 0 { 17 } else { config.seed };
88
89 Ok(Processor {
90 fpd: seed,
91 gain: self.volume.amp_clamped(DEFAULT_MIN_AMP),
92 params: *self,
93 })
94 }
95}
96
97// The realtime processor counterpart to your node.

Callers

nothing calls this directly

Calls 1

amp_clampedMethod · 0.80

Tested by

no test coverage detected