Finalize main theme

soundtrack
Ensar Sarajčić 2021-11-12 18:12:49 +01:00
parent bea1d43a15
commit a7a44d26ae
4 changed files with 74 additions and 11 deletions

Binary file not shown.

View File

@ -15,6 +15,6 @@
(defmethod task "play" (defmethod task "play"
[_] [_]
(music.core/-main)) (music.core/-main "main_theme"))
(task *command-line-args*) (task *command-line-args*)

View File

@ -1,10 +1,8 @@
(ns music.core (ns music.core
(:require-macros [music.music] (:require-macros [music.core :refer [build-for-cljs]]))
[music.core :refer [build-for-cljs]]))
(defonce audio (js/document.createElement "audio")) (defonce audio (js/document.createElement "audio"))
(set! (.-src audio) (build-for-cljs)) (set! (.-src audio) (build-for-cljs))
(set! (.-controls audio) true) (set! (.-controls audio) true)
(js/document.body.appendChild audio) (js/document.body.appendChild audio)
(.play audio) (.play audio)

View File

@ -1,10 +1,75 @@
(ns music.songs.main-theme) (ns music.songs.main-theme
(:require
[clojure.set :as set]
[edna.core :as edna]))
[:piano {:octave 4 (def tempo 72)
:tempo 60}
#{:-d :-a :e :f#} :a #{:f# :+d} (defn intro [volume]
#{:-e :e :+c} :a #{:c :e :f} #{
[:piano {:octave 4
:tempo tempo
:volume volume}
1/4 :-d :-a 1/8 :-e :-c 1/4 :-g :e :c
1/2 :-d
1/4 :-d :-a 1/8 :-e :-c 1/4 :-g :d :-f 1/8 :e :g 1/4 :f :a 1/16 :g 1/4 :f 1/2 :c] })
#{:-d :-a :e :f#} :a :+d :+c# :+e :+d :b :+c# (defn verse [volume]
#{:-e :c :a} #{:c :e}] #{
[:piano {:octave 4
:tempo tempo
:volume volume}
1/16 #{:-d :f#} 1/8 #{:-e :+f} :a 1/2 #{:f# :+d}
:r :r
1/16 #{:-c :g#} 1/8 #{:-e :+f} :b 1/2 #{:+d :f#}]
[:steel-drum {:octave 3
:tempo tempo
:volume (quot volume 2) }
1/8 :-a :a :b 1/2 :a
:c :c
:a 1/8 :b :a :-a]
[:acoustic-bass {:octave 3
:tempo tempo
:volume (quot volume 3) }
1/8 :-a :a :b 1/2 :a
:c :c
:a 1/8 :b :a :-a]})
(defn pre-chorus [volume]
#{
[:steel-drum {:octave 3
:tempo (* 2 tempo)
:volume volume}
1/8 :a 1/4 :a 1/8 :b 1/2 :-a]
[:acoustic-bass {:octave 3
:tempo (* 2 tempo)
:volume volume}
1/8 :b 1/4 :c 1/8 :g 1/2 :-g#]
})
(defn chorus [volume]
#{
[:piano {:octave 3
:tempo tempo
:volume volume}
1/16 #{:-d :f#} 1/8 #{:-e :+f} :a 1/4 #{:f# :+d}
1/16 :c :r :d :r :e :r :f
1/16 :r 1/4 :d 1/8 :r :r
1/16 :f :r :e :r :d :r :c ]
[:acoustic-bass {:octave 3
:tempo tempo
:volume (quot volume 3) }
1/16 :-a :a :b :c 1/4 :a
1/64 (repeat 7 [:c :d :g :-f])
1/16 :a :c :b :a 1/4 :-b
1/64 (repeat 7 [:-b :a :c :-g])] })
(concat
(map intro [20 40 80 100])
(map verse [100 80])
(map pre-chorus [60 80])
(map verse [100])
(map pre-chorus [60 80])
(map chorus [100 100])
(map verse [100 60])
(map chorus [40 20]))