0xABADCAFE / random-proto-synth

Prototype Synth
2 stars 0 forks source link

random-proto-synth

Probably the least practical synthesizer ever realised, implemented in php7. This code does not conform to any specific PSR standards.

Version Requirements

Requires PHP 7.4 or above for the following:

Key Ideas

Signals

Internally, all audio and control signals are handled as streams of floating point data, processed at a global "processing rate", which, when ultimately rendered to the output is equivalent to sample rate.

Packets

Signal data are generated and processed in discrete Packets that contain a globally configured number of entries. Packets support a number of elemental operations, including:

Waveforms

Waveforms represent basic periodic waveform shapes in a time/frequency independent manner and define the numerical period after they repeat. Waveforms typically accept a Packet of input values for which a Packet of the corresponding output values will be returned. Waveforms can have their minimum and maximum output levels specified and can have specialised Shapers applied that modify their behaviour.

Read more here

Oscillators

Oscillators are responsible for basic audio signal generation. They accept a Waveform and have a settable frequency and phase offset. They will produce Packets sequentially that represent the given Generator waveform at the specified frequency. Oscillator implementations exist that can accept input Packets that perform phase or amplitude modulation of their Generator output. The following oscillators are provided:

Filters

Filters are responsible for performing subtractive synthesis by cutting frequencies a desired part of the spectrum. Filters may also be resonant in which case the frequencies close to the cutoff can be boosted.

Envelopes

Envelopes are used to control some value, such as an Oscillator output volume, over time. Envelopes are composed of two key components:

Operators

Operators are high level interconnectable units for generation and processing of signals.

NoteMaps

NoteMaps are property lookup tables that map a MIDI Note Number to some value. NoteMaps are used to control fundamental synthesis features that are expected to vary as a function of the note played. For example: