       (fn [x] (or (= 1 x) (rand-nth [true false])))
       notes)))
 
-(defrecord Measure [note time-signature])
+(defrecord Beat [note-count note-value]
+  Entity
+  (generated [this] (segment-beat note-count note-value)))
+
+(defrecord Measure [note-count note-value]
+  Entity
+  (generated [this] (time-signature note-count)))

(ns tenor.entities)

(defrecord Note [note-value pitch-letter octave])

(defn make-note [notation]
  (let [notation-re #"^(1|2|4|8|16)([A-G])([#b]?)([1-9])$"

  (cond
    (> note-count 3)
    (let [beat (rand-nth [2 3 4])
          sig (conj (or sig '()) beat)]
      (time-signature (- note-count beat) sig))
    (and (<= note-count 3) (> note-count 0))
    (let [sig (conj (or sig '()) note-count)]
      (time-signature 0 sig))
    :else sig))

