From 4384f0a2e1a0e8255111a682d249e26b69d11d4a Mon Sep 17 00:00:00 2001 From: Weird Constructor Date: Sat, 22 May 2021 12:13:38 +0200 Subject: [PATCH] added parameters --- src/dsp/mod.rs | 9 ++++++++- src/dsp/node_sampl.rs | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/dsp/mod.rs b/src/dsp/mod.rs index b766636..2061310 100644 --- a/src/dsp/mod.rs +++ b/src/dsp/mod.rs @@ -275,7 +275,12 @@ macro_rules! node_list { [5 trk6], sampl => Sampl UIType::Generic UICategory::Osc (0 freq n_pit d_pit -1.0, 1.0, 440.0) - {1 0 sample audio_unloaded("") 0 0} + (1 trig n_id n_id -1.0, 1.0, 0.0) + (2 spos n_id n_id -1.0, 1.0, 0.0) + (3 epos n_id n_id -1.0, 1.0, 0.0) + {4 0 sample audio_unloaded("") 0 0} + {5 1 pmode setting(0) 0 1} + {6 2 dclick setting(1) 0 1} [0 sig], sin => Sin UIType::Generic UICategory::Osc (0 freq n_pit d_pit -1.0, 1.0, 440.0) @@ -320,6 +325,8 @@ pub mod labels { pub mod Sampl { pub const sample : [&'static str; 0] = []; + pub const dclick : [&'static str; 2] = ["Off", "On"]; + pub const pmode : [&'static str; 2] = ["Loop", "OneShot"]; } } diff --git a/src/dsp/node_sampl.rs b/src/dsp/node_sampl.rs index 246789b..1815932 100644 --- a/src/dsp/node_sampl.rs +++ b/src/dsp/node_sampl.rs @@ -22,8 +22,29 @@ impl Sampl { pub const freq : &'static str = "Sampl freq\nPitch input for the sampler, giving the playback speed of the\ sample.\nRange: (-1..1)\n"; + + pub const trig : &'static str = + "Sampl trig\nThe trigger input causes a resync of the playback phase\ + and triggers the playback if the 'pmode' is 'OneShot'"; + pub const spos : &'static str = + "Sampl spos\nStart position offset.\nRange: (-1..1)\n"; + pub const epos : &'static str = + "Sampl epos\nEnd position offset.\nRange: (-1..1)\n"; + pub const sample : &'static str = "Sampl sample\nThe audio sample that is played back.\nRange: (-1..1)\n"; + + pub const pmode : &'static str = + "Sampl pmode\nThe playback mode of the sampler.\n\ + - 'Loop' constantly plays back the sample. You can reset/sync the phase\ + using the 'trig' input in this case.\n\ + - 'OneShot' plays back the sample if a trigger is received on 'trig' input.\n"; + pub const dclick : &'static str = + "Sampl dclick\nIf this is enabled and the 'pmode' is 'OneShot'\ + this will enable short fade in and out ramps.\n\ + This if useful if you don't want to add an envelope just for\ + getting rid of the clicks if spos and epos are modulated."; + pub const sig : &'static str = "Sampl sig\nSampler audio output\nRange: (-1..1)\n"; }