Created
April 24, 2017 00:30
-
-
Save daveyarwood/b067f743b44d5e89be59016a4f33901a to your computer and use it in GitHub Desktop.
randomly generated bongos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn random-bongos | |
[ticks vol-min vol-max] | |
[(octave 4) | |
(set-duration 0.25) ; 16th notes | |
(let [notes (-> #{[:c] [:c :sharp] [:d] [:d :sharp] [:e]} | |
(->> (map #(note (apply pitch %)))) | |
(conj (pause))) | |
rand-note #(rand-nth notes) | |
rand-vol #(vol (+ vol-min (rand-int (- vol-max vol-min)))) | |
tick #(vector (rand-vol) (rand-note))] | |
(take ticks (repeatedly tick)))]) | |
percussion: (random-bongos 64 25 75) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment