It doesn't contain code, but "Musimathics" by Gareth Loy was way more useful to me than any vanilla theory book. I think most other musically ignorant programmers would agree.
I don't really remember finding any good dense sources, I mostly slogged through wikipedia articles and gradually decoded things. I really ought to get around to that article...
Until your article is done, can you recommend other sources that go into this?