Expand description
§Oscen - a library to build modular software synthesizers.
§The Oscen architecture is designed with the following objcectives in mind:
-
Extensible — Users of Oscen should be able to create their own synth modules without having to modify any of the library code, e.g. add cases to an enum. This is accomplished by defining the
Signal
trait and using trait objects to represent synth modules which can be added to aRack
(graph). Signal objects can be downcast using theAny
trait to access specific features of that particularSynthModule
. -
Dynamic - The
Rack
should be able to be “patched” while the synth is running, similar to a modular hardware synth. ARack
is basically a graph where nodes are synth modules, e.g. oscillators, envelope generators and filters. Each node can have many inputs and a single output. Edges connect the ouput of one node to one of the inputs of another. Since we cannot know the names of the fields of a node (because it’s a trait object) We use theIndex
andIndexMut
traits to access the fields by a&str
. -
Strongly Typed - As much as possible have the rust catch errors in our synth at comple time. This is difficult to do in light of the previous objective and some compromises have to be made. E.g., it is not possible to know at compile time about a patch that will be added while the synth is running.
Modules§
- Envelope generators.
- A collection of some basic audio filters.
- Instruments.
- Midi interface nodes.
- Syth modules for combining other sytn modules.
- Some common (and some less common) oscillators.
- An implementation of freeverb.
- Sequencer
- Wave shaping.
- Core Oscen types and traits.
- Utilites.
Macros§
- Since
as_any_mut()
usually has the same implementation for anySignal
we provide this macro for coneniene. - If your module has
on
andoff
methods you can use this macro to generate theGate
trait. - For
Signal
s that have atag
field implementas_any_mut()
andtag()
.