 (defn duration [pluck]
   (or (some-> pluck first (s/split #":") second Integer/parseInt)
       1))
-
-(defrecord PASRUnit [data])
 
 (defn make-pitches [pasr base]
   (->> pasr

        durations (remove nil? durations-2)]
    (map #(/ % jathi) durations)))

(defn make-env [shruthi jathi pluck]
  (let [pasr (nth pluck 3)
        pitches (make-pitches pasr shruthi)
        durations (make-durations pasr jathi)
        phrase-duration (duration pluck)]
    {:dur phrase-duration
     :env (envelope pitches
                    durations)}))

(defn envs-for-phrase [shruthi jathi phrase]
  (let [envs (map #(make-env shruthi jathi %)

            [clojure.string :as s]
            [clojure.pprint :as pp]
            [cheshire.core :as json]))

(definst ignore-this [x 1]
  (def *mx *)
  (sin-osc))

(defn read-pasr-json [filename]
  (-> filename io/resource slurp (json/decode true)))
