Sequencing

I have a couple of sequences to play on a mididevice (microsoft midicrapper). a channel 10 drum metronome and a piece of simple music proper.

I slapped them both on thier own high priority threads, thinking that if a beat and a note happen at the same time there will be a wee timing discrepency that I don’t mind.

but I’m getting dropped notes. always seems to happen at particular places, although the bars of the piece are repetative.

is this because of my (boneheaded?) 2 threaded architecture?

jules. you know this stuff. should I go with a single thread? or am I possibly barking up the wrong tree?

personally i would definitely go with a single thread for playback. if i needed to perform some other queueing or preparation task then i’d use a different thread, but for something where multiple things are running to the same clock, i’d use just one. Apart from anything else, it would help in the long run should you choose to expand it; imagine you thought of something else you wanted to run alongside it, or perhaps several other things? You wouldn’t want to have a separate thread for all of them, so it would be good to have a framework that can support multiple event types/chains from a single playback thread.

that’s just my take on the matter, i have no idea whether or not it is causing dropped notes, but i wouldn’t be surprised if a single thread solution were to solve the problem.

aye, cheers h.

got a MUCH better single threaded architecture using MidiMessageSequences rather than trying to generate on the fly. the 2 fred thing was a feeble attempt to avoid having to interpollate the drums and melody generators while making sure waitForMillisecondCounter was getting the right value.

works fine the noo.