diff options
author | pommicket <pommicket@gmail.com> | 2022-10-06 11:31:30 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-10-06 11:31:30 -0400 |
commit | ddb787dc5b9cd73e170f8527ac959ef1f325e0aa (patch) | |
tree | dff0ce0fbae58d00db662f63e81a293a931e547d /src/soundfont.rs | |
parent | 58a0250c2580cb6bbdd641f780f0b149c840ed04 (diff) |
a bit of cleanup
Diffstat (limited to 'src/soundfont.rs')
-rw-r--r-- | src/soundfont.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/soundfont.rs b/src/soundfont.rs index 92fc49c..7d0cba5 100644 --- a/src/soundfont.rs +++ b/src/soundfont.rs @@ -96,7 +96,6 @@ struct Sample { data: Vec<i16>, } - /// basic usage: /// ``` /// let sf = SoundFont::open("soundfont.sf2"); @@ -146,7 +145,7 @@ pub struct SamplesRequest { // if a note is played for 2s at 440Hz, then 1s at 110Hz, this is 990 // storing it like this allows a note to change pitch without causing clicks t: f64, - + key: u8, vel: u8, falloff: f32, @@ -668,8 +667,7 @@ impl SoundFont { }; Self::open_file(File::open(filename)?, file_type) } - - + /// Like `open()` but takes a file instead of a file name. pub fn open_file(mut file: File, file_type: FileType) -> Result<Self, OpenError> { const RIFF: FourCC = fourcc("RIFF"); @@ -1325,7 +1323,7 @@ impl SoundFont { if falloff * request.volume < 1.0 / 32767.0 { this_held = false; } - final_t = f64::max(final_t, t); + final_t = f64::max(final_t, t); held |= this_held; } request.t = final_t; |