diff --git a/.idea/artifacts/TerrarumBuild.xml b/.idea/artifacts/TerrarumBuild.xml
index 21f1e61fb..30f757a9b 100644
--- a/.idea/artifacts/TerrarumBuild.xml
+++ b/.idea/artifacts/TerrarumBuild.xml
@@ -80,32 +80,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.idea/libraries/github_psambit9791_jdsp.xml b/.idea/libraries/github_psambit9791_jdsp.xml
deleted file mode 100644
index 18532f1e4..000000000
--- a/.idea/libraries/github_psambit9791_jdsp.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/TerrarumBuild.iml b/TerrarumBuild.iml
index 34160124e..6e2646c12 100644
--- a/TerrarumBuild.iml
+++ b/TerrarumBuild.iml
@@ -26,7 +26,6 @@
-
diff --git a/lib/VectorGraphics2D-0.13-sources.jar b/lib/VectorGraphics2D-0.13-sources.jar
deleted file mode 100644
index 3662c3b5b..000000000
--- a/lib/VectorGraphics2D-0.13-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:527461c88c94585ed336add8fe5681bd42e4e721de46327ad054a1584b27309b
-size 101837
diff --git a/lib/VectorGraphics2D-0.13.jar b/lib/VectorGraphics2D-0.13.jar
deleted file mode 100644
index 04600efc8..000000000
--- a/lib/VectorGraphics2D-0.13.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1b1c6248f1e70c52b8e9c09873350185aad081e70f83649ef85571ff269a71a2
-size 94027
diff --git a/lib/animated-gif-lib-1.4-sources.jar b/lib/animated-gif-lib-1.4-sources.jar
deleted file mode 100644
index a04bde828..000000000
--- a/lib/animated-gif-lib-1.4-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2c39b676cc289fa389ab31b0622996aa8eb0f87d17e4d1a73ddea9324fcee72d
-size 18744
diff --git a/lib/animated-gif-lib-1.4.jar b/lib/animated-gif-lib-1.4.jar
deleted file mode 100644
index df7903b18..000000000
--- a/lib/animated-gif-lib-1.4.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:49ad396efc16a076df137881e3a815922959bfb8d485e25f56bc3d3978c498cd
-size 20742
diff --git a/lib/apiguardian-api-1.0.0-sources.jar b/lib/apiguardian-api-1.0.0-sources.jar
deleted file mode 100644
index 8d4c7462b..000000000
--- a/lib/apiguardian-api-1.0.0-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:793b50c98fa62e6eec08cc8fa4364b95d4815c1b17ef17e5e9e59c457e54ce2e
-size 2229
diff --git a/lib/apiguardian-api-1.0.0.jar b/lib/apiguardian-api-1.0.0.jar
deleted file mode 100644
index e95586faf..000000000
--- a/lib/apiguardian-api-1.0.0.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1f58b77470d8d147a0538d515347dd322f49a83b9e884b8970051160464b65b3
-size 2164
diff --git a/lib/colt-1.2.0.jar b/lib/colt-1.2.0.jar
deleted file mode 100644
index bc481ecd3..000000000
--- a/lib/colt-1.2.0.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e1fcbfbdd0d0caedadfb59febace5a62812db3b9425f3a03ef4c4cbba3ed0ee3
-size 581945
diff --git a/lib/common-java5-2.19.1-sources.jar b/lib/common-java5-2.19.1-sources.jar
deleted file mode 100644
index e3601835e..000000000
--- a/lib/common-java5-2.19.1-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:52545eb98af7d060f8bed8c3aac2a2714a89d9275efe5ec70205ebe6ca7b552f
-size 12229
diff --git a/lib/common-java5-2.19.1.jar b/lib/common-java5-2.19.1.jar
deleted file mode 100644
index f70aa4437..000000000
--- a/lib/common-java5-2.19.1.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:831f47a1fb1446f6bd8653ea4183c4b1601eab943da6c8ec160d7b83b19de1d0
-size 44127
diff --git a/lib/commons-logging-1.2-sources.jar b/lib/commons-logging-1.2-sources.jar
deleted file mode 100644
index a6a1ff1b0..000000000
--- a/lib/commons-logging-1.2-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:44347acfe5860461728e9cb33251e97345be36f8a0dfd5c5130c172559455f41
-size 73295
diff --git a/lib/commons-logging-1.2.jar b/lib/commons-logging-1.2.jar
deleted file mode 100644
index 13ec090d0..000000000
--- a/lib/commons-logging-1.2.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636
-size 61829
diff --git a/lib/concurrent-1.3.4-sources.jar b/lib/concurrent-1.3.4-sources.jar
deleted file mode 100644
index 63cec6013..000000000
--- a/lib/concurrent-1.3.4-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e728f7fad4bf80d41bcaefa761f1ddeb30cd31226b0f2b58db666bde419342fd
-size 877597
diff --git a/lib/concurrent-1.3.4.jar b/lib/concurrent-1.3.4.jar
deleted file mode 100644
index f158bb98d..000000000
--- a/lib/concurrent-1.3.4.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:12639def9a5b5ebf56040ab764bd42b7e662523d3b983e5d5da04bf37be152f9
-size 189284
diff --git a/lib/fontbox-2.0.24-sources.jar b/lib/fontbox-2.0.24-sources.jar
deleted file mode 100644
index 71539f75d..000000000
--- a/lib/fontbox-2.0.24-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6cac29129a3ab7226cfe7adee6ae9aff0036f30c0d97ef34ec05d6cc499b5d8e
-size 1498085
diff --git a/lib/fontbox-2.0.24.jar b/lib/fontbox-2.0.24.jar
deleted file mode 100644
index 1fb98ace7..000000000
--- a/lib/fontbox-2.0.24.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2e8c0a569a90b04734fbc0c805d77f4ec03f98c11f5705055ccd7718c1953d68
-size 1564111
diff --git a/lib/graphics2d-0.32-sources.jar b/lib/graphics2d-0.32-sources.jar
deleted file mode 100644
index ea542a293..000000000
--- a/lib/graphics2d-0.32-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:dfbab3557c66510849814cd82355abdc85fed6423e9ee5dc9bd3a8195e9ef957
-size 43005
diff --git a/lib/graphics2d-0.32.jar b/lib/graphics2d-0.32.jar
deleted file mode 100644
index 2adc7257b..000000000
--- a/lib/graphics2d-0.32.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:37f8f387395f96c214ac44f7475c7a2e1f832dfc1de289a3610e0ffbf728f679
-size 73911
diff --git a/lib/iirj-1.5-sources.jar b/lib/iirj-1.5-sources.jar
deleted file mode 100644
index 6bc7caa86..000000000
--- a/lib/iirj-1.5-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2c50069701a12874d5e4b57cd7b79e2d9a54c035b6932c5922c6717a8594d276
-size 26372
diff --git a/lib/iirj-1.5.jar b/lib/iirj-1.5.jar
deleted file mode 100644
index 3f7d442dd..000000000
--- a/lib/iirj-1.5.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7260d395ce4fc54e96f2f2bbc6211a126a597ebeafb1f761b79895cf76a5f993
-size 30869
diff --git a/lib/jcommon-1.0.15.jar b/lib/jcommon-1.0.15.jar
deleted file mode 100644
index 79a4c6895..000000000
--- a/lib/jcommon-1.0.15.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:acf524cbcd1ba61db2593b16b75a35fc1c7c58fd4d2d36e16ebb585d0f2cc509
-size 309294
diff --git a/lib/jdsp-2.0.1-sources.jar b/lib/jdsp-2.0.1-sources.jar
deleted file mode 100644
index 79c14def9..000000000
--- a/lib/jdsp-2.0.1-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:556aa9a146e48c865fd769d19e61aecfc08f5dd271b3847e96ae0977d2a341bb
-size 6273823
diff --git a/lib/jdsp-2.0.1.jar b/lib/jdsp-2.0.1.jar
deleted file mode 100644
index dd7f61bdf..000000000
--- a/lib/jdsp-2.0.1.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3214c26541df92935453c4860941ac63bcdc2b0e4dab1fc6c654086f0368e10c
-size 6288038
diff --git a/lib/jfreechart-1.0.12.jar b/lib/jfreechart-1.0.12.jar
deleted file mode 100644
index 41b0b52b6..000000000
--- a/lib/jfreechart-1.0.12.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b90e35874f89cf910c20214dce84c4906a09b908e4761ac32e248fe1b36102c3
-size 1368681
diff --git a/lib/junit-jupiter-api-5.0.3-sources.jar b/lib/junit-jupiter-api-5.0.3-sources.jar
deleted file mode 100644
index 078d0b333..000000000
--- a/lib/junit-jupiter-api-5.0.3-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:af50a21c85de863b853e62f5c4612c37ed6397f279f0b45570f60e1357053b1c
-size 77621
diff --git a/lib/junit-jupiter-api-5.0.3.jar b/lib/junit-jupiter-api-5.0.3.jar
deleted file mode 100644
index d8141ce41..000000000
--- a/lib/junit-jupiter-api-5.0.3.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7312eb2d7e7950186f487da0bf4ea6004b06204a8726f8f8976965a701815d7e
-size 76193
diff --git a/lib/junit-jupiter-engine-5.0.3-sources.jar b/lib/junit-jupiter-engine-5.0.3-sources.jar
deleted file mode 100644
index 75e912777..000000000
--- a/lib/junit-jupiter-engine-5.0.3-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:548f645638efa310478934775808b04add8b674012c262e7e149271953ce1e3a
-size 77231
diff --git a/lib/junit-jupiter-engine-5.0.3.jar b/lib/junit-jupiter-engine-5.0.3.jar
deleted file mode 100644
index 5f1d2ec85..000000000
--- a/lib/junit-jupiter-engine-5.0.3.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ebce96103ba236c716d09ba92622cbf0e2f9d846f2b446afcb5fae246b157e85
-size 119274
diff --git a/lib/junit-platform-commons-1.0.3-sources.jar b/lib/junit-platform-commons-1.0.3-sources.jar
deleted file mode 100644
index 6d9f7aa61..000000000
--- a/lib/junit-platform-commons-1.0.3-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:70fb33a96ad963a02e40b2357575dbb85888e4d42be6cbc805898ac0e24c920d
-size 50815
diff --git a/lib/junit-platform-commons-1.0.3.jar b/lib/junit-platform-commons-1.0.3.jar
deleted file mode 100644
index 27573a14f..000000000
--- a/lib/junit-platform-commons-1.0.3.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8fedb05efbe03eb450573c6feec038485c2c97aaf00213be98f43542d3e3a070
-size 62666
diff --git a/lib/junit-platform-engine-1.0.3-sources.jar b/lib/junit-platform-engine-1.0.3-sources.jar
deleted file mode 100644
index 8f1322156..000000000
--- a/lib/junit-platform-engine-1.0.3-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b123e7ddc1dd78fa6d62ef4355edb8163eef05d60ea98c8ecb2507b7adf1c6a2
-size 77251
diff --git a/lib/junit-platform-engine-1.0.3.jar b/lib/junit-platform-engine-1.0.3.jar
deleted file mode 100644
index 713eeafe8..000000000
--- a/lib/junit-platform-engine-1.0.3.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:eabb36cc5acd989bd33a97f2ef0019a71a06d19cfd5be1cbaf0aa3c1753491a4
-size 87818
diff --git a/lib/junit-platform-launcher-1.0.0-sources.jar b/lib/junit-platform-launcher-1.0.0-sources.jar
deleted file mode 100644
index 4404c87a8..000000000
--- a/lib/junit-platform-launcher-1.0.0-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c5c1f9dbadcfd91e8ba4ed8ab31fecf4e60b0e2bbaa22b59d4f8c48deeea76a4
-size 39171
diff --git a/lib/junit-platform-launcher-1.0.0.jar b/lib/junit-platform-launcher-1.0.0.jar
deleted file mode 100644
index a3b150da6..000000000
--- a/lib/junit-platform-launcher-1.0.0.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6c660f6e41149921e6865d5a7715f08f414eb0a49c96874d3cc9c05ccfcbb0e3
-size 54139
diff --git a/lib/junit-platform-surefire-provider-1.0.0-sources.jar b/lib/junit-platform-surefire-provider-1.0.0-sources.jar
deleted file mode 100644
index f8a5fa362..000000000
--- a/lib/junit-platform-surefire-provider-1.0.0-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:baf35c85691648609b2c3394a1870f84bec3c70f38a87df080bcf6160df3a246
-size 10896
diff --git a/lib/junit-platform-surefire-provider-1.0.0.jar b/lib/junit-platform-surefire-provider-1.0.0.jar
deleted file mode 100644
index f6f98fe1f..000000000
--- a/lib/junit-platform-surefire-provider-1.0.0.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:02bd3009b1f000733694fcefe3937900b5dee4624255bd8d3896e0dcfa96b246
-size 14927
diff --git a/lib/opentest4j-1.0.0-sources.jar b/lib/opentest4j-1.0.0-sources.jar
deleted file mode 100644
index 5a69edffb..000000000
--- a/lib/opentest4j-1.0.0-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:68e5bbe7dbe3b8cfe2b98976a3271830a366ac5c5f5a450ed301c6b4f08bb822
-size 7452
diff --git a/lib/opentest4j-1.0.0.jar b/lib/opentest4j-1.0.0.jar
deleted file mode 100644
index c228e5881..000000000
--- a/lib/opentest4j-1.0.0.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6a05b14e8764a1fa51551ccef29e7271681d65fa907a8136136b94de92a0b862
-size 6588
diff --git a/lib/optimization-1.3-sources.jar b/lib/optimization-1.3-sources.jar
deleted file mode 100644
index a7289c16d..000000000
--- a/lib/optimization-1.3-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4e8e623468f60cfc8712025efd1a026ae3744e654e87fc0328559123e2c9eb2a
-size 93326
diff --git a/lib/optimization-1.3.jar b/lib/optimization-1.3.jar
deleted file mode 100644
index bbec1bf04..000000000
--- a/lib/optimization-1.3.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ecdf55d24cbf1ac4c48917f67de82178a128f4ae088de1611c8837acc4dd5f6d
-size 67951
diff --git a/lib/pdfbox-2.0.24-sources.jar b/lib/pdfbox-2.0.24-sources.jar
deleted file mode 100644
index c1de73d9e..000000000
--- a/lib/pdfbox-2.0.24-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6f12c05d9ef4cf724910a56d7dd91f9b3b1ad9948a2dd996229207762ce014ff
-size 2566166
diff --git a/lib/pdfbox-2.0.24.jar b/lib/pdfbox-2.0.24.jar
deleted file mode 100644
index 5b02e48d3..000000000
--- a/lib/pdfbox-2.0.24.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3c2c0553ec0e7533c490b4c952e1af113621de5275af6e380e11d0d9a0a4f3d6
-size 2745079
diff --git a/lib/ssj-3.3.1-sources.jar b/lib/ssj-3.3.1-sources.jar
deleted file mode 100644
index 4a1af867d..000000000
--- a/lib/ssj-3.3.1-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fddcdf985a76dea70145367419bef2568b039759f2467e492a210568a4a88f3e
-size 1515213
diff --git a/lib/ssj-3.3.1.jar b/lib/ssj-3.3.1.jar
deleted file mode 100644
index a34a944be..000000000
--- a/lib/ssj-3.3.1.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:39625d7ddef108b42307583a75346d36300cd64a5c11b944b1681d556fd0180d
-size 1288980
diff --git a/lib/surefire-api-2.19.1-sources.jar b/lib/surefire-api-2.19.1-sources.jar
deleted file mode 100644
index 8ab233781..000000000
--- a/lib/surefire-api-2.19.1-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:56fa9b514c53b9c2dcac0709a2387ef2276b3f6c4ec0e060eeac1739cb6de88f
-size 112686
diff --git a/lib/surefire-api-2.19.1.jar b/lib/surefire-api-2.19.1.jar
deleted file mode 100644
index 51c6b2ffe..000000000
--- a/lib/surefire-api-2.19.1.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:de34106fd8799d9cc690aded4eb329c5c2c9f96929b2fea032ec9a5bdf036613
-size 196073
diff --git a/lib/wavfile-0.1-sources.jar b/lib/wavfile-0.1-sources.jar
deleted file mode 100644
index 7ae054cb6..000000000
--- a/lib/wavfile-0.1-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1918b88fdc32afb9d5e9a2146480e2b63b22173bb7705943e48d8934f7f78fe4
-size 6475
diff --git a/lib/wavfile-0.1.jar b/lib/wavfile-0.1.jar
deleted file mode 100644
index 0b2f715db..000000000
--- a/lib/wavfile-0.1.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e3f1e1ed4c6b86495d060a135954cbaf1edd3835efc727eafd956c08ce79d982
-size 9831
diff --git a/lib/xchart-3.8.1-sources.jar b/lib/xchart-3.8.1-sources.jar
deleted file mode 100644
index 5256905f5..000000000
--- a/lib/xchart-3.8.1-sources.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b67dda9dbc481c3270d0b04de58b2926f633b47e1aad91367f317c6c3e6f53b5
-size 194367
diff --git a/lib/xchart-3.8.1.jar b/lib/xchart-3.8.1.jar
deleted file mode 100644
index 78c22dea1..000000000
--- a/lib/xchart-3.8.1.jar
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:610bb64d90bac7d2aeb25e7476d8b8df3d0f484315442dcab62685ff707c5ba5
-size 364996
diff --git a/src/net/torvald/terrarum/CreditSingleton.kt b/src/net/torvald/terrarum/CreditSingleton.kt
index 7970b0abf..41a1a6f8f 100644
--- a/src/net/torvald/terrarum/CreditSingleton.kt
+++ b/src/net/torvald/terrarum/CreditSingleton.kt
@@ -196,30 +196,6 @@ Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
-$BULLET Jdsp
-
-Copyright (c) 2019 Sambit Paul
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-
-
$BULLET Apache Commons Codec
Copyright 2002-2023 The Apache Software Foundation
@@ -251,6 +227,49 @@ Copyright 2010-2012 CS Systèmes d'Information
+$BULLET JTransforms
+
+Copyright (c) 2007 onward, Piotr Wendykier
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+$BULLET Aircompressor
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+
$BULLET Ambient sound recordings:
- ambient_forest_01.ogg
diff --git a/src/net/torvald/terrarum/audio/FFT.kt b/src/net/torvald/terrarum/audio/FFT.kt
index 0524d4496..5164b2259 100644
--- a/src/net/torvald/terrarum/audio/FFT.kt
+++ b/src/net/torvald/terrarum/audio/FFT.kt
@@ -2,8 +2,6 @@ package net.torvald.terrarum.audio
import com.badlogic.gdx.utils.Disposable
import net.torvald.terrarum.App
-import org.apache.commons.math3.transform.DftNormalization
-import org.apache.commons.math3.transform.TransformType
import org.jtransforms.fft.FloatFFT_1D
private val RE0 = 0
@@ -65,7 +63,7 @@ private val mulBuf = FloatArray(2)
}
/**
- * Modification of the code form JDSP and Apache Commons Math
+ * Helper object to call JTransforms
*
* Created by minjaesong on 2023-11-25.
*/
@@ -86,57 +84,13 @@ object FFT: Disposable {
init {
-// Loader.load(org.bytedeco.fftw.global.fftw3::class.java)
-
App.disposables.add(this)
}
- /*private val reLock = ReentrantLock(true)
-
- private fun getForwardPlan(n: Int, inn: FloatArray, out: FloatArray): fftwf_plan {
- return fftwf_plan_dft_1d(n, inn, out, FFTW_FORWARD, FFTW_ESTIMATE)
- }
- private fun getBackwardPlan(n: Int, inn: FloatArray, out: FloatArray): fftwf_plan {
- return fftwf_plan_dft_1d(n, inn, out, FFTW_BACKWARD, FFTW_ESTIMATE)
- }
- private fun destroyPlan(plan: fftwf_plan) {
- fftwf_destroy_plan(plan)
- }*/
-
override fun dispose() {
}
- // org.apache.commons.math3.transform.FastFouriesTransformer.java:370
fun fft(signal0: FloatArray): ComplexArray {
-// val im = FloatArray(signal0.size)
-// transformInPlace(signal0, im, signal0.size, DftNormalization.STANDARD, TransformType.FORWARD)
-// return ComplexArray(FloatArray(signal0.size) { if (it % 2 == 0) signal0[it / 2] else im[it / 2] })
-
-
- // USING FFTW //
- /*lateinit var retObj: ComplexArray
- reLock.lock {
- fftw_init_threads()
-
- val signal = FloatArray(2 * signal0.size)
- val result = FloatArray(2 * signal0.size)
-
- val plan = getForwardPlan(signal0.size, signal, result)
-
- signal0.forEachIndexed { index, fl -> signal[index * 2] = fl }
-
- fftwf_execute(plan)
-
- retObj = ComplexArray(result)
-
- destroyPlan(plan)
-
- fftwf_cleanup_threads()
- }
- return retObj*/
-
-
- // USING JTRANSFORMS //
val signal = FloatArray(signal0.size * 2) { if (it % 2 == 0) signal0[it / 2] else 0f }
ffts[signal0.size]!!.complexForward(signal)
return ComplexArray(signal)
@@ -151,36 +105,7 @@ object FFT: Disposable {
ffts[signal0.size]!!.complexForward(out.reim)
}
- // org.apache.commons.math3.transform.FastFouriesTransformer.java:404
fun ifftAndGetReal(signal0: ComplexArray): FloatArray {
-// val re = FloatArray(signal0.size) { signal0.reim[it * 2] }
-// val im = FloatArray(signal0.size) { signal0.reim[it * 2 + 1] }
-// transformInPlace(re, im, re.size, DftNormalization.STANDARD, TransformType.INVERSE)
-// return re
-
-
- // USING FFTW //
- /*lateinit var re: FloatArray
- reLock.lock {
- fftw_init_threads()
-
- val signal = signal0.reim
- val result = FloatArray(2 * signal0.size)
-
- val plan = getBackwardPlan(signal0.size, signal, result)
-
- fftwf_execute(plan)
-
- re = FloatArray(signal0.size) { result[it * 2] }
-
- destroyPlan(plan)
-
- fftwf_cleanup_threads()
- }
- return re*/
-
-
- // USING JTRANSFORMS //
ffts[signal0.size]!!.complexInverse(signal0.reim, true)
return signal0.getReal()
}
@@ -191,230 +116,4 @@ object FFT: Disposable {
output[i] = signal0.reim[i * 2]
}
}
-
- // org.apache.commons.math3.transform.FastFouriesTransformer.java:214
- /**
- * Computes the standard transform of the specified complex data. The
- * computation is done in place. The input data is laid out as follows
- *
- * - {@code dataRI[0][i]} is the real part of the {@code i}-th data point,
- * - {@code dataRI[1][i]} is the imaginary part of the {@code i}-th data point.
- *
- *
- * @param dataRI the two dimensional array of real and imaginary parts of the data
- * @param normalization the normalization to be applied to the transformed data
- * @param type the type of transform (forward, inverse) to be performed
- * @throws DimensionMismatchException if the number of rows of the specified
- * array is not two, or the array is not rectangular
- * @throws MathIllegalArgumentException if the number of data points is not
- * a power of two
- */
- private fun transformInPlace(dataR: FloatArray, dataI: FloatArray, n: Int, normalization: DftNormalization, type: TransformType) {
-
- /*if (n == 1) {
- return
- }
- else if (n == 2) {
- val srcR0 = dataR[0]
- val srcI0 = dataI[0]
- val srcR1 = dataR[1]
- val srcI1 = dataI[1]
-
- // X_0 = x_0 + x_1
- dataR[0] = srcR0 + srcR1
- dataI[0] = srcI0 + srcI1
- // X_1 = x_0 - x_1
- dataR[1] = srcR0 - srcR1
- dataI[1] = srcI0 - srcI1
- normalizeTransformedData(dataRI, normalization, type)
- return
- }*/
-
- bitReversalShuffle2(dataR, dataI)
-
- // Do 4-term DFT.
- if (type == TransformType.INVERSE) {
- var i0 = 0
- while (i0 < n) {
- val i1 = i0 + 1
- val i2 = i0 + 2
- val i3 = i0 + 3
- val srcR0 = dataR[i0]
- val srcI0 = dataI[i0]
- val srcR1 = dataR[i2]
- val srcI1 = dataI[i2]
- val srcR2 = dataR[i1]
- val srcI2 = dataI[i1]
- val srcR3 = dataR[i3]
- val srcI3 = dataI[i3]
-
- // 4-term DFT
- // X_0 = x_0 + x_1 + x_2 + x_3
- dataR[i0] = srcR0 + srcR1 + srcR2 + srcR3
- dataI[i0] = srcI0 + srcI1 + srcI2 + srcI3
- // X_1 = x_0 - x_2 + j * (x_3 - x_1)
- dataR[i1] = srcR0 - srcR2 + (srcI3 - srcI1)
- dataI[i1] = srcI0 - srcI2 + (srcR1 - srcR3)
- // X_2 = x_0 - x_1 + x_2 - x_3
- dataR[i2] = srcR0 - srcR1 + srcR2 - srcR3
- dataI[i2] = srcI0 - srcI1 + srcI2 - srcI3
- // X_3 = x_0 - x_2 + j * (x_1 - x_3)
- dataR[i3] = srcR0 - srcR2 + (srcI1 - srcI3)
- dataI[i3] = srcI0 - srcI2 + (srcR3 - srcR1)
- i0 += 4
- }
- }
- else {
- var i0 = 0
- while (i0 < n) {
- val i1 = i0 + 1
- val i2 = i0 + 2
- val i3 = i0 + 3
- val srcR0 = dataR[i0]
- val srcI0 = dataI[i0]
- val srcR1 = dataR[i2]
- val srcI1 = dataI[i2]
- val srcR2 = dataR[i1]
- val srcI2 = dataI[i1]
- val srcR3 = dataR[i3]
- val srcI3 = dataI[i3]
-
- // 4-term DFT
- // X_0 = x_0 + x_1 + x_2 + x_3
- dataR[i0] = srcR0 + srcR1 + srcR2 + srcR3
- dataI[i0] = srcI0 + srcI1 + srcI2 + srcI3
- // X_1 = x_0 - x_2 + j * (x_3 - x_1)
- dataR[i1] = srcR0 - srcR2 + (srcI1 - srcI3)
- dataI[i1] = srcI0 - srcI2 + (srcR3 - srcR1)
- // X_2 = x_0 - x_1 + x_2 - x_3
- dataR[i2] = srcR0 - srcR1 + srcR2 - srcR3
- dataI[i2] = srcI0 - srcI1 + srcI2 - srcI3
- // X_3 = x_0 - x_2 + j * (x_1 - x_3)
- dataR[i3] = srcR0 - srcR2 + (srcI3 - srcI1)
- dataI[i3] = srcI0 - srcI2 + (srcR1 - srcR3)
- i0 += 4
- }
- }
-
- var lastN0 = 4
- var lastLogN0 = 2
- while (lastN0 < n) {
- val n0 = lastN0 shl 1
- val logN0 = lastLogN0 + 1
- val wSubN0R = W_SUB_N_R[logN0]
- var wSubN0I = W_SUB_N_I[logN0]
- if (type == TransformType.INVERSE) {
- wSubN0I = -wSubN0I
- }
-
- // Combine even/odd transforms of size lastN0 into a transform of size N0 (lastN0 * 2).
- var destEvenStartIndex = 0
- while (destEvenStartIndex < n) {
- val destOddStartIndex = destEvenStartIndex + lastN0
- var wSubN0ToRR = 1f
- var wSubN0ToRI = 0f
- for (r in 0 until lastN0) {
- val grR = dataR[destEvenStartIndex + r]
- val grI = dataI[destEvenStartIndex + r]
- val hrR = dataR[destOddStartIndex + r]
- val hrI = dataI[destOddStartIndex + r]
-
- // dest[destEvenStartIndex + r] = Gr + WsubN0ToR * Hr
- dataR[destEvenStartIndex + r] = grR + wSubN0ToRR * hrR - wSubN0ToRI * hrI
- dataI[destEvenStartIndex + r] = grI + wSubN0ToRR * hrI + wSubN0ToRI * hrR
- // dest[destOddStartIndex + r] = Gr - WsubN0ToR * Hr
- dataR[destOddStartIndex + r] = grR - (wSubN0ToRR * hrR - wSubN0ToRI * hrI)
- dataI[destOddStartIndex + r] = grI - (wSubN0ToRR * hrI + wSubN0ToRI * hrR)
-
- // WsubN0ToR *= WsubN0R
- val nextWsubN0ToRR = wSubN0ToRR * wSubN0R - wSubN0ToRI * wSubN0I
- val nextWsubN0ToRI = wSubN0ToRR * wSubN0I + wSubN0ToRI * wSubN0R
- wSubN0ToRR = nextWsubN0ToRR
- wSubN0ToRI = nextWsubN0ToRI
- }
- destEvenStartIndex += n0
- }
- lastN0 = n0
- lastLogN0 = logN0
- }
-
- normalizeTransformedData(dataR, dataI, n, normalization, type)
- }
-
-
- /**
- * Applies the proper normalization to the specified transformed data.
- *
- * @param dataRI the unscaled transformed data
- * @param normalization the normalization to be applied
- * @param type the type of transform (forward, inverse) which resulted in the specified data
- */
- private fun normalizeTransformedData(
- dataR: FloatArray, dataI: FloatArray, n: Int,
- normalization: DftNormalization, type: TransformType
- ) {
-// assert(dataI.size == n)
-// when (normalization) {
-// DftNormalization.STANDARD ->
- if (type == TransformType.INVERSE) {
- val scaleFactor = 1f / n.toFloat()
- var i = 0
- while (i < n) {
- dataR[i] *= scaleFactor
- dataI[i] *= scaleFactor
- i++
- }
- }
-
- /* DftNormalization.UNITARY -> {
- val scaleFactor = (1.0 / FastMath.sqrt(n.toDouble())).toFloat()
- var i = 0
- while (i < n) {
- dataR[i] *= scaleFactor
- dataI[i] *= scaleFactor
- i++
- }
- }
-
- else -> throw MathIllegalStateException()
- }*/
- }
-
- /**
- * Performs identical index bit reversal shuffles on two arrays of identical
- * size. Each element in the array is swapped with another element based on
- * the bit-reversal of the index. For example, in an array with length 16,
- * item at binary index 0011 (decimal 3) would be swapped with the item at
- * binary index 1100 (decimal 12).
- *
- * @param a the first array to be shuffled
- * @param b the second array to be shuffled
- */
- private fun bitReversalShuffle2(a: FloatArray, b: FloatArray) {
- val n = a.size
- assert(b.size == n)
- val halfOfN = n shr 1
- var j = 0
- for (i in 0 until n) {
- if (i < j) {
- // swap indices i & j
- var temp = a[i]
- a[i] = a[j]
- a[j] = temp
- temp = b[i]
- b[i] = b[j]
- b[j] = temp
- }
- var k = halfOfN
- while (k in 1..j) {
- j -= k
- k = k shr 1
- }
- j += k
- }
- }
-
- private val W_SUB_N_R = FFTConsts.W_SUB_N_R.map { it.toFloat() }.toFloatArray()
- private val W_SUB_N_I = FFTConsts.W_SUB_N_I.map { it.toFloat() }.toFloatArray()
-
}
\ No newline at end of file
diff --git a/src/net/torvald/terrarum/audio/FFTConsts.java b/src/net/torvald/terrarum/audio/FFTConsts.java
deleted file mode 100644
index cf2768bd6..000000000
--- a/src/net/torvald/terrarum/audio/FFTConsts.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package net.torvald.terrarum.audio;
-
-/**
- * Created by minjaesong on 2023-11-25.
- */
-public class FFTConsts {
-
- // org.apache.commons.math3.transform.FastFouriesTransformer.java:58
- /**
- * {@code W_SUB_N_R[i]} is the real part of
- * {@code exp(- 2 * i * pi / n)}:
- * {@code W_SUB_N_R[i] = cos(2 * pi/ n)}, where {@code n = 2^i}.
- */
- public static final double[] W_SUB_N_R =
- { 0x1.0p0, -0x1.0p0, 0x1.1a62633145c07p-54, 0x1.6a09e667f3bcdp-1
- , 0x1.d906bcf328d46p-1, 0x1.f6297cff75cbp-1, 0x1.fd88da3d12526p-1, 0x1.ff621e3796d7ep-1
- , 0x1.ffd886084cd0dp-1, 0x1.fff62169b92dbp-1, 0x1.fffd8858e8a92p-1, 0x1.ffff621621d02p-1
- , 0x1.ffffd88586ee6p-1, 0x1.fffff62161a34p-1, 0x1.fffffd8858675p-1, 0x1.ffffff621619cp-1
- , 0x1.ffffffd885867p-1, 0x1.fffffff62161ap-1, 0x1.fffffffd88586p-1, 0x1.ffffffff62162p-1
- , 0x1.ffffffffd8858p-1, 0x1.fffffffff6216p-1, 0x1.fffffffffd886p-1, 0x1.ffffffffff621p-1
- , 0x1.ffffffffffd88p-1, 0x1.fffffffffff62p-1, 0x1.fffffffffffd9p-1, 0x1.ffffffffffff6p-1
- , 0x1.ffffffffffffep-1, 0x1.fffffffffffffp-1, 0x1.0p0, 0x1.0p0
- , 0x1.0p0, 0x1.0p0, 0x1.0p0, 0x1.0p0
- , 0x1.0p0, 0x1.0p0, 0x1.0p0, 0x1.0p0
- , 0x1.0p0, 0x1.0p0, 0x1.0p0, 0x1.0p0
- , 0x1.0p0, 0x1.0p0, 0x1.0p0, 0x1.0p0
- , 0x1.0p0, 0x1.0p0, 0x1.0p0, 0x1.0p0
- , 0x1.0p0, 0x1.0p0, 0x1.0p0, 0x1.0p0
- , 0x1.0p0, 0x1.0p0, 0x1.0p0, 0x1.0p0
- , 0x1.0p0, 0x1.0p0, 0x1.0p0 };
-
- /**
- * {@code W_SUB_N_I[i]} is the imaginary part of
- * {@code exp(- 2 * i * pi / n)}:
- * {@code W_SUB_N_I[i] = -sin(2 * pi/ n)}, where {@code n = 2^i}.
- */
- public static final double[] W_SUB_N_I =
- { 0x1.1a62633145c07p-52, -0x1.1a62633145c07p-53, -0x1.0p0, -0x1.6a09e667f3bccp-1
- , -0x1.87de2a6aea963p-2, -0x1.8f8b83c69a60ap-3, -0x1.917a6bc29b42cp-4, -0x1.91f65f10dd814p-5
- , -0x1.92155f7a3667ep-6, -0x1.921d1fcdec784p-7, -0x1.921f0fe670071p-8, -0x1.921f8becca4bap-9
- , -0x1.921faaee6472dp-10, -0x1.921fb2aecb36p-11, -0x1.921fb49ee4ea6p-12, -0x1.921fb51aeb57bp-13
- , -0x1.921fb539ecf31p-14, -0x1.921fb541ad59ep-15, -0x1.921fb5439d73ap-16, -0x1.921fb544197ap-17
- , -0x1.921fb544387bap-18, -0x1.921fb544403c1p-19, -0x1.921fb544422c2p-20, -0x1.921fb54442a83p-21
- , -0x1.921fb54442c73p-22, -0x1.921fb54442cefp-23, -0x1.921fb54442d0ep-24, -0x1.921fb54442d15p-25
- , -0x1.921fb54442d17p-26, -0x1.921fb54442d18p-27, -0x1.921fb54442d18p-28, -0x1.921fb54442d18p-29
- , -0x1.921fb54442d18p-30, -0x1.921fb54442d18p-31, -0x1.921fb54442d18p-32, -0x1.921fb54442d18p-33
- , -0x1.921fb54442d18p-34, -0x1.921fb54442d18p-35, -0x1.921fb54442d18p-36, -0x1.921fb54442d18p-37
- , -0x1.921fb54442d18p-38, -0x1.921fb54442d18p-39, -0x1.921fb54442d18p-40, -0x1.921fb54442d18p-41
- , -0x1.921fb54442d18p-42, -0x1.921fb54442d18p-43, -0x1.921fb54442d18p-44, -0x1.921fb54442d18p-45
- , -0x1.921fb54442d18p-46, -0x1.921fb54442d18p-47, -0x1.921fb54442d18p-48, -0x1.921fb54442d18p-49
- , -0x1.921fb54442d18p-50, -0x1.921fb54442d18p-51, -0x1.921fb54442d18p-52, -0x1.921fb54442d18p-53
- , -0x1.921fb54442d18p-54, -0x1.921fb54442d18p-55, -0x1.921fb54442d18p-56, -0x1.921fb54442d18p-57
- , -0x1.921fb54442d18p-58, -0x1.921fb54442d18p-59, -0x1.921fb54442d18p-60 };
-
-}