Finished parameter access nodes

This commit is contained in:
Weird Constructor 2022-08-20 17:27:08 +02:00
parent 82d903edba
commit be4e9232cc
6 changed files with 79 additions and 33 deletions

View file

@ -19,3 +19,4 @@ the scope handles for access to it's capture buffers.
* Feature: Added the `FormFM` node that was contributed by Dimas Leenman (aka Skythedragon).
* Feature: Added `MidiP` node for MIDI pitch/note input.
* Feature: Added `MidiCC` node for MIDI CC input.
* Feature: Added `ExtA` to `ExtF` nodes for plugin parameter access.

View file

@ -505,6 +505,8 @@ mod node_cqnt;
#[allow(non_upper_case_globals)]
mod node_delay;
#[allow(non_upper_case_globals)]
mod node_ext;
#[allow(non_upper_case_globals)]
mod node_fbwr_fbrd;
#[allow(non_upper_case_globals)]
mod node_formfm;
@ -513,8 +515,6 @@ mod node_map;
#[allow(non_upper_case_globals)]
mod node_midicc;
#[allow(non_upper_case_globals)]
mod node_ext;
#[allow(non_upper_case_globals)]
mod node_midip;
#[allow(non_upper_case_globals)]
mod node_mix3;
@ -602,17 +602,17 @@ use node_code::Code;
use node_comb::Comb;
use node_cqnt::CQnt;
use node_delay::Delay;
use node_fbwr_fbrd::FbRd;
use node_fbwr_fbrd::FbWr;
use node_formfm::FormFM;
use node_map::Map;
use node_midicc::MidiCC;
use node_ext::ExtA;
use node_ext::ExtB;
use node_ext::ExtC;
use node_ext::ExtD;
use node_ext::ExtE;
use node_ext::ExtF;
use node_fbwr_fbrd::FbRd;
use node_fbwr_fbrd::FbWr;
use node_formfm::FormFM;
use node_map::Map;
use node_midicc::MidiCC;
use node_midip::MidiP;
use node_mix3::Mix3;
use node_mux9::Mux9;

View file

@ -8,7 +8,6 @@ use crate::dsp::{
use crate::nodes::{NodeAudioContext, NodeExecContext};
use synfx_dsp::SlewValue;
macro_rules! define_ext {
($name: ident, $p1: ident, $p2: ident, $p3: ident) => {
#[derive(Debug, Clone)]
@ -28,17 +27,32 @@ macro_rules! define_ext {
pub const atv2: &'static str = "ExtA-F atv2\nAttenuverter for the A2 parameter\nRange: (-1..1)";
pub const atv3: &'static str = "ExtA-F atv3\nAttenuverter for the A3 parameter\nRange: (-1..1)";
pub const sig1: &'static str = "ExtA-F sig1\nA1 output channel\nRange: (-1..1)";
pub const sig2: &'static str = "ExtA-F sig2\nA2 output channel\nRange: (-1..1)";
pub const sig3: &'static str = "ExtA-F sig3\nA3 output channel\nRange: (-1..1)";
pub const sig1: &'static str = "ExtA-F sig1\nA-F1 output channel\nRange: (0..1)";
pub const sig2: &'static str = "ExtA-F sig2\nA-F2 output channel\nRange: (0..1)";
pub const sig3: &'static str = "ExtA-F sig3\nA-F3 output channel\nRange: (0..1)";
pub const DESC: &'static str = "External Parameter Set A-F Input\n\n\
\
\
\
";
pub const DESC: &'static str = "Ext. Parameter Set A-F Input\n\n\
This node gives access to the 24 input parameters of the HexoSynth VST3/CLAP plugin. \
A 'slew' limiter allows you to smooth out quick changes a bit if you need it. \
Attenuverters (attenuators that can also invert) allow to reduce the amplitude \
or invert the signal.";
pub const HELP: &'static str = r#"External Parameter Set A-F Input
"#;
This node gives access to the 24 input parameters of the
HexoSynth VST3/CLAP plugin. A 'slew' limiter allows you to smooth out quick
changes a bit if you need it. Attenuverters (attenuators that can also invert)
allow to reduce the amplitude or invert the signal.
All instances of the nodes 'ExtA', 'ExtB', ..., 'ExtF' have access to the same
3 input parameters (A1-A3, B1-B3, ..., F1-F3). That means there is no
difference whether you use the same instance of different ones.
Except that you can of course set the `atv` and `slew` parameters to different
values.
If you absolutely need more parameters to control the HexoSynth patch:
Keep in mind, that there is also the 'MidiCC' node, that allows HexoSynth to
react to MIDI CC messages.
"#;
}
impl DspNode for $name {

View file

@ -64,6 +64,7 @@ And following DSP nodes:
| IO Util | Scope | Oscilloscope for up to 3 channels |
| IO Util | MidiP | MIDI Pitch/Note input from plugin host, DAW or hardware |
| IO Util | MidiCC | MIDI CC input from plugin host, DAW or hardware |
| IO Util | ExtA - ExtF | Access to plugin parameter sets A to F |
## API Examples

View file

@ -181,21 +181,51 @@ pub trait ExternalParams: Send + Sync {
fn a1(&self) -> f32;
fn a2(&self) -> f32;
fn a3(&self) -> f32;
fn b1(&self) -> f32 { self.a1() }
fn b2(&self) -> f32 { self.a2() }
fn b3(&self) -> f32 { self.a3() }
fn c1(&self) -> f32 { self.a1() }
fn c2(&self) -> f32 { self.a2() }
fn c3(&self) -> f32 { self.a3() }
fn d1(&self) -> f32 { self.a1() }
fn d2(&self) -> f32 { self.a2() }
fn d3(&self) -> f32 { self.a3() }
fn e1(&self) -> f32 { self.a1() }
fn e2(&self) -> f32 { self.a2() }
fn e3(&self) -> f32 { self.a3() }
fn f1(&self) -> f32 { self.a1() }
fn f2(&self) -> f32 { self.a2() }
fn f3(&self) -> f32 { self.a3() }
fn b1(&self) -> f32 {
self.a1()
}
fn b2(&self) -> f32 {
self.a2()
}
fn b3(&self) -> f32 {
self.a3()
}
fn c1(&self) -> f32 {
self.a1()
}
fn c2(&self) -> f32 {
self.a2()
}
fn c3(&self) -> f32 {
self.a3()
}
fn d1(&self) -> f32 {
self.a1()
}
fn d2(&self) -> f32 {
self.a2()
}
fn d3(&self) -> f32 {
self.a3()
}
fn e1(&self) -> f32 {
self.a1()
}
fn e2(&self) -> f32 {
self.a2()
}
fn e3(&self) -> f32 {
self.a3()
}
fn f1(&self) -> f32 {
self.a1()
}
fn f2(&self) -> f32 {
self.a2()
}
fn f3(&self) -> f32 {
self.a3()
}
}
/// Contains global state that all nodes can access.

View file

@ -59,7 +59,7 @@ fn check_node_code_state() {
put_v(&mut block_fun, 0, 0, 3, "value", "220.0");
put_n(&mut block_fun, 0, 1, 2, "phase");
block_fun.shift_port(0, 1, 2, 0, false); // move reset up
block_fun.shift_port(0, 1, 2, 0, true); // move output down
block_fun.shift_port(0, 1, 2, 0, true); // move output down
put_v(&mut block_fun, 0, 1, 4, "value", "2.0");
put_n(&mut block_fun, 0, 2, 3, "*");
put_n(&mut block_fun, 0, 3, 2, "-");