-
Notifications
You must be signed in to change notification settings - Fork 64
Guiding Principles
The development of Tonic follows these guiding principles, which should always be considered when discussing features and architecture.
Users of Tonic should be able to patch, route, and message to their hearts' content. All developments to the underlying architecture should reflect this guideline, by adhering to the following:
-
Any parameter should be controllable by something else. For Generators, this means that any parameter that makes sense to be controlled by a signal-rate input should expose itself as an input for another Generator, and any parameter for which a control-rate value will suffice should expose itself as an input for a ControlValue (or ControlInput).
-
Any scalar values or messages (such as "triggers") should be able to be registered as named parameters, so that they may be set using their string name rather than via a member function. This also allows the same name to be used to control values for multiple inputs.
In order to make patching and signal-chain building as easy and readable as possible, Tonic uses a very simple syntax with overloaded operators. Additionally, the use of instance variables in Synth subclasses is discouraged. Rather, the "smart-pointer" capability of Generators (and other core objects) allows for signal chains to be built in-line without worrying about allocation:
outputGenerator = SineWave().freq( SineWave().freq( value("ModFreq", 100) ) * 0.8;
In order to be on-par with (or better than) other portable synthesis libraries, performance optimizations are key in the development of Tonic. After developing DSP code, always profile it and perform necessary optimizations to ensure high-performance. Where possible, the use of the Accelerate framework (Apple only) can greatly improve performance of mathematical signal-vector operations.
Tonic is, and should always be, an open-source project. Anyone with interest and knowledge should be welcome to contribute to the library and share examples, projects, etc.