From 4f14980610bb3984ce11b39154775d227372f62b Mon Sep 17 00:00:00 2001 From: deadYokai Date: Sun, 19 Apr 2026 02:13:56 +0300 Subject: [PATCH] skeleton & stubs --- .cargo/config.toml | 2 + Cargo.lock | 642 ++--------------------------- Cargo.toml | 20 +- crates/engine/Cargo.toml | 7 + crates/engine/src/lib.rs | 29 ++ crates/params/Cargo.toml | 4 + crates/params/src/lib.rs | 278 +++++++++++++ crates/plugin-lv2/Cargo.toml | 13 + crates/plugin-lv2/lv2/manifest.ttl | 7 + crates/plugin-lv2/lv2/tenko.ttl | 21 + crates/plugin-lv2/src/lib.rs | 37 ++ crates/ui/Cargo.toml | 8 + crates/ui/src/lib.rs | 9 + 13 files changed, 468 insertions(+), 609 deletions(-) create mode 100644 .cargo/config.toml create mode 100644 crates/engine/Cargo.toml create mode 100644 crates/engine/src/lib.rs create mode 100644 crates/params/Cargo.toml create mode 100644 crates/params/src/lib.rs create mode 100644 crates/plugin-lv2/Cargo.toml create mode 100644 crates/plugin-lv2/lv2/manifest.ttl create mode 100644 crates/plugin-lv2/lv2/tenko.ttl create mode 100644 crates/plugin-lv2/src/lib.rs create mode 100644 crates/ui/Cargo.toml create mode 100644 crates/ui/src/lib.rs diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..35049cb --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[alias] +xtask = "run --package xtask --" diff --git a/Cargo.lock b/Cargo.lock index 938b0f1..b57cafc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -158,7 +158,7 @@ dependencies = [ "ndk", "ndk-context", "ndk-sys", - "num_enum 0.7.6", + "num_enum", "thiserror 2.0.18", ] @@ -601,7 +601,7 @@ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", - "libloading 0.8.9", + "libloading", ] [[package]] @@ -803,7 +803,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a" dependencies = [ - "libloading 0.8.9", + "libloading", ] [[package]] @@ -833,33 +833,25 @@ dependencies = [ "dtoa", ] -[[package]] -name = "dyn-clone" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" - [[package]] name = "either" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - [[package]] name = "endi" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" +[[package]] +name = "engine" +version = "0.1.0" +dependencies = [ + "params", +] + [[package]] name = "entities" version = "1.0.1" @@ -930,29 +922,12 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "extended" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9673d8203fcb076b19dfd17e38b3d4ae9f44959416ea532ce72415a6020365" - [[package]] name = "fastrand" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" -[[package]] -name = "fft-convolver" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb4fbed063c755ecaa4cd1356cd82cc48e9d5c7edd5c30cd144656833fc0661" -dependencies = [ - "realfft", - "rtsan-standalone", - "thiserror 2.0.18", -] - [[package]] name = "filetime" version = "0.2.27" @@ -1020,12 +995,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - [[package]] name = "foreign-types" version = "0.5.0" @@ -1053,40 +1022,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" -[[package]] -name = "fundsp" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6969e5c9d5c5c704723f547237494fde9b1addf16f718f65cd786b3b6e320a4f" -dependencies = [ - "dyn-clone", - "fft-convolver", - "funutd", - "hashbrown 0.16.1", - "libm", - "microfft", - "num-complex", - "numeric-array", - "once_cell", - "resampler", - "symphonia", - "thingbuf", - "tinyvec", - "wide", -] - -[[package]] -name = "funutd" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30f658de1fbeca3b70faf090e33d1ecf32b0efd1805bede4a8fd6ef562b7ab83" -dependencies = [ - "dyn-clone", - "glam", - "hashbrown 0.14.5", - "libm", -] - [[package]] name = "futures-core" version = "0.3.32" @@ -1151,16 +1086,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "generic-array" -version = "1.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf57c49a95fd1fe24b90b3033bee6dc7e8f1288d51494cb44e627c295e38542" -dependencies = [ - "rustversion", - "typenum", -] - [[package]] name = "gethostname" version = "1.1.0" @@ -1216,15 +1141,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "glam" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94" -dependencies = [ - "libm", -] - [[package]] name = "glob" version = "0.3.3" @@ -1244,7 +1160,7 @@ dependencies = [ "glutin_egl_sys", "glutin_glx_sys", "glutin_wgl_sys", - "libloading 0.8.9", + "libloading", "objc2 0.6.4", "objc2-app-kit 0.3.2", "objc2-core-foundation", @@ -1297,16 +1213,6 @@ dependencies = [ "gl_generator", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hashbrown" version = "0.15.5" @@ -1315,18 +1221,7 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash 0.1.5", -] - -[[package]] -name = "hashbrown" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash 0.2.0", + "foldhash", ] [[package]] @@ -1570,16 +1465,6 @@ version = "0.2.185" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libloading" version = "0.8.9" @@ -1590,12 +1475,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "libm" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" - [[package]] name = "libredox" version = "0.1.16" @@ -1737,17 +1616,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "microfft" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b6673eb0cc536241d6734c2ca45abfdbf90e9e7791c66a36a7ba3c315b76cf" -dependencies = [ - "cfg-if", - "num-complex", - "static_assertions", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1783,7 +1651,7 @@ dependencies = [ "jni-sys 0.3.1", "log", "ndk-sys", - "num_enum 0.7.6", + "num_enum", "raw-window-handle", "thiserror 1.0.69", ] @@ -1819,24 +1687,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1844,26 +1694,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", ] [[package]] @@ -1872,44 +1702,22 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" dependencies = [ - "num_enum_derive 0.7.6", + "num_enum_derive", "rustversion", ] -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "num_enum_derive" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ - "proc-macro-crate 3.5.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.117", ] -[[package]] -name = "numeric-array" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a6096447d657bfba01c49d38338b6c8e68e0e34d595360345375b798a4a765" -dependencies = [ - "generic-array", - "num-traits", -] - [[package]] name = "objc-sys" version = "0.3.5" @@ -2202,6 +2010,10 @@ dependencies = [ "ttf-parser", ] +[[package]] +name = "params" +version = "0.1.0" + [[package]] name = "parking" version = "2.2.1" @@ -2321,6 +2133,15 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +[[package]] +name = "plugin-lv2" +version = "0.1.0" +dependencies = [ + "engine", + "lv2", + "params", +] + [[package]] name = "polling" version = "3.11.0" @@ -2351,25 +2172,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "primal-check" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08" -dependencies = [ - "num-integer", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.5.0" @@ -2464,15 +2266,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" -[[package]] -name = "realfft" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f821338fddb99d089116342c46e9f1fbf3828dba077674613e734e01d6ea8677" -dependencies = [ - "rustfft", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -2520,45 +2313,6 @@ version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" -[[package]] -name = "resampler" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f5ab61459422b1a350caae1aadef48ebae234b12e80248e9ba9557018ef060" -dependencies = [ - "libm", -] - -[[package]] -name = "rtsan-standalone" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fd1b6d61d69481a68e555916d3a52213846f5c2d2140bdc74ebc308e2338fc3" -dependencies = [ - "rtsan-standalone-macros", - "rtsan-standalone-sys", -] - -[[package]] -name = "rtsan-standalone-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8320af894782374141c8e0d4521ee613a8f24d7ab08b6ad359881311e37b9ef" -dependencies = [ - "quote", - "syn 2.0.117", -] - -[[package]] -name = "rtsan-standalone-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "362a9c531f731e574a870cdb28ee7d81178ba7a87ed54380eb9b8d8f0c3b5301" -dependencies = [ - "num_cpus", - "tempfile", -] - [[package]] name = "rustc-hash" version = "1.1.0" @@ -2580,20 +2334,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustfft" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21db5f9893e91f41798c88680037dba611ca6674703c1a18601b01a72c8adb89" -dependencies = [ - "num-complex", - "num-integer", - "num-traits", - "primal-check", - "strength_reduce", - "transpose", -] - [[package]] name = "rustix" version = "0.38.44" @@ -2626,15 +2366,6 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" -[[package]] -name = "safe_arch" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f7caad094bd561859bcd467734a720c3c1f5d1f338995351fefe2190c45efed" -dependencies = [ - "bytemuck", -] - [[package]] name = "same-file" version = "1.0.6" @@ -2967,213 +2698,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strength_reduce" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" - [[package]] name = "strict-num" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" -[[package]] -name = "symphonia" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5773a4c030a19d9bfaa090f49746ff35c75dfddfa700df7a5939d5e076a57039" -dependencies = [ - "lazy_static", - "symphonia-bundle-flac", - "symphonia-bundle-mp3", - "symphonia-codec-aac", - "symphonia-codec-adpcm", - "symphonia-codec-alac", - "symphonia-codec-pcm", - "symphonia-codec-vorbis", - "symphonia-core", - "symphonia-format-caf", - "symphonia-format-isomp4", - "symphonia-format-mkv", - "symphonia-format-ogg", - "symphonia-format-riff", - "symphonia-metadata", -] - -[[package]] -name = "symphonia-bundle-flac" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91565e180aea25d9b80a910c546802526ffd0072d0b8974e3ebe59b686c9976" -dependencies = [ - "log", - "symphonia-core", - "symphonia-metadata", - "symphonia-utils-xiph", -] - -[[package]] -name = "symphonia-bundle-mp3" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4872dd6bb56bf5eac799e3e957aa1981086c3e613b27e0ac23b176054f7c57ed" -dependencies = [ - "lazy_static", - "log", - "symphonia-core", - "symphonia-metadata", -] - -[[package]] -name = "symphonia-codec-aac" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c263845aa86881416849c1729a54c7f55164f8b96111dba59de46849e73a790" -dependencies = [ - "lazy_static", - "log", - "symphonia-core", -] - -[[package]] -name = "symphonia-codec-adpcm" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dddc50e2bbea4cfe027441eece77c46b9f319748605ab8f3443350129ddd07f" -dependencies = [ - "log", - "symphonia-core", -] - -[[package]] -name = "symphonia-codec-alac" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8413fa754942ac16a73634c9dfd1500ed5c61430956b33728567f667fdd393ab" -dependencies = [ - "log", - "symphonia-core", -] - -[[package]] -name = "symphonia-codec-pcm" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e89d716c01541ad3ebe7c91ce4c8d38a7cf266a3f7b2f090b108fb0cb031d95" -dependencies = [ - "log", - "symphonia-core", -] - -[[package]] -name = "symphonia-codec-vorbis" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f025837c309cd69ffef572750b4a2257b59552c5399a5e49707cc5b1b85d1c73" -dependencies = [ - "log", - "symphonia-core", - "symphonia-utils-xiph", -] - -[[package]] -name = "symphonia-core" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea00cc4f79b7f6bb7ff87eddc065a1066f3a43fe1875979056672c9ef948c2af" -dependencies = [ - "arrayvec", - "bitflags 1.3.2", - "bytemuck", - "lazy_static", - "log", -] - -[[package]] -name = "symphonia-format-caf" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8faf379316b6b6e6bbc274d00e7a592e0d63ff1a7e182ce8ba25e24edd3d096" -dependencies = [ - "log", - "symphonia-core", - "symphonia-metadata", -] - -[[package]] -name = "symphonia-format-isomp4" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243739585d11f81daf8dac8d9f3d18cc7898f6c09a259675fc364b382c30e0a5" -dependencies = [ - "encoding_rs", - "log", - "symphonia-core", - "symphonia-metadata", - "symphonia-utils-xiph", -] - -[[package]] -name = "symphonia-format-mkv" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122d786d2c43a49beb6f397551b4a050d8229eaa54c7ddf9ee4b98899b8742d0" -dependencies = [ - "lazy_static", - "log", - "symphonia-core", - "symphonia-metadata", - "symphonia-utils-xiph", -] - -[[package]] -name = "symphonia-format-ogg" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b4955c67c1ed3aa8ae8428d04ca8397fbef6a19b2b051e73b5da8b1435639cb" -dependencies = [ - "log", - "symphonia-core", - "symphonia-metadata", - "symphonia-utils-xiph", -] - -[[package]] -name = "symphonia-format-riff" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d7c3df0e7d94efb68401d81906eae73c02b40d5ec1a141962c592d0f11a96f" -dependencies = [ - "extended", - "log", - "symphonia-core", - "symphonia-metadata", -] - -[[package]] -name = "symphonia-metadata" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36306ff42b9ffe6e5afc99d49e121e0bd62fe79b9db7b9681d48e29fa19e6b16" -dependencies = [ - "encoding_rs", - "lazy_static", - "log", - "symphonia-core", -] - -[[package]] -name = "symphonia-utils-xiph" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27c85ab799a338446b68eec77abf42e1a6f1bb490656e121c6e27bfbab9f16" -dependencies = [ - "symphonia-core", - "symphonia-metadata", -] - [[package]] name = "syn" version = "1.0.109" @@ -3229,26 +2759,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "tenko" -version = "0.1.0" -dependencies = [ - "fundsp", - "lv2", - "vizia", - "vst", - "wide", -] - -[[package]] -name = "thingbuf" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662b54ef6f7b4e71f683dadc787bbb2d8e8ef2f91b682ebed3164a5a7abca905" -dependencies = [ - "pin-project", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -3370,17 +2880,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime 0.6.11", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.27" @@ -3454,16 +2953,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "transpose" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" -dependencies = [ - "num-integer", - "strength_reduce", -] - [[package]] name = "ttf-parser" version = "0.25.1" @@ -3485,12 +2974,6 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" -[[package]] -name = "typenum" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" - [[package]] name = "uds_windows" version = "1.2.1" @@ -3502,6 +2985,14 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "ui" +version = "0.1.0" +dependencies = [ + "params", + "vizia", +] + [[package]] name = "unic-langid" version = "0.9.6" @@ -3743,20 +3234,6 @@ dependencies = [ "winit", ] -[[package]] -name = "vst" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf1ddbb85e53de6c1534f97340b065ca127678dcc31f88a33b93e54a5ac38dc" -dependencies = [ - "bitflags 1.3.2", - "libc", - "libloading 0.7.4", - "log", - "num-traits", - "num_enum 0.5.11", -] - [[package]] name = "walkdir" version = "2.5.0" @@ -4029,32 +3506,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "wide" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9479f84a757f819cfab37295955906479181395de83add28f74975fde083141" -dependencies = [ - "bytemuck", - "safe_arch", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.11" @@ -4064,12 +3515,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows" version = "0.58.0" @@ -4336,15 +3781,6 @@ dependencies = [ "xkbcommon-dl", ] -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.7.15" @@ -4487,7 +3923,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.9", + "libloading", "once_cell", "rustix 1.1.4", "x11rb-protocol", @@ -4611,7 +4047,7 @@ version = "5.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222" dependencies = [ - "proc-macro-crate 3.5.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.117", @@ -4705,7 +4141,7 @@ version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c" dependencies = [ - "proc-macro-crate 3.5.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.117", diff --git a/Cargo.toml b/Cargo.toml index 38324dc..a35ddc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,19 @@ -[package] -name = "tenko" +[workspace] +members = [ + "crates/params", + "crates/engine", + "crates/plugin-lv2", + "crates/ui", +] +resolver = "2" + +[workspace.package] version = "0.1.0" edition = "2024" +authors = ["deadYokai"] -[dependencies] -fundsp = "0.23.0" +[workspace.dependencies] +params = { path = "crates/params" } +engine = { path = "crates/engine" } lv2 = "0.6.0" vizia = "0.3.0" -vst = "0.4.0" -wide = "1.3.0" diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml new file mode 100644 index 0000000..a42b23e --- /dev/null +++ b/crates/engine/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "engine" +version.workspace = true +edition.workspace = true + +[dependencies] +params = { workspace = true } diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs new file mode 100644 index 0000000..015d531 --- /dev/null +++ b/crates/engine/src/lib.rs @@ -0,0 +1,29 @@ +use params::{ParamId, ParamStore}; + +pub struct Engine { + params: ParamStore, + sample_rate: f32, +} + +impl Engine { + pub fn new(params: ParamStore, sample_rate: f32) -> Self { + Self { + params, + sample_rate, + } + } + + pub fn set_sample_rate(&mut self, rate: f32) { + self.sample_rate = rate; + } + + pub fn process(&mut self, out_l: &mut [f32], out_r: &mut [f32]) { + debug_assert_eq!(out_l.len(), out_r.len()); + out_l.fill(0.0); + out_r.fill(0.0); + + let _vol = self.params.get(ParamId::MasterVolume); + } + + pub fn midi_event(&mut self, _data: [u8; 3]) {} +} diff --git a/crates/params/Cargo.toml b/crates/params/Cargo.toml new file mode 100644 index 0000000..f9cde08 --- /dev/null +++ b/crates/params/Cargo.toml @@ -0,0 +1,4 @@ +[package] +name = "params" +version.workspace = true +edition.workspace = true diff --git a/crates/params/src/lib.rs b/crates/params/src/lib.rs new file mode 100644 index 0000000..6bf8ce4 --- /dev/null +++ b/crates/params/src/lib.rs @@ -0,0 +1,278 @@ +use std::sync::Arc; +use std::sync::atomic::{AtomicU32, Ordering}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(usize)] +#[allow(dead_code)] +pub enum ParamId { + // Master + MasterVolume = 0, + MasterPan, + + // Oscillator 1 + Osc1Volume, + Osc1Pan, + Osc1Pitch, + Osc1Fine, + Osc1WavePos, + Osc1UnisonVoices, + Osc1UnisonDetune, + Osc1UnisonSpread, + + // Oscillator 2 + Osc2Volume, + Osc2Pan, + Osc2Pitch, + Osc2Fine, + Osc2WavePos, + Osc2UnisonVoices, + Osc2UnisonDetune, + Osc2UnisonSpread, + + // Oscillator 3 + Osc3Volume, + Osc3Pan, + Osc3Pitch, + Osc3Fine, + Osc3WavePos, + Osc3UnisonVoices, + Osc3UnisonDetune, + Osc3UnisonSpread, + + // Envelope 1 (amplitude) + Env1Delay, + Env1Attack, + Env1Hold, + Env1Decay, + Env1Sustain, + Env1Release, + + // Envelope 2 + Env2Delay, + Env2Attack, + Env2Hold, + Env2Decay, + Env2Sustain, + Env2Release, + + // Envelope 3 + Env3Delay, + Env3Attack, + Env3Hold, + Env3Decay, + Env3Sustain, + Env3Release, + + // LFO 1–4 + Lfo1Rate, + Lfo1Depth, + Lfo1Phase, + Lfo2Rate, + Lfo2Depth, + Lfo2Phase, + Lfo3Rate, + Lfo3Depth, + Lfo3Phase, + Lfo4Rate, + Lfo4Depth, + Lfo4Phase, + + // Filter 1 + Filter1Cutoff, + Filter1Resonance, + Filter1Drive, + Filter1Keytrack, + + // Filter 2 + Filter2Cutoff, + Filter2Resonance, + Filter2Drive, + Filter2Keytrack, + + // FX — Chorus + ChorusRate, + ChorusDepth, + ChorusMix, + + // FX — Reverb + ReverbSize, + ReverbDamping, + ReverbMix, + + // FX — Delay + DelayTime, + DelayFeedback, + DelayMix, + + // FX — Distortion + DistortionDrive, + DistortionMix, + + // FX — EQ + EqLowGain, + EqMidFreq, + EqMidGain, + EqHighGain, + + // Macros + Macro1, + Macro2, + Macro3, + Macro4, + Macro5, + Macro6, + Macro7, + Macro8, + + Count, +} + +pub const PARAM_COUNT: usize = ParamId::Count as usize; + +pub fn default_value(id: ParamId) -> f32 { + use ParamId::*; + match id { + MasterVolume => 0.8, + MasterPan => 0.5, + + Osc1Volume => 0.8, + Osc2Volume | Osc3Volume => 0.0, // off by default + Osc1Pan | Osc2Pan | Osc3Pan => 0.5, + Osc1Pitch | Osc2Pitch | Osc3Pitch => 0.5, + Osc1Fine | Osc2Fine | Osc3Fine => 0.5, + + Env1Attack | Env2Attack | Env3Attack => 0.02, + Env1Decay | Env2Decay | Env3Decay => 0.30, + Env1Sustain | Env2Sustain | Env3Sustain => 0.70, + Env1Release | Env2Release | Env3Release => 0.35, + + Filter1Cutoff | Filter2Cutoff => 1.0, + Filter1Keytrack | Filter2Keytrack => 0.0, + + Lfo1Rate | Lfo2Rate | Lfo3Rate | Lfo4Rate => 0.3, + + _ => 0.0, + } +} + +#[derive(Clone)] +pub struct ParamStore { + data: Arc<[AtomicU32]>, +} + +impl ParamStore { + pub fn new() -> Self { + let data: Arc<[AtomicU32]> = (0..PARAM_COUNT) + .map(|i| { + let id: ParamId = unsafe { std::mem::transmute(i) }; + AtomicU32::new(default_value(id).to_bits()) + }) + .collect::>() + .into(); + Self { data } + } + + #[inline(always)] + pub fn get(&self, id: ParamId) -> f32 { + f32::from_bits(self.data[id as usize].load(Ordering::Relaxed)) + } + + #[inline(always)] + pub fn set(&self, id: ParamId, value: f32) { + debug_assert!((0.0..=1.0).contains(&value), "param out of range: {value}"); + self.data[id as usize].store(value.to_bits(), Ordering::Relaxed); + } + + pub fn reset_to_defaults(&self) { + for i in 0..PARAM_COUNT { + let id: ParamId = unsafe { std::mem::transmute(i) }; + self.data[i].store(default_value(id).to_bits(), Ordering::Relaxed); + } + } + + pub fn snapshot(&self) -> Vec { + (0..PARAM_COUNT) + .map(|i| f32::from_bits(self.data[i].load(Ordering::Relaxed))) + .collect() + } + + pub fn restore(&self, values: &[f32]) { + assert_eq!(values.len(), PARAM_COUNT, "snapshot length mismatch"); + for (i, &v) in values.iter().enumerate() { + self.data[i].store(v.to_bits(), Ordering::Relaxed); + } + } +} + +impl Default for ParamStore { + fn default() -> Self { + Self::new() + } +} + +pub struct ParamMeta { + pub name: &'static str, + pub label: &'static str, + pub steps: Option, +} + +pub fn param_meta(id: ParamId) -> ParamMeta { + use ParamId::*; + match id { + MasterVolume => ParamMeta { + name: "Master Volume", + label: "%", + steps: None, + }, + MasterPan => ParamMeta { + name: "Master Pan", + label: "", + steps: None, + }, + Osc1Pitch => ParamMeta { + name: "Osc1 Pitch", + label: "st", + steps: Some(96), + }, + Filter1Cutoff => ParamMeta { + name: "Filter1 Cutoff", + label: "Hz", + steps: None, + }, + Filter1Resonance => ParamMeta { + name: "Filter1 Res", + label: "", + steps: None, + }, + Env1Attack => ParamMeta { + name: "Env1 Attack", + label: "s", + steps: None, + }, + Env1Decay => ParamMeta { + name: "Env1 Decay", + label: "s", + steps: None, + }, + Env1Sustain => ParamMeta { + name: "Env1 Sustain", + label: "%", + steps: None, + }, + Env1Release => ParamMeta { + name: "Env1 Release", + label: "s", + steps: None, + }, + Macro1 => ParamMeta { + name: "Macro 1", + label: "", + steps: None, + }, + _ => ParamMeta { + name: "?", + label: "", + steps: None, + }, + } +} diff --git a/crates/plugin-lv2/Cargo.toml b/crates/plugin-lv2/Cargo.toml new file mode 100644 index 0000000..df99511 --- /dev/null +++ b/crates/plugin-lv2/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "plugin-lv2" +version.workspace = true +edition.workspace = true + +[lib] +name = "tenko_lv2" +crate-type = ["cdylib"] + +[dependencies] +params = { workspace = true } +engine = { workspace = true } +lv2 = { workspace = true } diff --git a/crates/plugin-lv2/lv2/manifest.ttl b/crates/plugin-lv2/lv2/manifest.ttl new file mode 100644 index 0000000..3f60fc1 --- /dev/null +++ b/crates/plugin-lv2/lv2/manifest.ttl @@ -0,0 +1,7 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Plugin ; + lv2:binary ; + rdfs:seeAlso . diff --git a/crates/plugin-lv2/lv2/tenko.ttl b/crates/plugin-lv2/lv2/tenko.ttl new file mode 100644 index 0000000..a279c34 --- /dev/null +++ b/crates/plugin-lv2/lv2/tenko.ttl @@ -0,0 +1,21 @@ +@prefix lv2: . +@prefix doap: . +@prefix rdfs: . + + + a lv2:Plugin, lv2:InstrumentPlugin ; + + doap:name "Tenko" ; + doap:license ; + + lv2:port [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 0 ; + lv2:symbol "out_l" ; + rdfs:label "Left Out" + ] , [ + a lv2:OutputPort, lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "out_r" ; + rdfs:label "Right Out" + ] . diff --git a/crates/plugin-lv2/src/lib.rs b/crates/plugin-lv2/src/lib.rs new file mode 100644 index 0000000..348fe1d --- /dev/null +++ b/crates/plugin-lv2/src/lib.rs @@ -0,0 +1,37 @@ +use engine::Engine; +use lv2::prelude::*; +use params::ParamStore; + +#[derive(PortCollection)] +struct Ports { + out_l: OutputPort