This was posted three months ago on HN, but one person used it to generate music. http://karpathy.github.io/2015/05/21/rnn-effectiveness/
The folk music generation is located at https://soundcloud.com/seaandsailor/sets/char-rnn-composes-i.... I could imagine you could do something similar.
I know next to nothing about music theory.
(Diversion on theory textbooks...) Though I didn't pick it, at my school we use Steve Laitz's The Complete Musician (http://www.amazon.com/Complete-Musician-Integrated-Approach-...) and its associated workbooks. I wouldn't recommend it for self-study, because there are a lot of little errors in it a student likely wouldn't notice, and it's prone to confusing people. What might be better for learning on your own is Gary Karpinski's Manual for Ear Training and Sight Singing (http://www.amazon.com/Manual-Ear-Training-Sight-Singing/dp/0...) and the CD that goes along with it. Finding ear-training books is kind of difficult, since most are designed to be used in a class with a teacher. I have more opinions on textbooks but I'll save that rant for now.
Online, this site is pretty good for basic intervals and chords (as I said above), and http://www.musictheory.net/ also has some pretty basic exercises. It avoids a lot of the problems I mentioned above by simply not having those exercises for ear training. I think it's pretty good for people who don't know anything and want to learn, but I usually don't recommend it to my students because it tends to fuzz some specifics as it gets more advanced. I often recommend this software called Practica Musica (http://www.ars-nova.com/practica6.html), which we have installed in the lab at school.
(Background: I teach at a liberal-arts undergraduate institution, and the theory curriculum focuses on common-practice tonal music in the Western tradition. There are probably other more specific sources for particular genres, but knowing the basics of common-practice tonality is a good foundation for most other Western musics.)
You're probably randomly generating these, but I would strongly suggest incorporating some voice-leading and standard syntax into the examples. When it plays I-IV-V-I to establish the key, for example, it plays 3 root-position triads with parallel voice-leading:
Usually when ear training, the idea is to be able to hear common tonal progressions, where this kind of voice leading almost never shows up. Something like this would be better (and better still with a bass voice playing the roots in a different octave): I had trouble with the chord progression and melodic dictation exercises, since they're not common tonal progressions. The melodic dictation I tried first went ^6, up to ^5, down to ^1, and down again to ^3. While the minor seventh is a really common tonal interval, it's really uncommon to hear it from scale degree 6 in a major key up to scale degree 5 (you'd only really ever hear it as an applied chord of ii).Likewise, the first chord progression I tried went I - ii7 - ii - IV7. This is a progression you would not be likely to hear in tonal music (even in rock, jazz, and other modern genres). Once a chord gets a seventh (ii7), it doesn't usually lose it until its resolution (so ii7 to ii isn't a logical progression), and the progression ii to IV7 is a retrogression (at least in tonal classical music: this one you'd be slightly more likely to hear in rock perhaps, but I imagine it's still pretty rare).
All this is to say that I really like the idea, but I'm hesitant to tell my students about it because the random generation might lead them to things which I would never play in an ear-training class (because they never show up in common-practice tonal music). The way around this , and the way I've done it before, is to generate a bunch of scale-degree patterns or chord progression patterns and shuffle them randomly. If you're interested in developing this further I'd be happy to help come up with some of these. For intervals, scales, and individual chords, though, it's really great.