improving documentation

This commit is contained in:
Weird Constructor 2021-06-08 03:56:40 +02:00
parent 404c8d6509
commit 718f46154f
3 changed files with 29 additions and 16 deletions

View file

@ -1102,6 +1102,20 @@ macro_rules! make_node_info_enum {
$(NodeInfo::$variant(n) => n.1.out_count()),+ $(NodeInfo::$variant(n) => n.1.out_count()),+
} }
} }
pub fn desc(&self) -> &'static str {
match self {
NodeInfo::$v1 => "",
$(NodeInfo::$variant(n) => n.1.desc()),+
}
}
pub fn help(&self) -> &'static str {
match self {
NodeInfo::$v1 => "",
$(NodeInfo::$variant(n) => n.1.help()),+
}
}
} }
} }
} }

View file

@ -40,27 +40,26 @@ impl Sin {
"Sin sig\nOscillator signal output.\n\nRange: (-1..1)\n"; "Sin sig\nOscillator signal output.\n\nRange: (-1..1)\n";
pub const DESC : &'static str = pub const DESC : &'static str =
r#"Sin - A Sine Oscillator r#"Sine Oscillator
This is a very simple oscillator that generates a This is a very simple oscillator that generates a sine wave.
sine wave. "#;
"#;
pub const HELP : &'static str = pub const HELP : &'static str =
r#"Sin - A Sine Oscillator r#"Sin - A Sine Oscillator
This is a very simple oscillator that generates a sine wave. This is a very simple oscillator that generates a sine wave.
The 'freq' paramter specifies the frequency, and the 'det' parameter The 'freq' paramter specifies the frequency, and the 'det' parameter
allows you to detune the oscillator easily. allows you to detune the oscillator easily.
You can send any signal to these input ports. The 'det' parameter takes You can send any signal to these input ports. The 'det' parameter takes
the same signal range as 'freq', which means, that a value of 0.1 detunes the same signal range as 'freq', which means, that a value of 0.1 detunes
by one octave. And a value 1.0 detunes by 10 octaves. This means that by one octave. And a value 1.0 detunes by 10 octaves. This means that
for 'det' to be usefully modulated you need to attenuate the modulation input. for 'det' to be usefully modulated you need to attenuate the modulation input.
You can do FM with this node, but for easy FM synthesis there are other You can do FM with this node, but for easy FM synthesis there are other
nodes available. nodes available.
"#; "#;
} }
impl DspNode for Sin { impl DspNode for Sin {

View file

@ -264,7 +264,7 @@ mod util;
pub use nodes::{new_node_engine, NodeConfigurator, NodeExecutor}; pub use nodes::{new_node_engine, NodeConfigurator, NodeExecutor};
pub use cell_dir::CellDir; pub use cell_dir::CellDir;
pub use matrix::{Matrix, Cell}; pub use matrix::{Matrix, Cell};
pub use dsp::{NodeId, SAtom}; pub use dsp::{NodeId, SAtom, NodeInfo};
pub use matrix_repr::load_patch_from_file; pub use matrix_repr::load_patch_from_file;
pub use matrix_repr::save_patch_to_file; pub use matrix_repr::save_patch_to_file;
pub use sample_lib::{SampleLibrary, SampleLoadError}; pub use sample_lib::{SampleLibrary, SampleLoadError};