Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use 'chord' rather than '+'. Defining '+' macro causes an NullPointer…

…Exception in Clojure 1.4
  • Loading branch information...
commit 79c3076b2dc7dcac5bafdfec6e8349038c0d23fd 1 parent 5154e4a
@gthomas gthomas authored
View
6 README.markdown
@@ -23,7 +23,7 @@ Each sample is being played at one time.
If you want to play a sample at the same time:
- (play! [kick (+snare hihat)])
+ (play! [kick (chord snare hihat)])
This will play kick at one time and snare+hihat at another.
@@ -78,7 +78,7 @@ and you are ready to start playing!
(p (pattern [A4 A2]))
- (p (pattern [kick snare (+ hihat snare)]))
+ (p (pattern [kick snare (chord hihat snare)]))
You can have it playing on a loop by executing:
(keep-looping)
@@ -102,6 +102,8 @@ In order to play a pause, you can play the _ note:
Designed and developed by Jon Vlachoyiannis (http://jon.is.emotionull.com).
+
+
# Thanks #
@mar_nas (for the incredible site mad.emotionull.com)
View
4 src/music_as_data/core.clj
@@ -40,7 +40,7 @@
;; Run this AFTER you have started the system
;; using
-(start main)
+;;(start main)
;; Create notes and load samples
;; after system started
@@ -53,7 +53,7 @@
;;(defsample snare2 "DistortedSnares2/distortedsnare52.wav")
(defsample hihat "HiHats1/hihat2.wav")
-(p (pattern [A4]))
+;(p (pattern [A4]))
;;(play! [A4 B4])
;;(keep-looping)
View
6 src/music_as_data/drum-examples.clj
@@ -9,8 +9,8 @@
;; Drum Demos
(times 2
- (p (pattern [kick (+ hihat snare)],2)))
+ (p (pattern [kick (chord hihat snare)],2)))
(times 4
- (p (pattern [kick (+ hihat snare) [kick kick] (+ hihat snare)],3)))
+ (p (pattern [kick (chord hihat snare) [kick kick] (chord hihat snare)],3)))
(times 4
- (p (pattern [kick (+ hihat snare) [kick kick kick kick] kick kick kick kick (+ hihat snare)],3)))
+ (p (pattern [kick (chord hihat snare) [kick kick kick kick] kick kick kick kick (chord hihat snare)],3)))
View
7 src/music_as_data/semantics.clj
@@ -9,8 +9,7 @@
(first (conj [] notes))))
;; Maybe defmulti?
-;; + is causing an NPE!
-;;(defmacro + [& more]
-;; make chords like (+ kick hihat)
-;;`(join ~@more))
+(defmacro chord [& more]
+;; make chords like (chord kick hihat)
+ `(join ~@more))
Please sign in to comment.
Something went wrong with that request. Please try again.