Created
July 24, 2011 15:00
-
-
Save gfredericks/1102703 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn static-field-map | |
[class] | |
(->> | |
class | |
(.getFields) | |
(seq) | |
(map (juxt #(-> % .getName .toLowerCase (.replaceAll "_" "-") keyword) | |
#(.get % class))) | |
(into {}))) | |
;; user=> (static-field-map ShortMessage) | |
{:midi-time-code 241, | |
:note-off 128, | |
:song-select 243, | |
:start 250, | |
:system-reset 255, | |
:end-of-exclusive 247, | |
:stop 252, | |
:song-position-pointer 242, | |
:tune-request 246, | |
:timing-clock 248, | |
:control-change 176, | |
:channel-pressure 208, | |
:pitch-bend 224, | |
:poly-pressure 160, | |
:note-on 144, | |
:continue 251, | |
:program-change 192, | |
:active-sensing 254} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment