mirror of
https://gitlab.com/then-try-this/samplebrain.git
synced 2026-06-28 17:41:37 +00:00
stuffs
This commit is contained in:
4
sponge/test/app/test/aggregate.clj
Normal file
4
sponge/test/app/test/aggregate.clj
Normal file
@@ -0,0 +1,4 @@
|
||||
(ns app.test.aggregate
|
||||
(:use app.blocklist
|
||||
app.wav
|
||||
clojure.test))
|
||||
14
sponge/test/app/test/block.clj
Normal file
14
sponge/test/app/test/block.clj
Normal file
@@ -0,0 +1,14 @@
|
||||
(ns app.test.block
|
||||
(:use app.block
|
||||
clojure.test)
|
||||
(:require [hiphip.double :as v]))
|
||||
|
||||
|
||||
(deftest block
|
||||
(let [block (build (v/amake [_ 512] 1))]
|
||||
(is (= 512 (count (:fft block))))
|
||||
(is (= 13 (count (:mfcc block))))
|
||||
(let [block2 (build (v/amake [_ 512] 0))]
|
||||
(is (not (= 0 (diff block block2 0))))
|
||||
(is (not (= 0 (diff block block2 1))))
|
||||
(is (not (= 0 (diff block block2 0.5)))))))
|
||||
11
sponge/test/app/test/blocklist.clj
Normal file
11
sponge/test/app/test/blocklist.clj
Normal file
@@ -0,0 +1,11 @@
|
||||
(ns app.test.blocklist
|
||||
(:use app.blocklist
|
||||
app.wav
|
||||
clojure.test))
|
||||
|
||||
(deftest blocklist
|
||||
(is (= 86 (count (build (sinusoid 1 440) 44100 512))))
|
||||
(is (= 2 (count (build (sinusoid 1 440) 44100 22049))))
|
||||
(let [bl (build (sinusoid 1 440) 44100 512)]
|
||||
(is (not (= false (second (search bl (first bl) 0)))))
|
||||
(is (= 0.0 (first (search bl (first bl) 0))))))
|
||||
6
sponge/test/app/test/core.clj
Normal file
6
sponge/test/app/test/core.clj
Normal file
@@ -0,0 +1,6 @@
|
||||
(ns app.test.core
|
||||
(:use [app.core])
|
||||
(:use [clojure.test]))
|
||||
|
||||
(deftest replace-me ;; FIXME: write
|
||||
(is true "No tests have been written."))
|
||||
24
sponge/test/app/test/listen.clj
Normal file
24
sponge/test/app/test/listen.clj
Normal file
@@ -0,0 +1,24 @@
|
||||
(ns app.test.listen
|
||||
(:use [app.listen])
|
||||
(:use [clojure.test]))
|
||||
|
||||
(deftest fading-test
|
||||
(is (= (seq [0.0 0.5 1.0 0.5 0.0]) (seq (fadeinout! (double-array [1 1 1 1 1]) 2 2))))
|
||||
(is (= (seq[0.0 1.0 0.0]) (seq (fadeinout! (double-array [1 1 1]) 1 1)))))
|
||||
|
||||
(deftest normalise-test
|
||||
(is (= (seq[0.0 1.0 0.0]) (seq (normalise! (double-array [0 10 0])))))
|
||||
(is (= (seq[0.0 -1.0 0.0]) (seq (normalise! (double-array [0 -10 0]))))))
|
||||
|
||||
(deftest fft-test
|
||||
(is 9 (count (fftify (double-array [1 0 0 0 1 0 0 0 1])))))
|
||||
|
||||
(deftest mfcc-test
|
||||
(is 13 (count (first (mfccify (double-array [1 0 0 0 1 0 0 0 1]))))))
|
||||
|
||||
(deftest diff-test
|
||||
(is 1.0 (diff (double-array [1 2 3 4]) (double-array [1 2 3 5])))
|
||||
(is 1.0 (diff (double-array [1 3 3 4]) (double-array [1 2 3 4])))
|
||||
(is 0.1 (diff (double-array [1 3 3.1 4]) (double-array [1 3 3 4])))
|
||||
(is 0.1 (diff (double-array [0.9 3 3.1 4]) (double-array [0.9 2.9 3.1 4])))
|
||||
)
|
||||
Reference in New Issue
Block a user