diff options
author | Grant Shangreaux <grant@unabridgedsoftware.com> | 2021-11-09 20:49:57 -0600 |
---|---|---|
committer | Grant Shangreaux <grant@unabridgedsoftware.com> | 2021-11-09 20:50:32 -0600 |
commit | ab84f222a91fa6fa8453a7b91c86e43ab1938b20 (patch) | |
tree | 5af0716f9f2a3b0ad7fb1007938a94f1d7032ea0 /klangfarbrs/src | |
parent | bbaff2f4c5d379276034976503ce026dbd153132 (diff) |
Docs: update comments
Diffstat (limited to 'klangfarbrs/src')
-rw-r--r-- | klangfarbrs/src/lib.rs | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/klangfarbrs/src/lib.rs b/klangfarbrs/src/lib.rs index fafb5c0..2721e2f 100644 --- a/klangfarbrs/src/lib.rs +++ b/klangfarbrs/src/lib.rs @@ -1,10 +1,12 @@ -//! # Rust audio oscillator for the Godot game engine +//! # Rust Synthesizer for the Godot game engine //! //! This crate contains logic for generating samples for audio wave forms which are then //! used to fill Godot's `AudioStreamPlayback` buffers. Scripts using this code as a dynamic //! library will be able to request a certain number of frames (represented as a `Vector2`) -//! at a specific frequency. Because of how the Godot bindings work, the wave structs will -//! have a default sample rate at 48kHz. You'll want to set it in your script's `_ready` +//! generated with the current synthesis parameter settings. +//! +//! Because of how the Godot bindings work, the Synth will have a default +//! sample rate at 48kHz. You'll want to set it in your script's `_ready` //! function to match the sample rate in Godot. use gdnative::prelude::*; @@ -120,25 +122,14 @@ impl Bender { } } -/// # Examples -/// -/// It is more work than benefit to figure out how to instantiate a Godot object (Node) -/// that does not behave as typical Rust. However, I wanted to try out the feature of -/// examples in the documentation that run as automated tests. :galaxy-brain: -/// -/// ``` -/// use klangfarbrs::Osc; -/// let mut wave = Osc { sample_rate: 24000.0, phase: 0.0 }; -/// assert_eq!(wave.sample_rate, 24000.0); -/// ``` #[methods] impl MonoSynth { /// # Examples /// /// ```gdscript /// var MonoSynth = preload("res://MonoSynth.gdns") - /// var wave = MonoSynth.new() - /// wave.set_sample_rate(24000.0) + /// var synth = MonoSynth.new() + /// synth.set_sample_rate(24000.0) /// wave.square() # changes to a square wave /// ``` pub fn new(_owner: &Node) -> Self { |