I have a working modulation matrix on my XM8 prototype. But something is missing and I haven't had the time to put my finger on exactly what.
Here is a more thorough walkthrough of what could/should be supported.
1) A destination may be modulated by multiple sources, each with their own amount/weight. The sources are summed (to give for example vibrato by modulating a pitch CV by an LFO and summing it with the original pitch)
2) A source may modulate any number of destinations. Again, for example, the LFO may modulate multiple oscillators at the same time etc.
Now, these are dead given. But then we have a more complex one
3) A source may modulate the amount of another source. For example, a separate potentiometer may modulate the amount of LFO applied to the VCO pitch.
Then we have a special case
4) Multiple destinations may control a function, which in turn is the source of another modulation. For example, multiple pots may control an envelope. The output of the envelope may modulate the output VCA.
Strictly speaking, we could also let the destination directly act as a source, leading to
5) Any destination may be treated as the source of another modulation
6) Any destination may be treated as the amout of another modulation
Right here it feels like we're entering FM territory...
Summed up into some general rules:
- A modulation path consists of a source, an amount multiplier and a destination.
- A source may modulate a destination or the amount of another source
- A source may modulate multiple destinations or amounts
- A destination may be modulated by multiple sources. The sources are summed after being multiplied by individual amounts
- Multiple destinations may act together to control a function (LFO, envelope)
- Pots, destinations and function outputs may all act as sources
It would be a good idea to hardwire most pots to specific destinations
Most amount coefficients in the matrix will be zero. It may be better to have a list of 'active' modulations to reduce the number of coefficientds, but that depends on the MCU and what optimizations it may do on the data.
I think my major mental breakthrough here is that I realized that sources, especially pots, must be able to control the amount.
Things I still wonder about
- Will it always be correct to add, not multiply, the various modulation paths?
- For simplicity, should we really allow any destination to act as a source?
Oh, and here are some resources for Teensy math:
- https://forum.pjrc.com/index.php?threads/linear-algebra-library-for-teensy-4-1-robotics-project.69778/
- https://github.com/PaulStoffregen/Audio/blob/master/utility/dspinst.h
PS: Multiplying and summing two vectors (or matrices) is called a dotproduct.
No comments:
Post a Comment