Browse Source

Merge branch 'fix-build-problems'

master
Andreas Linz 2 years ago
parent
commit
6a210daece
17 changed files with 1063 additions and 663 deletions
  1. +527
    -133
      Cargo.lock
  2. +1
    -1
      Cargo.toml
  3. +3
    -3
      benches/osc.rs
  4. +3
    -3
      src/dsp/dynamics.rs
  5. +12
    -7
      src/dsp/env_gen.rs
  6. +62
    -54
      src/dsp/filter.rs
  7. +13
    -8
      src/dsp/flow.rs
  8. +9
    -9
      src/dsp/mod.rs
  9. +43
    -35
      src/dsp/voice.rs
  10. +84
    -77
      src/dsp/wavetable.rs
  11. +1
    -1
      src/errors.rs
  12. +4
    -4
      src/event/mod.rs
  13. +58
    -85
      src/io/midi.rs
  14. +2
    -3
      src/io/mod.rs
  15. +103
    -103
      src/io/osc.rs
  16. +137
    -135
      src/main.rs
  17. +1
    -2
      src/types.rs

+ 527
- 133
Cargo.lock View File

@ -1,47 +1,74 @@
[root]
name = "ytterbium"
version = "0.1.0"
[[package]]
name = "aho-corasick"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
"hound 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"portmidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rosc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rsoundio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"rustfft 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ansi_term"
version = "0.9.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "approx"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "atty"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace-sys"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bincode"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bitflags"
version = "0.7.0"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitflags"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -49,41 +76,111 @@ name = "byteorder"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cargo_metadata"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cc"
version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cfg-if"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "clap"
version = "2.11.2"
version = "2.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clippy"
version = "0.0.88"
version = "0.0.212"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"clippy_lints 0.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy_lints 0.0.212 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clippy_lints"
version = "0.0.88"
version = "0.0.212"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "either"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "error-chain"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-zircon-sys"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "getopts"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -91,122 +188,204 @@ name = "hound"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "idna"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "if_chain"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "itertools"
version = "0.4.18"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "kernel32-sys"
version = "0.2.2"
name = "itertools"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "itoa"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazy_static"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libc"
version = "0.2.15"
version = "0.2.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "matches"
version = "0.1.2"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "nom"
version = "1.2.4"
name = "memchr"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num"
version = "0.1.35"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
"num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-bigint"
version = "0.1.35"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-complex"
version = "0.1.35"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-integer"
version = "0.1.32"
version = "0.1.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-iter"
version = "0.1.32"
version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-rational"
version = "0.1.35"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-traits"
version = "0.1.35"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num-traits"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "percent-encoding"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
version = "0.3.8"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "portmidi"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "proc-macro2"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "pulldown-cmark"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quine-mc_cluskey"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "quote"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand"
version = "0.3.14"
version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -214,10 +393,38 @@ name = "rb"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "redox_syscall"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "redox_termios"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex-syntax"
version = "0.3.5"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rosc"
@ -232,122 +439,309 @@ name = "rsoundio"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-demangle"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-serialize"
version = "0.3.19"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc_version"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustfft"
version = "1.0.1"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ryu"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "semver"
version = "0.2.3"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde"
version = "0.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_derive"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_json"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "strsim"
version = "0.5.1"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "syn"
version = "0.15.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "termion"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "term_size"
version = "0.2.1"
name = "textwrap"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "thread_local"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "toml"
version = "0.1.30"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicode-normalization"
version = "0.1.2"
name = "ucd-util"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-segmentation"
version = "0.1.2"
name = "unicode-bidi"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicode-normalization"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-width"
version = "0.1.3"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "url"
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "utf8-ranges"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "vec_map"
version = "0.6.0"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "version_check"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.2.8"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi-build"
version = "0.1.1"
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ytterbium"
version = "0.1.0"
dependencies = [
"approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.212 (registry+https://github.com/rust-lang/crates.io-index)",
"hound 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"portmidi 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"rb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rosc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rsoundio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rustfft 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1f46cd5b1d660c938e3f92dfe7a73d832b3281479363dd0cd9c1c2fbf60f7962"
"checksum approx 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "514a6d760da537c6d7b16f1197d0c3e887d8313c954696b4c56cd75592afa2ee"
"checksum bincode 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "5ebf196f284c03a75b48295fc221c7451eaed2c2173102b9a0255bf5ece01577"
"checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23"
"checksum aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "68f56c7353e5a9547cbd76ed90f7bb5ffc3ba09d4ea9bd1d8c06c8b1142eeb5a"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94"
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
"checksum bincode 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "aa413a0580cf7d54f1938c13462fd32cff9099338bf161e15870cb05021df745"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
"checksum clap 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96fee724ff92564914e8aa708919449e0c7b165f7833110b4b1ade9b3a9b17e8"
"checksum clippy 0.0.71 (registry+https://github.com/rust-lang/crates.io-index)" = "cfc33fd87ddf3a3eb5b655f593a5f98d1358f9df84c7a1e15738f2e1e8c87a5a"
"checksum clippy_lints 0.0.71 (registry+https://github.com/rust-lang/crates.io-index)" = "40de27a64e0a308fb59ad454824520953eba6ff2d8942ceb671dab6725835348"
"checksum cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1efca0b863ca03ed4c109fb1c55e0bc4bbeb221d3e103d86251046b06a526bd0"
"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16"
"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
"checksum clippy 0.0.212 (registry+https://github.com/rust-lang/crates.io-index)" = "7e253af13a0cc39c7f22cf16f1be49d593dedc5895fe2fbb15f14d66ead00533"
"checksum clippy_lints 0.0.212 (registry+https://github.com/rust-lang/crates.io-index)" = "bd2326065405649672adbd5cb30dad2fad3a470935653d51c70591d47d3a8512"
"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0"
"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
"checksum getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0a7292d30132fb5424b354f5dc02512a86e4c516fe544bb7a25e7f266951b797"
"checksum hound 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e971fe26207d3ccdc66806fd9154508b28101fccb53fe152695e3ebcb53bd0f"
"checksum itertools 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)" = "88f21fed5ebd96f4db04106cd37c21417393e08533d3914a42fc666f75d5064f"
"checksum libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c96061f0c8a2dc27482e394d82e23073569de41d73cd736672ccd3e5c7471bfd"
"checksum nom 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d1b06a35295796400a1db7382054f93713bf3924e7c268af94c5357b9fbf4cb6"
"checksum num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "c04bd954dbf96f76bab6e5bd6cef6f1ce1262d15268ce4f926d2b5b778fa7af2"
"checksum num-bigint 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "41655c8d667be847a0b72fe0888857a7b3f052f691cf40852be5fcf87b274a65"
"checksum num-complex 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "ccac67baf893ac97474f8d70eff7761dabb1f6c66e71f8f1c67a6859218db810"
"checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92"
"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c"
"checksum num-rational 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "48cdcc9ff4ae2a8296805ac15af88b3d88ce62128ded0cb74ffb63a587502a84"
"checksum num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "51eab148f171aefad295f8cece636fc488b9b392ef544da31ea4b8ef6b9e9c39"
"checksum pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8cee804ecc7eaf201a4a207241472cc870e825206f6c031e3ee2a72fa425f2fa"
"checksum portmidi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6768ab87a8e999bc0ad490e6fb440079c258726d200ac21a2bc2174100dbfa4"
"checksum quine-mc_cluskey 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6683b0e23d80813b1a535841f0048c1537d3f86d63c999e8373b39a9b0eb74a"
"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5"
"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
"checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec"
"checksum itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f"
"checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450"
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7"
"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
"checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b"
"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e"
"checksum num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1"
"checksum num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656"
"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea"
"checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124"
"checksum num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e"
"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31"
"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1"
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
"checksum portmidi 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8e72656dc8167fc128af6ea91224ab4cb9a584cb1ecdcf955a31dbcf3f888747"
"checksum proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "ffe022fb8c8bd254524b0b3305906c1921fa37a84a644e29079a9e62200c3901"
"checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32"
"checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45"
"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5"
"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1"
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
"checksum rb 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bf4244668d567959acbf78b19ce254f4f82bdf731b7349b79e3ae01504e28980"
"checksum regex-syntax 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "baa04823ba7be7ed0bed3d0704c7b923019d9c4e4931c5af2804c7c7a0e3d00b"
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341"
"checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d"
"checksum rosc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d7e5a8e5fbf9be024e8b92d066ed9b2bebc45e076fc4f7847d60a8cb3c0cc14"
"checksum rsoundio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4f711c6ad321933645937b901d38e1b2a3d12201c00fba0bedeb5e0f8c73a762"
"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b"
"checksum rustfft 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "84e59503875a5f7a3768601079b7bb43e8954055ecfe78c6c993e8745eb717d9"
"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f"
"checksum serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ff69b25273cf736fec8383121144754f9b0bb7b8a5ec0e84e0b5d3fe06fde99f"
"checksum strsim 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5f575d5ced6634a5c4cb842163dab907dc7e9148b28dc482d81b8855cbe985"
"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
"checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172"
"checksum unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6722facc10989f63ee0e20a83cd4e1714a9ae11529403ac7e0afd069abc39e"
"checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f"
"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
"checksum rustfft 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6b39b62db1c690e4fd12d91b81893ba318327fb03da6a3ae28505d265c4cdf6"
"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum serde 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)" = "1b0e0732aa8ec4267f61815a396a942ba3525062e3bd5520aa8419927cfc0a92"
"checksum serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "84257ccd054dc351472528c8587b4de2dbf0dc0fe2e634030c1a90bfdacebaa9"
"checksum serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "31569d901045afbff7a9479f793177fe9259819aff10ab4f89ef69bbc5f567fe"
"checksum serde_json 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "59790990c5115d16027f00913e2e66de23a51f70422e549d2ad68c8c5f268f1c"
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
"checksum syn 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9056ebe7f2d6a38bc63171816fd1d3430da5a43896de21676dc5c0a4b8274a11"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
"checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9"
"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
"checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
"checksum url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2a321979c09843d272956e73700d12c4e7d3d92b2ee112b31548aef0d4efc5a6"
"checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4"
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
"checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051"
"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

+ 1
- 1
Cargo.toml View File

@ -17,7 +17,7 @@ portmidi = "^0.2"
rsoundio = "^0.1"
rb = "^0.2"
clap = "^2.2"
rustfft = "^1.0"
rustfft = "^2.0"
num = "^0.1"
rand = "^0.3"
approx = "^0.1"

+ 3
- 3
benches/osc.rs View File

@ -1,9 +1,9 @@
#![feature(test)]
#![feature(test)]
extern crate test;
use test::Bencher;
extern crate ytterbium;
use ytterbium::osc::{Osc,Simple,PhaseAccu,RotMat, Lookup};
use ytterbium::osc::{Lookup, Osc, PhaseAccu, RotMat, Simple};
const FS: usize = 48000;
const F: f64 = 440.0;
@ -46,4 +46,4 @@ fn bench_lookup(b: &mut Bencher) {
osc.tick();
}
})
}
}

+ 3
- 3
src/dsp/dynamics.rs View File

@ -1,6 +1,6 @@
use types::Stereo;
use dsp::{SignalLink, ControllableLink};
use dsp::{ControllableLink, SignalLink};
use event::ControlEvent;
use types::Stereo;
pub struct HardLimiter {}
impl SignalLink for HardLimiter {
@ -28,5 +28,5 @@ impl ControllableLink for SoftLimiter {
_ => Stereo(input.0.signum(), input.1.signum()),
}
}
fn handle(&mut self, msg: &ControlEvent) {}
fn handle(&mut self, _msg: &ControlEvent) {}
}

+ 12
- 7
src/dsp/env_gen.rs View File

@ -1,9 +1,9 @@
use std::default::Default;
use types::*;
use event::{ControlEvent, Controllable};
use types::*;
#[derive(PartialEq,Debug,Copy,Clone)]
#[derive(PartialEq, Debug, Copy, Clone)]
pub enum ADSRState {
Attack,
Decay,
@ -12,8 +12,8 @@ pub enum ADSRState {
Off,
}
impl ADSRState {
fn progress(&self) -> ADSRState {
match *self {
fn progress(self) -> ADSRState {
match self {
ADSRState::Attack => ADSRState::Decay,
ADSRState::Decay => ADSRState::Sustain,
ADSRState::Sustain => ADSRState::Release,
@ -50,8 +50,7 @@ impl ADSR {
}
pub fn tick(&mut self) -> Float {
let tmp = self.velocity *
match self.state {
self.velocity * match self.state {
ADSRState::Off => 0.0,
ADSRState::Sustain => self.level,
_ => {
@ -112,7 +111,13 @@ impl Controllable for ADSR {
self.velocity = Float::from_db((1.0 - velocity) * -30.0);
}
ControlEvent::NoteOff { .. } => self.state_change(ADSRState::Release),
ControlEvent::ADSR { ref id, attack, decay, sustain, release } => {
ControlEvent::ADSR {
ref id,
attack,
decay,
sustain,
release,
} => {
// check path
// TODO: make sure that all values are non-zero!
if *id == self.id {

+ 62
- 54
src/dsp/filter.rs View File

@ -1,8 +1,8 @@
use types::{Float, Stereo, PI};
use dsp::ControllableLink;
use event::ControlEvent;
use types::{Float, Stereo, PI};
#[derive(Debug,Clone,Copy)]
#[derive(Debug, Clone, Copy)]
pub enum FilterType {
LP,
HP,
@ -18,7 +18,7 @@ pub struct Filter {
w: Float,
a: Float,
coeffs: ([Float; 2], [Float; 3]),
Xs: [Stereo; 2],
x_s: [Stereo; 2],
}
impl Filter {
pub fn new(sample_rate: usize) -> Self {
@ -26,55 +26,55 @@ impl Filter {
let w = 2.0 * PI * fc / sample_rate as Float;
let q = 1.0;
let filter_type = FilterType::LP;
let (As, Bs) = Filter::coeffs(w, q, filter_type);
let (a_s, b_s) = Filter::coeffs(w, q, filter_type);
Filter {
sample_rate: sample_rate,
filter_type: filter_type,
fc: fc,
q: q,
w: w,
sample_rate,
filter_type,
fc,
q,
w,
a: 1.0, // unity gain
coeffs: (As, Bs),
Xs: [Stereo::default(); 2],
coeffs: (a_s, b_s),
x_s: [Stereo::default(); 2],
}
}
fn coeffs(w: Float, q: Float, filter_type: FilterType) -> ([Float; 2], [Float; 3]) {
let (sinw, cosw) = (Float::sin(w), Float::cos(w));
let (mut As, mut Bs) = ([0.; 2], [0.; 3]);
let (mut a_s, mut b_s) = ([0.; 2], [0.; 3]);
let alpha = sinw / (2.0 * q);
let a0 = 1. + alpha;
As[0] = -2. * cosw;
As[1] = 1. - alpha;
a_s[0] = -2. * cosw;
a_s[1] = 1. - alpha;
// only zeros differ
match filter_type {
FilterType::LP => {
Bs[0] = (1. - cosw) / 2.;
Bs[1] = 1. - cosw;
Bs[2] = (1. - cosw) / 2.;
b_s[0] = (1. - cosw) / 2.;
b_s[1] = 1. - cosw;
b_s[2] = (1. - cosw) / 2.;
}
FilterType::HP => {
Bs[0] = (1. + cosw) / 2.;
Bs[1] = -1. - cosw;
Bs[2] = (1. + cosw) / 2.;
b_s[0] = (1. + cosw) / 2.;
b_s[1] = -1. - cosw;
b_s[2] = (1. + cosw) / 2.;
}
FilterType::BP => {
Bs[0] = alpha;
Bs[1] = 0.;
Bs[2] = -alpha;
b_s[0] = alpha;
b_s[1] = 0.;
b_s[2] = -alpha;
}
FilterType::Notch => {
Bs[0] = 1.;
Bs[1] = -2. * cosw;
Bs[2] = 1.;
b_s[0] = 1.;
b_s[1] = -2. * cosw;
b_s[2] = 1.;
}
}
// normalize by dividing through a0
for x in Bs.iter_mut().chain(As.iter_mut()) {
for x in b_s.iter_mut().chain(a_s.iter_mut()) {
*x /= a0;
}
(As, Bs)
(a_s, b_s)
}
fn set_freq(&mut self, freq: Float) {
@ -99,28 +99,29 @@ impl Filter {
impl ControllableLink for Filter {
fn tick(&mut self, input: Stereo) -> Stereo {
let (As, Bs) = self.coeffs;
let fw = input - self.Xs[0] * As[0] - self.Xs[1] * As[1];
let out = fw * Bs[0] + self.Xs[0] * Bs[1] + self.Xs[1] * Bs[2];
self.Xs[1] = self.Xs[0];
self.Xs[0] = fw;
let (a_s, b_s) = self.coeffs;
let fw = input - self.x_s[0] * a_s[0] - self.x_s[1] * a_s[1];
let out = fw * b_s[0] + self.x_s[0] * b_s[1] + self.x_s[1] * b_s[2];
self.x_s[1] = self.x_s[0];
self.x_s[0] = fw;
out
}
fn handle(&mut self, msg: &ControlEvent) {
match *msg {
ControlEvent::Filter { filter_type, freq, q } => {
if let Some(some_type) = filter_type {
self.set_filter_type(some_type)
}
if let Some(some_freq) = freq {
self.set_freq(some_freq);
}
if let Some(some_q) = q {
self.set_q(some_q)
}
if let ControlEvent::Filter {
filter_type,
freq,
q,
} = *msg
{
if let Some(some_type) = filter_type {
self.set_filter_type(some_type)
}
if let Some(some_freq) = freq {
self.set_freq(some_freq);
}
if let Some(some_q) = q {
self.set_q(some_q)
}
_ => {}
}
}
}
@ -130,10 +131,10 @@ mod tests {
extern crate hound;
extern crate rand;
use super::{Filter, FilterType};
use self::rand::distributions::{IndependentSample, Range};
use super::super::ControllableLink;
use super::{Filter, FilterType};
use types::{Float, Stereo, MINUS_THREE_DB};
use self::rand::distributions::{IndependentSample, Range};
#[test]
fn test_filter() {
@ -147,10 +148,17 @@ mod tests {
bits_per_sample: 32,
};
let scale = ::std::i32::MAX as Float;
for filter_type in &[FilterType::LP, FilterType::HP, FilterType::BP, FilterType::Notch] {
let filename = format!("ytterbium-{}-{:?}-filter.wav",
env!("CARGO_PKG_VERSION"),
filter_type);
for filter_type in &[
FilterType::LP,
FilterType::HP,
FilterType::BP,
FilterType::Notch,
] {
let filename = format!(
"ytterbium-{}-{:?}-filter.wav",
env!("CARGO_PKG_VERSION"),
filter_type
);
let mut writer = hound::WavWriter::create(filename, wave_spec).unwrap();
const MINUS_SIX_DB: Float = MINUS_THREE_DB * MINUS_THREE_DB;
@ -168,8 +176,8 @@ mod tests {
filter.set_q(q);
filter.set_filter_type(*filter_type);
let multiplier = 1.0 +
((end_freq as Float).ln() - (start_freq).ln()) / num_samples as Float;
let multiplier =
1.0 + ((end_freq as Float).ln() - (start_freq).ln()) / num_samples as Float;
for idx in 0..num_samples {
let r = range.ind_sample(&mut rng);

+ 13
- 8
src/dsp/flow.rs View File

@ -1,9 +1,11 @@
use types::{SharedMut, Stereo, Wrap};
use event::{Controllable, ControlEvent};
use rb::{RbProducer, Producer};
use dsp::{SignalSource, SignalLink, ControllableLink, SignalSink, SignalFlow, VoiceManager,
SoftLimiter, Filter};
use dsp::{
ControllableLink, Filter, SignalFlow, SignalLink, SignalSink, SignalSource, SoftLimiter,
VoiceManager,
};
use event::{ControlEvent, Controllable};
use rb::{Producer, RbProducer};
pub struct Flow {
source: VoiceManager,
@ -13,9 +15,12 @@ pub struct Flow {
impl Flow {
pub fn new(source: VoiceManager, sink: BufferSink, sample_rate: usize) -> Self {
Flow {
source: source,
links: vec![SharedMut::wrap(Filter::new(sample_rate)), SharedMut::wrap(SoftLimiter {})],
sink: sink,
source,
links: vec![
SharedMut::wrap(Filter::new(sample_rate)),
SharedMut::wrap(SoftLimiter {}),
],
sink,
}
}
}
@ -58,7 +63,7 @@ impl BufferSink {
BufferSink {
position: 0,
buffer: vec![Stereo::default(); chunk_size],
ring_buffer: ring_buffer,
ring_buffer,
}
}
}

+ 9
- 9
src/dsp/mod.rs View File

@ -1,19 +1,19 @@
use types::Stereo;
use event::ControlEvent;
use types::Stereo;
mod env_gen;
mod wavetable;
mod voice;
mod flow;
mod dynamics;
mod env_gen;
mod filter;
mod flow;
mod voice;
mod wavetable;
pub use self::env_gen::{ADSR, ADSRState};
pub use self::wavetable::{Wavetable, WavetableOsc, generate_wavetables, Waveform};
pub use self::voice::VoiceManager;
pub use self::flow::{Flow, BufferSink};
pub use self::dynamics::{HardLimiter, SoftLimiter};
pub use self::env_gen::{ADSRState, ADSR};
pub use self::filter::{Filter, FilterType};
pub use self::flow::{BufferSink, Flow};
pub use self::voice::VoiceManager;
pub use self::wavetable::{generate_wavetables, Waveform, Wavetable, WavetableOsc};
pub trait SignalSource {
fn tick(&mut self) -> Stereo;

+ 43
- 35
src/dsp/voice.rs View File

@ -1,15 +1,15 @@
extern crate itertools;
use std::collections::{VecDeque, HashMap};
use self::itertools::Zip;
use std::collections::{HashMap, VecDeque};
use std::rc::Rc;
use types::*;
use dsp;
use dsp::env_gen::*;
use dsp::wavetable::*;
use io::PitchConvert;
use event::{ControlEvent, Controllable};
use io::PitchConvert;
use std::rc::Rc;
use types::*;
use dsp::SignalSource;
@ -23,49 +23,51 @@ pub struct Voice {
oscillators: Vec<WavetableOsc>,
}
impl Voice {
fn new(sample_rate: usize,
wavetables: Rc<HashMap<Waveform, Vec<Wavetable>>>,
pitch_convert_handle: Rc<PitchConvert>)
-> Self {
fn new(
sample_rate: usize,
wavetables: &Rc<HashMap<Waveform, Vec<Wavetable>>>,
pitch_convert_handle: &Rc<PitchConvert>,
) -> Self {
let mut levels = Vec::with_capacity(OSC_CNT);
let mut oscillators = Vec::with_capacity(OSC_CNT);
let mut volume_envelopes = Vec::with_capacity(OSC_CNT);
for idx in 0..OSC_CNT {
levels.push(if idx == 0 {
MINUS_THREE_DB
} else {
0.0
});
oscillators.push(WavetableOsc::with_id(format!("OSC{}", idx + 1),
sample_rate,
wavetables.clone(),
pitch_convert_handle.clone()));
levels.push(if idx == 0 { MINUS_THREE_DB } else { 0.0 });
oscillators.push(WavetableOsc::with_id(
format!("OSC{}", idx + 1),
sample_rate,
wavetables.clone(),
pitch_convert_handle.clone(),
));
volume_envelopes.push(ADSR::with_id(sample_rate, format!("ADSR-OSC{}", idx + 1)));
}
Voice {
// use offset instead of nested vector
fm_mod: vec![0.0; OSC_CNT * OSC_CNT],
levels: levels,
levels,
pan: vec![Stereo(MINUS_THREE_DB, MINUS_THREE_DB); OSC_CNT],
volume_envelopes: volume_envelopes,
oscillators: oscillators,
volume_envelopes,
oscillators,
}
}
fn running(&self) -> bool {
self.volume_envelopes.iter().all(|envelope| envelope.state() != ADSRState::Off)
self.volume_envelopes
.iter()
.all(|envelope| envelope.state() != ADSRState::Off)
}
fn tick(&mut self) -> Stereo {
let mut samples = [0.0; OSC_CNT];
let mut frame = Stereo::default();
// tick each oscillator + apply env
for (idx, (sample, oscillator, envelope, level, pan)) in
Zip::new((&mut samples,
&mut self.oscillators,
&mut self.volume_envelopes,
&self.levels,
&self.pan))
.take(OSC_CNT)
.enumerate() {
for (_idx, (sample, oscillator, envelope, level, pan)) in Zip::new((
&mut samples,
&mut self.oscillators,
&mut self.volume_envelopes,
&self.levels,
&self.pan,
)).take(OSC_CNT)
.enumerate()
{
*sample = oscillator.tick() * envelope.tick();
frame += Stereo(*sample, *sample) * *level * *pan;
}
@ -98,9 +100,9 @@ impl Controllable for Voice {
// use a quadratic panning
let pan_squared = new_pan * new_pan;
let scale = if new_pan.signum() < 0.0 {
Stereo((1.0 - MINUS_THREE_DB), MINUS_THREE_DB)
Stereo(1.0 - MINUS_THREE_DB, MINUS_THREE_DB)
} else {
Stereo(MINUS_THREE_DB, (1.0 - MINUS_THREE_DB))
Stereo(MINUS_THREE_DB, 1.0 - MINUS_THREE_DB)
};
let delta = Stereo(-pan_squared, pan_squared) * scale * new_pan.signum();
Stereo(MINUS_THREE_DB, MINUS_THREE_DB) + delta
@ -115,12 +117,14 @@ impl Controllable for Voice {
"OSC4" => 3,
_ => self.fm_mod.len(), // offset is larger than the length of the vector -> no modification
} * OSC_CNT;
for (idx, (old_level, new_level)) in self.fm_mod
for (idx, (old_level, new_level)) in self
.fm_mod
.iter_mut()
.skip(offset)
.take(OSC_CNT)
.zip(levels.iter())
.enumerate() {
.enumerate()
{
*old_level = if idx == offset {
*new_level * 0.1 // feedback modulation easily creates feedback
} else {
@ -150,10 +154,14 @@ impl VoiceManager {
let pitch_convert = Rc::new(PitchConvert::default());
let mut voices = Vec::with_capacity(max_voices);
for _ in 0..max_voices {
voices.push(Voice::new(sample_rate, wavetables.clone(), pitch_convert.clone()));
voices.push(Voice::new(
sample_rate,
&wavetables,
&pitch_convert,
));
}
VoiceManager {
voices: voices,
voices,
note_queue: VecDeque::with_capacity(max_voices),
}
}

+ 84
- 77
src/dsp/wavetable.rs View File

@ -1,20 +1,22 @@
extern crate rustfft;
extern crate bincode;
extern crate num;
extern crate rand;
extern crate bincode;
extern crate rustfft;
use self::bincode::rustc_serialize::{decode_from, encode_into};
use self::bincode::SizeLimit;
use self::rustfft::algorithm::Radix4;
use self::rustfft::num_complex::Complex;
use self::rustfft::num_traits::Zero;
use self::rustfft::FFT;
use std::collections::HashMap;
use std::rc::Rc;
use std::fs::File;
use std::io::{BufReader, BufWriter};
use self::num::{Complex, Zero};
use self::rustfft::FFT;
use self::bincode::rustc_serialize::{decode_from, encode_into};
use self::bincode::SizeLimit;
use std::rc::Rc;
use types::*;
use io::PitchConvert;
use event::{ControlEvent, Controllable};
use io::PitchConvert;
use types::*;
const OVERSAMPLING: usize = 2;
const INVERSE: bool = true;
@ -37,19 +39,18 @@ impl Wavetable {
/// The phase is mapped to a table index.
fn sample(&self, phasor: Float) -> Float {
let table_len = self.table.len();
let idx = if phasor < 0.0 {
phasor + 1.0
} else {
phasor
} * table_len as Float;
let idx = if phasor < 0.0 { phasor + 1.0 } else { phasor } * table_len as Float;
// linear interpolation
let (i, j) = (idx.floor() as usize % table_len, idx.ceil() as usize % table_len);
let (i, j) = (
idx.floor() as usize % table_len,
idx.ceil() as usize % table_len,
);
self.table[i] + (self.table[j] - self.table[i]) * (idx - i as Float)
}
}
/// Implemented waveforms.
#[derive(PartialEq,Eq,Hash,Debug,Copy,Clone)]
#[derive(PartialEq, Eq, Hash, Debug, Copy, Clone)]
pub enum Waveform {
Sine,
Saw,
@ -63,7 +64,9 @@ pub enum Waveform {
macro_rules! scale {
($flag:expr, $signal:expr) => {
if $flag {
let scale = $signal.iter().fold(0.0, |acc: Float, val| acc.max(val.re.abs()));
let scale = $signal
.iter()
.fold(0.0, |acc: Float, val| acc.max(val.re.abs()));
for sample in &mut $signal {
sample.re *= scale.recip();
}
@ -72,31 +75,37 @@ macro_rules! scale {
}
/// Builds wavetables for each waveform and returns a `HashMap` containing them.
pub fn generate_wavetables(fundamental_freq: Float,
sample_rate: usize)
-> HashMap<Waveform, Vec<Wavetable>> {
pub fn generate_wavetables(
fundamental_freq: Float,
sample_rate: usize,
) -> HashMap<Waveform, Vec<Wavetable>> {
let mut tables: HashMap<Waveform, Vec<Wavetable>> = HashMap::new();
for waveform in &[Waveform::Saw,
Waveform::Sine,
Waveform::Square,
Waveform::Tri,
Waveform::SharpTri,
Waveform::Random] {
let filename = format!("ytterbium-{}-wavetable-{:?}.bin",
env!("CARGO_PKG_VERSION"),
waveform);
for waveform in &[
Waveform::Saw,
Waveform::Sine,
Waveform::Square,
Waveform::Tri,
Waveform::SharpTri,
Waveform::Random,
] {
let filename = format!(
"ytterbium-{}-wavetable-{:?}.bin",
env!("CARGO_PKG_VERSION"),
waveform
);
let band_limited_table = {
if let Ok(file) = File::open(&filename) {
let mut reader = BufReader::new(file);
decode_from(&mut reader, SizeLimit::Infinite)
.expect(&format!("could not decode wavetable: {}", filename))
.unwrap_or_else(|_| panic!("could not decode wavetable: {}", filename))
} else {
let band_limited_table = build_wavetables(*waveform, fundamental_freq, sample_rate);
let file = File::create(&filename)
.expect(&format!("could not create file for wavetable: {}", filename));
let file = File::create(&filename).unwrap_or_else(|_| {
panic!("could not create file for wavetable: {}", filename)
});
let mut writer = BufWriter::new(file);
encode_into(&band_limited_table, &mut writer, SizeLimit::Infinite)
.expect(&format!("could not encode wavetable: {}", filename));
.unwrap_or_else(|_| panic!("could not encode wavetable: {}", filename));
band_limited_table
}
};
@ -107,10 +116,11 @@ pub fn generate_wavetables(fundamental_freq: Float,
/// Builds the band-limited wavetables for the given waveform, fundamental frequency and
/// sample rate.
fn build_wavetables(waveform: Waveform,
fundamental_freq: Float,
sample_rate: usize)
-> Vec<Wavetable> {
fn build_wavetables(
waveform: Waveform,
fundamental_freq: Float,
sample_rate: usize,
) -> Vec<Wavetable> {
let min_table_size = 64;
let mut phase_incr = fundamental_freq * 2.0 / sample_rate as Float;
let (mut harmonics, mut table_size) = match waveform {
@ -125,13 +135,13 @@ fn build_wavetables(waveform: Waveform,
// use sine if only 1 harmonic is left, otherwise the last table for waveforms with
// only odd harmonics would be empty!
while harmonics > 0 {
let mut fft = FFT::new(table_size, INVERSE);
let fft = Radix4::new(table_size, INVERSE);
let mut spectrum = vec![num::Complex::zero(); table_size];
let mut signal = spectrum.clone();
generate_spectrum(waveform, harmonics, &mut spectrum);
fft.process(&spectrum, &mut signal);
fft.process(spectrum.as_mut_slice(), signal.as_mut_slice());
scale!(SCALE, signal);
tables.push(Wavetable {
@ -152,10 +162,7 @@ fn generate_spectrum(waveform: Waveform, harmonics: usize, spectrum: &mut Vec
let table_size = spectrum.len();
if harmonics == 1 {
// use a pure sine
spectrum[1] = Complex {
re: 1.0,
im: -1.0,
};
spectrum[1] = Complex { re: 1.0, im: -1.0 };
spectrum[table_size - 1] = -spectrum[1];
return;
}
@ -182,11 +189,7 @@ fn generate_spectrum(waveform: Waveform, harmonics: usize, spectrum: &mut Vec
}
Waveform::Tri => {
for i in (1..harmonics).filter(|i| i % 2 == 1) {
let sign = if i % 4 == 1 {
1.0
} else {
-1.0
};
let sign = if i % 4 == 1 { 1.0 } else { -1.0 };
let magnitude = ((i * i) as Float).recip();
spectrum[i] = Complex {
re: 1.0,
@ -197,11 +200,7 @@ fn generate_spectrum(waveform: Waveform, harmonics: usize, spectrum: &mut Vec
}
Waveform::SharpTri => {
for i in (1..harmonics).filter(|i| i % 2 == 1) {
let sign = if i % 4 == 1 {
1.0