We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c85d767 commit 26efa58Copy full SHA for 26efa58
src/joy/music.cljs
@@ -82,11 +82,13 @@
82
(defn notes [tone-pairs]
83
"Returns a sequence of note maps at moderate tempo for the given
84
sequence of tone-pairs."
85
- (->> tone-pairs
86
- (map pair-to-note)
87
- consecutive-notes
88
- (map #(update-in % [:delay] / 6))
89
- (map #(update-in % [:duration] / 6))))
+ (let [bpm 360
+ bps (/ bpm 60)]
+ (->> tone-pairs
+ (map pair-to-note)
+ consecutive-notes
90
+ (map #(update-in % [:delay] / bps))
91
+ (map #(update-in % [:duration] / bps)))))
92
93
(def magical-theme
94
"A sequence of [tone duration] pairs for a magical theme"
0 commit comments