diff --git a/.vscode/settings.json b/.vscode/settings.json index 010f9c8..ef8dddc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,10 @@ { "editor.tabSize": 4, - "rust-analyzer.checkOnSave.command": "clippy" -} \ No newline at end of file + "rust-analyzer.check.overrideCommand": [ + "cargo", + "clippy", + "--all", + "--message-format=json", + "--all-targets" + ] +} diff --git a/Cargo.lock b/Cargo.lock index 348917a..51e9e0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,12 +13,12 @@ dependencies = [ [[package]] name = "alsa" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5915f52fe2cf65e83924d037b6c5290b7cee097c6b5c8700746e6168a343fd6b" +checksum = "e2562ad8dcf0f789f65c6fdaad8a8a9708ed6b488e649da28c01656ad66b8b47" dependencies = [ "alsa-sys", - "bitflags", + "bitflags 1.3.2", "libc", "nix", ] @@ -39,6 +39,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + [[package]] name = "arrayvec" version = "0.7.2" @@ -74,19 +80,13 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - [[package]] name = "bindgen" version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", @@ -115,6 +115,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "bumpalo" version = "3.12.1" @@ -141,11 +147,11 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cbindgen" -version = "0.24.3" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6358dedf60f4d9b8db43ad187391afe959746101346fe51bb978126bec61dfb" +checksum = "da6bc11b07529f16944307272d5bd9b22530bc7d05751717c9d416586cedab49" dependencies = [ - "clap", + "clap 3.2.23", "heck", "indexmap", "log", @@ -233,14 +239,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ "atty", - "bitflags", - "clap_lex", + "bitflags 1.3.2", + "clap_lex 0.2.4", "indexmap", "strsim", "termcolor", "textwrap", ] +[[package]] +name = "clap" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +dependencies = [ + "anstyle", + "clap_lex 0.6.0", +] + [[package]] name = "clap_lex" version = "0.2.4" @@ -250,6 +275,12 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + [[package]] name = "combine" version = "4.6.6" @@ -274,11 +305,12 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "coreaudio-rs" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11894b20ebfe1ff903cbdc52259693389eea03b94918a2def2c30c3bf227ad88" +checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace" dependencies = [ - "bitflags", + "bitflags 1.3.2", + "core-foundation-sys", "coreaudio-sys", ] @@ -293,24 +325,25 @@ dependencies = [ [[package]] name = "cpal" -version = "0.14.2" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f342c1b63e185e9953584ff2199726bf53850d96610a310e3aca09e9405a2d0b" +checksum = "6d959d90e938c5493000514b446987c07aed46c668faaa7d34d6c7a67b1a578c" dependencies = [ "alsa", "core-foundation-sys", "coreaudio-rs", - "jni", + "dasp_sample", + "jni 0.19.0", "js-sys", "libc", - "mach", - "ndk 0.7.0", + "mach2", + "ndk", "ndk-context", "oboe", "once_cell", "parking_lot", - "stdweb", - "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", "web-sys", "windows", ] @@ -325,7 +358,7 @@ dependencies = [ "atty", "cast", "ciborium", - "clap", + "clap 3.2.23", "criterion-plot", "itertools", "lazy_static", @@ -341,6 +374,32 @@ dependencies = [ "walkdir", ] +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap 4.4.7", + "criterion-plot", + "is-terminal", + "itertools", + "num-traits", + "once_cell", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + [[package]] name = "criterion-plot" version = "0.5.0" @@ -381,7 +440,7 @@ dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.8.0", + "memoffset", "scopeguard", ] @@ -395,10 +454,10 @@ dependencies = [ ] [[package]] -name = "discard" -version = "1.0.4" +name = "dasp_sample" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" [[package]] name = "either" @@ -456,9 +515,14 @@ dependencies = [ [[package]] name = "gen-iter" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1668ac3c7b8cc5f1e31565ed509d8d70aa1a81bd7f508b620725b78c6e1d7049" +checksum = "33ab36ccf1ed3d9c719f4c8725b34482c530f6d569c084ea762490b5e19f77bf" + +[[package]] +name = "gen-iter" +version = "0.4.0" +source = "git+https://github.com/arduano/gen-iter.git?rev=64e28bc#64e28bc74b406030ff9bb3a3726a770a8fb4f78b" [[package]] name = "getrandom" @@ -555,6 +619,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.1", + "rustix 0.38.21", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -584,6 +659,20 @@ dependencies = [ "walkdir", ] +[[package]] +name = "jni" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + [[package]] name = "jni-sys" version = "0.3.0" @@ -601,9 +690,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -620,9 +709,9 @@ dependencies = [ [[package]] name = "lazy-regex" -version = "2.5.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff63c423c68ea6814b7da9e88ce585f793c87ddd9e78f646970891769c8235d4" +checksum = "e723bd417b2df60a0f6a2b6825f297ea04b245d4ba52b5a22cb679bdf58b05fa" dependencies = [ "lazy-regex-proc_macros", "once_cell", @@ -631,14 +720,14 @@ dependencies = [ [[package]] name = "lazy-regex-proc_macros" -version = "2.4.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8edfc11b8f56ce85e207e62ea21557cfa09bb24a8f6b04ae181b086ff8611c22" +checksum = "0f0a1d9139f0ee2e862e08a9c5d0ba0470f2aa21cd1e1aa1b1562f83116c725f" dependencies = [ "proc-macro2", "quote", "regex", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -655,9 +744,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.142" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -681,6 +770,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b085a4f2cde5781fc4b1717f2e86c62f5cda49de7ba99a7c2eae02b61c9064c" +[[package]] +name = "linux-raw-sys" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" + [[package]] name = "lock_api" version = "0.4.9" @@ -701,28 +796,19 @@ dependencies = [ ] [[package]] -name = "mach" -version = "0.3.2" +name = "mach2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" dependencies = [ "libc", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -736,43 +822,20 @@ dependencies = [ [[package]] name = "midi-toolkit-rs" version = "0.1.0" -source = "git+https://github.com/arduano/midi-toolkit-rs?rev=51ff0dc#51ff0dcef32451d022bc240c190f0eb31d494765" -dependencies = [ - "crossbeam-channel", - "gen-iter", - "midi-toolkit-rs-derive 0.1.0 (git+https://github.com/arduano/midi-toolkit-rs?rev=51ff0dc)", - "num-traits", -] - -[[package]] -name = "midi-toolkit-rs" -version = "0.1.0" -source = "git+https://github.com/arduano/midi-toolkit-rs?rev=907dec1#907dec12bd10e248f1a5b927a45190de70844751" +source = "git+https://github.com/arduano/midi-toolkit-rs?rev=a54f198#a54f19890e47c90a246001b9f8b2519f3604eb58" dependencies = [ "crossbeam-channel", - "gen-iter", - "midi-toolkit-rs-derive 0.1.0 (git+https://github.com/arduano/midi-toolkit-rs?rev=907dec1)", + "gen-iter 0.4.0", + "midi-toolkit-rs-derive", "num-traits", "rayon", + "thiserror", ] [[package]] name = "midi-toolkit-rs-derive" version = "0.1.0" -source = "git+https://github.com/arduano/midi-toolkit-rs?rev=51ff0dc#51ff0dcef32451d022bc240c190f0eb31d494765" -dependencies = [ - "convert_case", - "num-traits", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "midi-toolkit-rs-derive" -version = "0.1.0" -source = "git+https://github.com/arduano/midi-toolkit-rs?rev=907dec1#907dec12bd10e248f1a5b927a45190de70844751" +source = "git+https://github.com/arduano/midi-toolkit-rs?rev=a54f198#a54f19890e47c90a246001b9f8b2519f3604eb58" dependencies = [ "convert_case", "num-traits", @@ -788,28 +851,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "ndk" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" -dependencies = [ - "bitflags", - "jni-sys", - "ndk-sys 0.3.0", - "num_enum", - "thiserror", -] - [[package]] name = "ndk" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ - "bitflags", + "bitflags 1.3.2", "jni-sys", - "ndk-sys 0.4.1+23.1.7779620", + "ndk-sys", "num_enum", "raw-window-handle", "thiserror", @@ -821,15 +871,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" -[[package]] -name = "ndk-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" -dependencies = [ - "jni-sys", -] - [[package]] name = "ndk-sys" version = "0.4.1+23.1.7779620" @@ -841,15 +882,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.23.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "bitflags", - "cc", + "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", ] [[package]] @@ -915,12 +954,12 @@ dependencies = [ [[package]] name = "oboe" -version = "0.4.6" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f63c358b4fa0fbcfefd7c8be5cfc39c08ce2389f5325687e7762a48d30a5c1" +checksum = "8868cc237ee02e2d9618539a23a8d228b9bb3fc2e7a5b11eed3831de77c395d0" dependencies = [ - "jni", - "ndk 0.6.0", + "jni 0.20.0", + "ndk", "ndk-context", "num-derive", "num-traits", @@ -929,9 +968,9 @@ dependencies = [ [[package]] name = "oboe-sys" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3370abb7372ed744232c12954d920d1a40f1c4686de9e79e800021ef492294bd" +checksum = "7f44155e7fb718d3cfddcf70690b2b51ac4412f347cd9e4fbe511abe9cd7b5f2" dependencies = [ "cc", ] @@ -1145,7 +1184,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1154,14 +1193,26 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.8.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -1192,9 +1243,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "riff" @@ -1209,25 +1260,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "rustc_version" -version = "0.2.3" +name = "rustix" +version = "0.37.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +checksum = "f79bef90eb6d984c72722595b5b1348ab39275a5e5123faca6863bf07d75a4e0" dependencies = [ - "semver", + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.3", + "windows-sys 0.48.0", ] [[package]] name = "rustix" -version = "0.37.13" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79bef90eb6d984c72722595b5b1348ab39275a5e5123faca6863bf07d75a4e0" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ - "bitflags", + "bitflags 2.4.1", "errno", - "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] @@ -1252,21 +1307,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.160" @@ -1298,21 +1338,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - [[package]] name = "shlex" version = "1.1.0" @@ -1345,55 +1370,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 1.0.109", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1", - "syn 1.0.109", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "strsim" version = "0.10.0" @@ -1468,7 +1444,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b9567e2d8a5f866b2f94f5d366d811e0c6826babcff6d37de9e1a6690d38869" dependencies = [ "arrayvec", - "bitflags", + "bitflags 1.3.2", "bytemuck", "lazy_static", "log", @@ -1563,7 +1539,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix", + "rustix 0.37.13", "windows-sys 0.45.0", ] @@ -1674,9 +1650,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1684,24 +1660,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.15", "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1709,22 +1697,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.15", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wav" @@ -1778,15 +1766,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.37.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" +checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" dependencies = [ - "windows_aarch64_msvc 0.37.0", - "windows_i686_gnu 0.37.0", - "windows_i686_msvc 0.37.0", - "windows_x86_64_gnu 0.37.0", - "windows_x86_64_msvc 0.37.0", + "windows-targets 0.42.2", ] [[package]] @@ -1849,12 +1833,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -1867,12 +1845,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_i686_gnu" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -1885,12 +1857,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -1903,12 +1869,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_x86_64_gnu" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -1933,12 +1893,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -1967,10 +1921,10 @@ dependencies = [ "atomic_refcell", "biquad", "bytemuck", - "criterion", + "criterion 0.4.0", "crossbeam-channel", "lazy_static", - "midi-toolkit-rs 0.1.0 (git+https://github.com/arduano/midi-toolkit-rs?rev=51ff0dc)", + "midi-toolkit-rs", "proc-macro2", "rand", "rayon", @@ -1991,9 +1945,9 @@ dependencies = [ "cbindgen", "cpal", "crossbeam-channel", - "gen-iter", + "gen-iter 0.3.0", "lazy_static", - "midi-toolkit-rs 0.1.0 (git+https://github.com/arduano/midi-toolkit-rs?rev=907dec1)", + "midi-toolkit-rs", "rayon", "spin_sleep", "to_vec", @@ -2008,7 +1962,7 @@ dependencies = [ "atomic_float", "crossbeam-channel", "hound", - "midi-toolkit-rs 0.1.0 (git+https://github.com/arduano/midi-toolkit-rs?rev=907dec1)", + "midi-toolkit-rs", "rayon", "spin_sleep", "thiserror", @@ -2019,7 +1973,7 @@ dependencies = [ name = "xsynth-soundfonts" version = "0.1.0" dependencies = [ - "criterion", + "criterion 0.5.1", "encoding_rs", "encoding_rs_io", "lazy-regex", diff --git a/core/Cargo.toml b/core/Cargo.toml index 0a2ecd5..fdf481e 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -21,7 +21,7 @@ simdeez = "2.0.0-dev3" proc-macro2 = "1.0.63" [dev-dependencies] -midi-toolkit-rs = { git = "https://github.com/arduano/midi-toolkit-rs", rev = "51ff0dc" } +midi-toolkit-rs = { git = "https://github.com/arduano/midi-toolkit-rs", rev = "a54f198" } rand = "0.8.5" criterion = "0.4.0" diff --git a/core/benches/send_events.rs b/core/benches/send_events.rs index 976d89e..247c62d 100644 --- a/core/benches/send_events.rs +++ b/core/benches/send_events.rs @@ -58,6 +58,7 @@ fn criterion_benchmark(c: &mut Criterion) { f.iter(|| { let init = ChannelInitOptions { fade_out_killing: false, + ..Default::default() }; let mut channel = VoiceChannel::new(init, stream_params, None); channel.process_event(ChannelEvent::Config(ChannelConfigEvent::SetSoundfonts( @@ -75,6 +76,7 @@ fn criterion_benchmark(c: &mut Criterion) { f.iter(|| { let init = ChannelInitOptions { fade_out_killing: true, + ..Default::default() }; let mut channel = VoiceChannel::new(init, stream_params, None); channel.process_event(ChannelEvent::Config(ChannelConfigEvent::SetSoundfonts( @@ -92,6 +94,7 @@ fn criterion_benchmark(c: &mut Criterion) { f.iter(|| { let init = ChannelInitOptions { fade_out_killing: false, + ..Default::default() }; let mut channel = VoiceChannel::new(init, stream_params, None); channel.process_event(ChannelEvent::Config(ChannelConfigEvent::SetSoundfonts( @@ -109,6 +112,7 @@ fn criterion_benchmark(c: &mut Criterion) { f.iter(|| { let init = ChannelInitOptions { fade_out_killing: true, + ..Default::default() }; let mut channel = VoiceChannel::new(init, stream_params, None); channel.process_event(ChannelEvent::Config(ChannelConfigEvent::SetSoundfonts( diff --git a/realtime/Cargo.toml b/realtime/Cargo.toml index 460a051..7f4cee9 100644 --- a/realtime/Cargo.toml +++ b/realtime/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] atomic_refcell = "0.1.7" bytemuck = "1.7.2" -cpal = "0.14.1" +cpal = "0.15.2" crossbeam-channel = "0.5.1" lazy_static = "1.4.0" rayon = "1.5.3" @@ -18,8 +18,8 @@ wav = "1.0.0" core = { path = "../core", package = "xsynth-core" } [dev-dependencies] -midi-toolkit-rs = { git = "https://github.com/arduano/midi-toolkit-rs", rev = "907dec1" } -gen-iter = "0.2.1" +midi-toolkit-rs = { git = "https://github.com/arduano/midi-toolkit-rs", rev = "a54f198" } +gen-iter = "0.3.0" [build-dependencies] -cbindgen = "0.24.3" +cbindgen = "0.26.0" diff --git a/realtime/src/realtime_synth.rs b/realtime/src/realtime_synth.rs index b77aba1..4ab7cf4 100644 --- a/realtime/src/realtime_synth.rs +++ b/realtime/src/realtime_synth.rs @@ -9,7 +9,7 @@ use std::{ use cpal::{ traits::{DeviceTrait, HostTrait, StreamTrait}, - Device, PauseStreamError, PlayStreamError, Sample, Stream, SupportedStreamConfig, + Device, PauseStreamError, PlayStreamError, SizedSample, Stream, SupportedStreamConfig, }; use crossbeam_channel::{bounded, unbounded}; @@ -197,7 +197,7 @@ impl RealtimeSynth { (sample_rate as f64 * config.render_window_ms / 1000.0) as usize, ))); - fn build_stream( + fn build_stream( device: &Device, stream_config: SupportedStreamConfig, buffered: Arc>, @@ -214,10 +214,11 @@ impl RealtimeSynth { output_vec.resize(data.len(), 0.0); buffered.lock().unwrap().read(&mut output_vec); for (i, s) in limiter.limit_iter(output_vec.drain(0..)).enumerate() { - data[i] = Sample::from(&s); + data[i] = ConvertSample::from_f32(s); } }, err_fn, + None, ) .unwrap() } @@ -226,6 +227,7 @@ impl RealtimeSynth { cpal::SampleFormat::F32 => build_stream::(device, stream_config, buffered.clone()), cpal::SampleFormat::I16 => build_stream::(device, stream_config, buffered.clone()), cpal::SampleFormat::U16 => build_stream::(device, stream_config, buffered.clone()), + _ => panic!("unsupported sample format"), // I hate when crates use #[non_exhaustive] }; stream.play().unwrap(); @@ -288,3 +290,25 @@ impl Drop for RealtimeSynth { } } } + +trait ConvertSample: SizedSample { + fn from_f32(s: f32) -> Self; +} + +impl ConvertSample for f32 { + fn from_f32(s: f32) -> Self { + s + } +} + +impl ConvertSample for i16 { + fn from_f32(s: f32) -> Self { + (s * i16::MAX as f32) as i16 + } +} + +impl ConvertSample for u16 { + fn from_f32(s: f32) -> Self { + ((s * u16::MAX as f32) as i32 + i16::MIN as i32) as u16 + } +} diff --git a/render/Cargo.toml b/render/Cargo.toml index b94eaa5..5f4f35b 100644 --- a/render/Cargo.toml +++ b/render/Cargo.toml @@ -10,7 +10,7 @@ core = { path = "../core", package = "xsynth-core" } crossbeam-channel = "0.5.1" hound = "3.5.0" rayon = "1.5.3" -midi-toolkit-rs = { git = "https://github.com/arduano/midi-toolkit-rs", rev = "907dec1" } +midi-toolkit-rs = { git = "https://github.com/arduano/midi-toolkit-rs", rev = "a54f198" } spin_sleep = "1.0.0" atomic_float = "0.1.0" thiserror = "1.0.31" diff --git a/render/examples/render.rs b/render/examples/render.rs index 08579cf..ab7e6d3 100644 --- a/render/examples/render.rs +++ b/render/examples/render.rs @@ -65,8 +65,7 @@ fn main() { let config: XSynthRenderConfig = Default::default(); - let mut soundfonts: Vec> = vec![]; - soundfonts.push(Arc::new( + let soundfonts: Vec> = vec![Arc::new( SampleSoundfont::new( sfz, AudioStreamParams::new( @@ -76,7 +75,7 @@ fn main() { config.sf_init_options, ) .unwrap(), - )); + )]; xsynth_renderer(&midi, out) .with_config(config) diff --git a/render/examples/render_dialog.rs b/render/examples/render_dialog.rs index a20ec50..6a1ca8c 100644 --- a/render/examples/render_dialog.rs +++ b/render/examples/render_dialog.rs @@ -78,15 +78,14 @@ fn main() { let config: XSynthRenderConfig = Default::default(); - let mut soundfonts: Vec> = vec![]; - soundfonts.push(Arc::new( + let soundfonts: Vec> = vec![Arc::new( SampleSoundfont::new( sfz_path, AudioStreamParams::new(sample_rate, ChannelCount::from(2)), config.sf_init_options, ) .unwrap(), - )); + )]; xsynth_renderer(&midi_path, &out_path) .with_sample_rate(sample_rate) diff --git a/soundfonts/Cargo.toml b/soundfonts/Cargo.toml index f292cc4..cbcf4eb 100644 --- a/soundfonts/Cargo.toml +++ b/soundfonts/Cargo.toml @@ -8,13 +8,13 @@ edition = "2021" [dependencies] encoding_rs = "0.8.32" encoding_rs_io = "0.1.7" -lazy-regex = "2.3.0" +lazy-regex = "3.0.2" regex-bnf = "0.1.2" simdeez = "2.0.0-dev3" thiserror = "1.0.38" [dev-dependencies] -criterion = "0.4.0" +criterion = "0.5.1" [[bench]] name = "parse"