pub struct Code {
backend: Option<CodeEngineBackend>,
srate: f64,
}
Expand description
A WBlockDSP code execution node for JIT’ed DSP code
Fields
backend: Option<CodeEngineBackend>
srate: f64
Implementations
sourceimpl Code
impl Code
pub fn new(nid: &NodeId, node_global: &NodeGlobalRef) -> Self
pub const in1: &'static str = "Input Signal 1"
pub const in2: &'static str = "Input Signal 2"
pub const alpha: &'static str = "Input Parameter Alpha"
pub const beta: &'static str = "Input Parameter Beta"
pub const delta: &'static str = "Input Parameter Delta"
pub const gamma: &'static str = "Input Parameter Gamma"
pub const sig: &'static str = "Return output"
pub const sig1: &'static str = "Signal channel 1 output"
pub const sig2: &'static str = "Signal channel 2 output"
pub const DESC: &'static str = "WBlockDSP Code Execution\n\n\ This node executes just in time compiled code as fast as machine code. \ Use this to implement real time DSP code yourself. The inputs are freely \ useable in your code. All the ports (input and output) can be used either \ for audio or for control signals."
pub const HELP: &'static str = r#"WBlockDSP Code Execution This node executes just in time compiled code as fast as machine code. Use this to implement real time DSP code yourself. The inputs are freely useable in your code. All the ports (input and output) can be used either for audio or for control signals. The inputs ~~in1~~ and ~~in2~~ are thought to be a stereo signal input. But you are free to repurpose them as you like. The inputs ~~alpha~~, ~~beta~~, ~~delta~~ and ~~gamma~~ can be used as parameters in your code. But are also not restricted, so you may use them as audio signal inputs. The outputs ~~sig~~, ~~sig1~~ and ~~sig3~~ are also freely useable. Some ideas how to use this, you can build your own: - Waveshapers - Signal Generators (Oscillators) - Custom LFO - Control Signal shapers or generators - Sequencers - ... and many more things! "#
pub fn graph_fun() -> Option<GraphFun>
Trait Implementations
sourceimpl DspNode for Code
impl DspNode for Code
sourcefn set_sample_rate(&mut self, srate: f32)
fn set_sample_rate(&mut self, srate: f32)
Updates the sample rate for the node.
sourcefn process(
&mut self,
ctx: &mut dyn NodeAudioContext,
_ectx: &mut NodeExecContext,
_nctx: &NodeContext<'_>,
_atoms: &[SAtom],
inputs: &[ProcBuf],
outputs: &mut [ProcBuf],
ctx_vals: LedPhaseVals<'_>
)
fn process(
&mut self,
ctx: &mut dyn NodeAudioContext,
_ectx: &mut NodeExecContext,
_nctx: &NodeContext<'_>,
_atoms: &[SAtom],
inputs: &[ProcBuf],
outputs: &mut [ProcBuf],
ctx_vals: LedPhaseVals<'_>
)
The code DSP function. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl !UnwindSafe for Code
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more