synthesizer.instruments.instrument¶
Generic Instrument factory entry point.
Instrument is a backwards-compatible factory which instantiates the correct specialised instrument class based on the supplied arguments. Configurations that do not map cleanly onto one of the supported specialised classes are rejected explicitly.
Use of the Instrument factory is optional. Users can construct the specific instrument type directly if they already know which configuration they need.
Classes
- class synthesizer.instruments.instrument.Instrument(*args, **kwargs)[source]¶
Factory for constructing specialised instrument classes.
This class is a convenience API. Instrument(…) returns one of the specialised instrument subclasses based on the supplied arguments. Malformed argument combinations are rejected explicitly.
The factory is not part of the specialised instrument hierarchy; it simply dispatches to the correct specialised class.