NibbleRealm / twang

Library for pure Rust advanced audio synthesis.
https://nibblerealm.com/twang/
Apache License 2.0
125 stars 8 forks source link

Panic in synth example #5

Closed swiftcoder closed 2 years ago

swiftcoder commented 3 years ago

Describe the bug The synth example panics when run.

To Reproduce cargo run --example synth

cargo run --example synth
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target\debug\examples\synth.exe`
thread 'main' panicked at 'got non-finite value when converting float to duration', C:\Users\swift\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\time.rs:685:13
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0\/library\std\src\panicking.rs:493
   1: core::panicking::panic_fmt
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0\/library\core\src\panicking.rs:92
   2: core::panicking::panic
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0\/library\core\src\panicking.rs:50
   3: core::time::Duration::from_secs_f64
             at C:\Users\swift\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\time.rs:685
   4: core::time::Duration::div_f64
             at C:\Users\swift\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\time.rs:795
   5: twang::synth::Fc::freq
             at .\src\synth.rs:23
   6: synth::main::gen_synth
             at .\examples\synth.rs:32
   7: twang::synth::{{impl}}::next<tuple<>>
             at .\src\synth.rs:69
   8: synth::main
             at .\examples\synth.rs:41
   9: core::ops::function::FnOnce::call_once<fn(),tuple<>>
             at C:\Users\swift\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: process didn't exit successfully: `target\debug\examples\synth.exe` (exit code: 101)

Desktop (please complete the following information):

AldaronLau commented 3 years ago

@swiftcoder thanks, I'll look into fixing this!

AldaronLau commented 2 years ago

@swiftcoder All the examples should build in the new version, so closing.