I've made some programs for generating microtonal music in the past - mostly 5-limit just intonation, with some limited forays into higher limits. I'm planning to write a much better program that can go up to 23-limit just intonation, and I'm planning out how it should represent music.
A musical piece will be made of musical sections.
Sections will be made of chord onset events, possibly with measure markers sprinkled in.
Chord onset events are made of notes/rests for multiple voices. I think a rest will be a different kind of object than a note, but maybe it'll just be a note with a special pitch. If a piece has 6 voices, maybe every chord onset event will have rests/notes listed for all six voices? I think so.
Notes have pitch and duration, and a property that tells you whether the note is voiced at the onset time veruss suspended from a previous note with the same pitch. I think notes/rests will have pointers to the previous note/rest in the same voice. Possibly they'll have pointers to the next note/rest as well, so that a voice could be thought of as a double linked list of notes/rests.
Sections are represented in terms of chord onset events, but that's not how they're composed/generated. Sections will mostly be composed from melodies. A secontion retains an edit history of the melodic addition events that were used to compose it.
I think adding melodic content will look like this - perhaps we'll call it a melodic or motivic occurence event:
Add (invert(Motive-X)), at time T2, in voice W)
"Invert" is a determinstic transform that generates a new melody from a given one. Deterministic transforms include [transpose, invert, reverse, augment rhythm (e.g. double note lengths), diminish rhythm].
There are also going to be transforms like "compose countermelody to a given melody, heavy in contrary motion". It feels like this kind of transform has to be non-deterministic. Maybe these can depend determinstically on a random seed value, so that composition can be variable but also reproducible, but I don't really see how. Maybe it's not important - the edit history can just include "compose counter melody to melody-X // psst: here's the countermelody generated".
I think applying ornaments and diminutions will also be a deterministic affair. You can choose which ones to apply randomly in composition, but there has to be a history of edits that reproducibly generates the song. This will let you edit previously generated content at different levels of abstractions: you can change the ornaments, you can change the amount of transposition of a transform for a motivic onset in one voice, maybe other things. The diminutions of this type will mostly be used for doing things like this: the soprano gets a frilly bit while the middle voices are doing slow notes, maybe then a middle voice responds while the soprano has slow notes.
I haven't thought much about how to generate a response melody from a call melody, but that is as important as generating simultaenous countermelodies, and will have to be addressed. Call-melodies end high, possibly with weaker harmony, and response melodies end low with strong harmony? There's a little more to it than that.
After adding enough motivic content that we have a skeleton of chord onset events for all voices (or at least two successive chord onset events with full voicing), then we'll have the option to try adding suspensions, passing tones, and neighbor notes in multiple voices simultaneously between those chord onsets. I think these will still be applied in the melodic-addition edit history (from which chord-onset events are generated) but it will be convenient to have full voiced chords sequences to decide which extra notes can be used - which combinations make unacceptable dissonances, and which make bold but acceptable passing dissonances while moving between consonant chords.
Obviously I'm trying to design this so that it can make imitative counterpoint, but hopefully it will also be general enough to make many kinds of music - romantic era classical music and smooth jazz and math rock and arabic maqam music and and bossa nova and Georgian folk music and so on.