I am writing an app to record drum tablature (specifically for a sampler). I am following the conventions of the sampler which are:
A Sequence is 1 or more Tracks. A Sequence can be quantized (break the measure up into equal parts).
A Track is an instrument or sound that will be played at certain parts of a measure. Each Track is broken up into parts. The number of parts is determined by the quantization of the Sequence. As an example, if the quantization is set to 1/16, the array will have length of 16. Each element of the array then stores whether or not the sound should play at that step in the Sequence.
Naturally, I have one object to represent a Sequence. It has an attribute called tracks
which is an array of Track objects. A Track object has an array attribute that is in equal length to the quantization of the Sequence.
I am suffering major analysis paralysis and am unable to determine What is a clean way for all Track
objects belonging to a specific Sequence
to know when the quantization has changed so it can update its own internal array?
Or
How should the Track
object know what to set its array length to without coupling the Sequence
object?