A JFugue wrapper for Clojure with some ideas from [Haskore] (http://www.haskell.org/haskellwiki/Haskore)
Add depencency to lein/cake project:
[fughetta "0.0.1-SNAPSHOT"]
Import into your namespace:
(:use fughetta.core)
- Defaults
(cs) => "[61]" = "C#"
(q-) => "Rq."
- Octave
(c 6) => "[72]" = "C6"
- Durations
(c 6 q i) = (i (q (c 6))) => "[72]qi"
- Chords
(maj (q (c))) => "[60]majq"
(minor (d 6 w)) => "[74]minw"
Use the pattern function to join notes (collections will be flattened!)
(pattern
(c) (d) (e)
[(f) (g)]
(repeat 2 [(c) (d) (e)]))
=> " [60] [62] [64] [65] [67] [60] [62] [64] [60] [62] [64] "
- Instruments
(inst :distortion-guitar (c) (d) (e)) => "I[DISTORTION_GUITAR] [60] [62] [64]"
- Rhythms (subject to change)
(let [x "q"
- (q)]
(rhythm
:bass-drum [x - - - x - - - x - - - x - - -]
:electric-snare [- - x - - - x - - - x - - - x -]
:closed-hi-hat [x x x x x x x x x x x x x x x x]))
(++ (c) (d) (e)) => "[60]+[62]+[64]"
(++ (c) (-- (d) (e))) => "[60]+[62]_[64]"
- Triplets
(*** (c 5 q) (d 5 q) (e 5 q)) => " [60]q* [62]q* [64]q* "
- Other tuplets
(** 2 (c 5 q) (d 5 q) (e 5 q)) => " [60]q*3:2 [62]q*3:2 [64]q*3:2 "
(** 4 (map q (c) (d) (e) (f) (g))) => " [60]q*5:4 [62]q*5:4 [64]q*5:4 [65]q*5:4 [67]q*5:4 "
(>> (c)) => "[61]"
(>> (c) 4) => "[65]"
(<< (c)) => "[59]"
(<< (c) 4) => "[56]"
- Voices
(voice 1 (c) (d) (e))
- Tempo
(tempo 150 (c) (d) (e))
- Volume
(vol 1500 (c) (d) (e))
- Play
(play! (c) (d 5) (e 5 q))
- Stop
(stop!)
- Save to file
(save! "filename" (c) (d 5) (e 5 q))
More information on JFugue can be found [here] (http://www.jfugue.org/jfugue-chapter2.pdf)
Copyright (C) 2011 Sebastian Rojas
Distributed under the GNU Lesser General Public License, the same as JFugue.