Step Sequencers and Threads


#1

Hey all,
I’m currently building a step sequencer using a Thread for the timing sync and the Time::waitForMillisecondCounter function to loop through the run() method.
All runs fine, however the plan is to have multiple sequencers that are independent of each other; that meaning that they can be individual played and stopped at any time, and will send out different audio/midi data.

My initial thought (and the way I’m currently implementing it) is to have multiple instances of my sequencer object which inherits from the Thread class, however this would mean I could end up with many Threads running at the same time (I’m thinking it will be a 24-track sequencer). Would that be recommended? Or should I consider combining different sequencers into fewer or even a single Thread?
Thanks.


#2

Not sure what you’re doing but I would do all stuff in the audio thread as far as possible. If you need to send out external midi it’s generated in the audio thread but copied into a buffer that gets read out by some thread which sends it to MIDI, taking into account the timestamps.


#3

Sorry for reviving a 5 year old post, but I am having the exact same dilemma - what did you end up doing?

Thank you!