Skip to content

Instantly share code, notes, and snippets.

@alandipert
Created March 31, 2010 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alandipert/350182 to your computer and use it in GitHub Desktop.
Save alandipert/350182 to your computer and use it in GitHub Desktop.
(ns org.dipert.xmltunes
(:use [org.dipert midi sax]))
(def file (java.io.File. "/home/alan/Desktop/dipert_hw2/inventory.xml"))
(defn main []
(let [middle-c 60
current-note (atom middle-c)]
(play-notes (map #(hash-set :duration 400
:note (condp = (:type %)
:start-element (swap! current-note inc)
:end-element (swap! current-note dec)
:characters @current-note))
(parse-xml file)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment