EventSequence tool

Hey there,

After a VST request on KVR, I started to write a step sequencer. In order to stick to my ‘keep thing modular’ cannon, I decided to write some generic classes to build everything from. From this I have been developing an ‘EventSequence’ class, which can hold events that will be performed when their allocated step has been reached.

It uses a discrete stepped time scale, which you can play from either the beginning, a particular event, or a particular step in the scale. You step thru the scale in your code by simply calling advanceOneStep(), which moves on a step and responds accordingly.

Events can be added to the sequence, and positioned as required. Everything is calculated proportionally, using the length of the sequence as a double from 0-1. This means that it’s really easy to scale the sequence, just by changing the number of steps (e.g. to make the sequence play back at double speed). The end of the event is also proportional, but to the length available before the next event or the end of the sequence.

You can just subclass both EventSequence and Event classes to suit your needs. The event is started and stopped by the sequence when the appropriate steps are reached, and you set the actions they perform in callbacks.

My aim is to make it so that it will function as an engine not just for conventional step-sequencers, but also for custom multi-stage envelopes and suchlike.

I guess it’s a bit pointless me posting this here, but I thought I’d mention it in case anyone has any suggestions or wishes for the set that may make it really useful to them.

Currently it does not do any reordering (e.g. if you try to set the start time of an event to AFTER another event in the sequence) but I think I’d like that to be in there.

Let me know if you have any thoughts on this.

here’s a first version of the classes. there’s some stuff in the changelog that describes what to do with them.

event sequence classes v1

the test app i currently have only outputs debugging info rather than show anything it can really do. hopefully soon i’ll have a nice example to show it off.

Cool. Looks interesting!