Skip to content
Browse files

system is working

  • Loading branch information...
1 parent b0f9f62 commit e109a66c78300be2002ff7ee09e8e6939bf36eea Jon Vlachoyiannis committed Mar 8, 2011
Showing with 104 additions and 92 deletions.
  1. +14 −13 src/music_as_data/core.clj
  2. +4 −0 src/music_as_data/signals.clj
  3. +86 −79 src/music_as_data/signalsnotes.clj
View
27 src/music_as_data/core.clj
@@ -5,29 +5,22 @@
(:import [ddf.minim Minim]
[ddf.minim.signals SquareWave]
[ddf.minim.signals SineWave])
- (:use [rosado.processing.applet])
+ (:use [rosado.processing]
+ [rosado.processing.applet])
(:use [music-as-data.mad]
[music-as-data.elements]
- [music-as-data.globals]))
-
-;;(defsample kick "KickDrums1/kickdrum6.wav")
-(defsample kick2 "KickDrums4/kickdrum154.wav")
-;;(defsample snare "SnareDrums1/snaredrum2.wav")
-(defsample snare2 "DistortedSnares2/distortedsnare52.wav")
-(defsample hihat "HiHats1/hihat2.wav")
+ [music-as-data.globals]
+ [music-as-data.signalsnotes]))
(defn setup []
"Runs once."
(swap! *minim* (fn [minim] (Minim. *applet*)))
(swap! *outp* (fn [out]
(.getLineOut @*minim*)))
- (swap! *outp* (fn [out]
- (.getLineOut @*minim*)))
(swap! *sine* (fn [out]
(new SineWave 440 1 (.sampleRate @*outp*)))))
-
(defn draw []
(background-float 124))
@@ -40,5 +33,13 @@
(defn end [applet]
(stop applet))
-;;(p)
-;;(play!)
+;; Create notes and load samples
+;; after system started
+(create-notes)
+
+;;(defsample kick "KickDrums1/kickdrum6.wav")
+(defsample kick2 "KickDrums4/kickdrum154.wav")
+;;(defsample snare "SnareDrums1/snaredrum2.wav")
+(defsample snare2 "DistortedSnares2/distortedsnare52.wav")
+(defsample hihat "HiHats1/hihat2.wav")
+
View
4 src/music_as_data/signals.clj
@@ -1,3 +1,7 @@
+(ns music-as-data.signals
+ (:use [music-as-data.globals]
+ [music-as-data.elements]))
+
(defmacro get-note-freq
"Converts Ab4 to notes: A b 4 and return frequency"
[snote]
View
165 src/music_as_data/signalsnotes.clj
@@ -1,81 +1,88 @@
-;; FIXME - macro here!
-(defnote A0 @*sine*)
-(defnote A1 @*sine*)
-(defnote A2 @*sine*)
-(defnote A3 @*sine*)
-(defnote A4 @*sine*)
-(defnote A5 @*sine*)
-(defnote A6 @*sine*)
-(defnote A7 @*sine*)
+(ns music-as-data.signalsnotes
+ (:use [music-as-data.signals]
+ [music-as-data.globals]))
-(defnote B0 @*sine*)
-(defnote B1 @*sine*)
-(defnote B2 @*sine*)
-(defnote B3 @*sine*)
-(defnote B4 @*sine*)
-(defnote B5 @*sine*)
-(defnote B6 @*sine*)
-(defnote B7 @*sine*)
+(defrecord Melement [volume pitch duration play-fn data])
-(defnote C0 @*sine*)
-(defnote C1 @*sine*)
-(defnote C2 @*sine*)
-(defnote C3 @*sine*)
-(defnote C4 @*sine*)
-(defnote C5 @*sine*)
-(defnote C6 @*sine*)
-(defnote C7 @*sine*)
-
-(defnote D0 @*sine*)
-(defnote D1 @*sine*)
-(defnote D2 @*sine*)
-(defnote D3 @*sine*)
-(defnote D4 @*sine*)
-(defnote D5 @*sine*)
-(defnote D6 @*sine*)
-(defnote D7 @*sine*)
-
-(defnote D#0 @*sine*)
-(defnote D#1 @*sine*)
-(defnote D#2 @*sine*)
-(defnote D#3 @*sine*)
-(defnote D#4 @*sine*)
-(defnote D#5 @*sine*)
-(defnote D#6 @*sine*)
-(defnote D#7 @*sine*)
-
-(defnote E0 @*sine*)
-(defnote E1 @*sine*)
-(defnote E2 @*sine*)
-(defnote E3 @*sine*)
-(defnote E4 @*sine*)
-(defnote E5 @*sine*)
-(defnote E6 @*sine*)
-(defnote E7 @*sine*)
-
-(defnote F0 @*sine*)
-(defnote F1 @*sine*)
-(defnote F2 @*sine*)
-(defnote F3 @*sine*)
-(defnote F4 @*sine*)
-(defnote F5 @*sine*)
-(defnote F6 @*sine*)
-(defnote F7 @*sine*)
-
-(defnote G0 @*sine*)
-(defnote G1 @*sine*)
-(defnote G2 @*sine*)
-(defnote G3 @*sine*)
-(defnote G4 @*sine*)
-(defnote G5 @*sine*)
-(defnote G6 @*sine*)
-(defnote G7 @*sine*)
-
-(defnote G#0 @*sine*)
-(defnote G#1 @*sine*)
-(defnote G#2 @*sine*)
-(defnote G#3 @*sine*)
-(defnote G#4 @*sine*)
-(defnote G#5 @*sine*)
-(defnote G#6 @*sine*)
-(defnote G#7 @*sine*)
+(defn create-notes []
+ ;; FIXME - macro here!
+ (defnote A0 @*sine*)
+ (defnote A1 @*sine*)
+ (defnote A2 @*sine*)
+ (defnote A3 @*sine*)
+ (defnote A4 @*sine*)
+ (defnote A5 @*sine*)
+ (defnote A6 @*sine*)
+ (defnote A7 @*sine*)
+
+ (defnote B0 @*sine*)
+ (defnote B1 @*sine*)
+ (defnote B2 @*sine*)
+ (defnote B3 @*sine*)
+ (defnote B4 @*sine*)
+ (defnote B5 @*sine*)
+ (defnote B6 @*sine*)
+ (defnote B7 @*sine*)
+
+ (defnote C0 @*sine*)
+ (defnote C1 @*sine*)
+ (defnote C2 @*sine*)
+ (defnote C3 @*sine*)
+ (defnote C4 @*sine*)
+ (defnote C5 @*sine*)
+ (defnote C6 @*sine*)
+ (defnote C7 @*sine*)
+
+ (defnote D0 @*sine*)
+ (defnote D1 @*sine*)
+ (defnote D2 @*sine*)
+ (defnote D3 @*sine*)
+ (defnote D4 @*sine*)
+ (defnote D5 @*sine*)
+ (defnote D6 @*sine*)
+ (defnote D7 @*sine*)
+
+ (defnote D#0 @*sine*)
+ (defnote D#1 @*sine*)
+ (defnote D#2 @*sine*)
+ (defnote D#3 @*sine*)
+ (defnote D#4 @*sine*)
+ (defnote D#5 @*sine*)
+ (defnote D#6 @*sine*)
+ (defnote D#7 @*sine*)
+
+ (defnote E0 @*sine*)
+ (defnote E1 @*sine*)
+ (defnote E2 @*sine*)
+ (defnote E3 @*sine*)
+ (defnote E4 @*sine*)
+ (defnote E5 @*sine*)
+ (defnote E6 @*sine*)
+ (defnote E7 @*sine*)
+
+ (defnote F0 @*sine*)
+ (defnote F1 @*sine*)
+ (defnote F2 @*sine*)
+ (defnote F3 @*sine*)
+ (defnote F4 @*sine*)
+ (defnote F5 @*sine*)
+ (defnote F6 @*sine*)
+ (defnote F7 @*sine*)
+
+ (defnote G0 @*sine*)
+ (defnote G1 @*sine*)
+ (defnote G2 @*sine*)
+ (defnote G3 @*sine*)
+ (defnote G4 @*sine*)
+ (defnote G5 @*sine*)
+ (defnote G6 @*sine*)
+ (defnote G7 @*sine*)
+
+ (defnote G#0 @*sine*)
+ (defnote G#1 @*sine*)
+ (defnote G#2 @*sine*)
+ (defnote G#3 @*sine*)
+ (defnote G#4 @*sine*)
+ (defnote G#5 @*sine*)
+ (defnote G#6 @*sine*)
+ (defnote G#7 @*sine*))

0 comments on commit e109a66

Please sign in to comment.
Something went wrong with that request. Please try again.