diff --git a/docs/soul_library.html b/docs/soul_library.html index 72e26f43..248fd7f8 100644 --- a/docs/soul_library.html +++ b/docs/soul_library.html @@ -312,8 +312,10 @@

namespace

This namespace contains some handy stuctures to use when declaring external variables which are going to be loaded with data from audio files.

Structures

-

An external variable declared with the type soul::audio_samples::Mono can be loaded with monoised data from an audio file.

struct Mono
{
    float32[] frames;
    float64 sampleRate;
}

-

An external variable declared with the type soul::audio_samples::Stereo can be loaded with stereo data from an audio file.

struct Stereo
{
    float32<2>[] frames;
    float64 sampleRate;
}

+

An external variable declared with the type soul::audio_samples::Mono can be loaded with monoised data from an audio file.

struct Mono
{

+
float32[] frames;
float64 sampleRate;

}

+

An external variable declared with the type soul::audio_samples::Stereo can be loaded with stereo data from an audio file.

struct Stereo
{

+
float32<2>[] frames;
float64 sampleRate;

}

namespace soul::pan_law

This namespace contains various pan-related helper functions

@@ -326,12 +328,18 @@

namespace

This namespace contains some types which are handy for representing synthesiser note events. They do a similar job to MIDI events, but as strongly-typed structs instead of a group of bytes. Things like the midi::MPEParser class generate them.

The events do contain a channel number, in the same way that MIDI does, but there are no restrictions on its range.

Structures

-

Represents a note-on (key-down) event.

struct NoteOn
{
    int32 channel;
    float32 note;
    float32 velocity;
}

-

Represents a note-off (key-up) event.

struct NoteOff
{
    int32 channel;
    float32 note;
    float32 velocity;
}

-

Represents a change to the pitch that should be applied to any notes being played on the channel specified.

struct PitchBend
{
    int32 channel;
    float32 bendSemitones;
}

-

Represents a change to the pressure that should be applied to any notes being played on the channel specified.

struct Pressure
{
    int32 channel;
    float32 pressure;
}

-

Represents a change to the Y-axis parameter that should be applied to any notes being played on the channel specified.

struct Slide
{
    int32 channel;
    float32 slide;
}

-

Represents a change to a user-defined control parameter that should be applied to any notes being played on the channel specified.

struct Control
{
    int32 channel;
    int32 control;
    float32 value;
}

+

Represents a note-on (key-down) event.

struct NoteOn
{

+
int32 channel;
float32 note;
float32 velocity;

}

+

Represents a note-off (key-up) event.

struct NoteOff
{

+
int32 channel;
float32 note;
float32 velocity;

}

+

Represents a change to the pitch that should be applied to any notes being played on the channel specified.

struct PitchBend
{

+
int32 channel;
float32 bendSemitones;

}

+

Represents a change to the pressure that should be applied to any notes being played on the channel specified.

struct Pressure
{

+
int32 channel;
float32 pressure;

}

+

Represents a change to the Y-axis parameter that should be applied to any notes being played on the channel specified.

struct Slide
{

+
int32 channel;
float32 slide;

}

+

Represents a change to a user-defined control parameter that should be applied to any notes being played on the channel specified.

struct Control
{

+
int32 channel;
int32 control;
float32 value;

}

namespace soul::voice_allocators

Simple voice allocation helpers, which take a single stream of input events, and redirect them to an array of target voice processors.

processor soul::voice_allocators::Basic

@@ -341,13 +349,14 @@

Specialisation Parameters

Inputs

+
  • event eventIn (soul::note_events::NoteOn, soul::note_events::NoteOff, soul::note_events::PitchBend, soul::note_events::Pressure, soul::note_events::Slide, soul::note_events::Control)
  • Outputs

    +
  • event voiceEventOut (soul::note_events::NoteOn, soul::note_events::NoteOff, soul::note_events::PitchBend, soul::note_events::Pressure, soul::note_events::Slide, soul::note_events::Control)
  • -

    Structures

    struct VoiceInfo
    {
        bool active;
        int32 channel;
        float32 note;
        int32 voiceAge;
    }

    +

    Structures

    struct VoiceInfo
    {

    +
    bool active;
    int32 channel;
    float32 note;
    int32 voiceAge;

    }

    Variables

    int32 nextAllocatedVoiceAge = 1000000000

    @@ -363,12 +372,12 @@

    Specialisation Parameters

    Inputs

    +
  • stream in1 (SampleType)
  • +
  • stream in2 (SampleType)
  • Outputs

    +
  • stream out (SampleType)
  • processor soul::mixers::DynamicSum

    Simple processor which adds two sources together using streams to control the gains to apply to each source.

    @@ -376,14 +385,14 @@

    Specialisation Parameters

    Inputs

      -
    • stream in1 (SampleType)
    • -
    • stream in2 (SampleType)
    • -
    • stream gain1 (float32)
    • -
    • stream gain2 (float32)
    +
  • stream in1 (SampleType)
  • +
  • stream in2 (SampleType)
  • +
  • stream gain1 (float32)
  • +
  • stream gain2 (float32)
  • Outputs

    +
  • stream out (SampleType)
  • processor soul::mixers::DynamicMix

    Simple processor which mixes together two sources, using a stream of values to indicate the ratio.

    The mixRange constant allows you to set the range of values that will be passed in the mix stream, so e.g. mixRange = 1.0 means that mix will be in the range 0 to 1, and mixRange = 100 means the values will be 0 to 100. The mix stream is expected to contain values between 0 and mixRange, where mix = 0 produces 100% in1, and mix = mixRange produces 100% in2.

    @@ -391,13 +400,13 @@

    Specialisation Parameters

    Inputs

    +
  • stream in1 (SampleType)
  • +
  • stream in2 (SampleType)
  • +
  • stream mix (float32)
  • Outputs

    +
  • stream out (SampleType)
  • namespace soul::gain

    Utility processors for common tasks like applying gain in various ways.

    processor soul::gain::FixedGain

    @@ -407,11 +416,11 @@

    Specialisation Parameters

    Inputs

    +
  • stream in (SampleType)
  • Outputs

    +
  • stream out (SampleType)
  • processor soul::gain::DynamicGain

    Simple processor which applies a changeable gain level to a signal.

    @@ -419,12 +428,12 @@

    Specialisation Parameters

    Inputs

      -
    • stream in (SampleType)
    • -
    • stream gain (float32)
    +
  • stream in (SampleType)
  • +
  • stream gain (float32)
  • Outputs

    +
  • stream out (SampleType)
  • processor soul::gain::SmoothedGainParameter

    Converts an input event parameter in decibels to a smoothed stream of raw gain levels.

    @@ -432,11 +441,11 @@

    Specialisation Parameters

    Inputs

      -
    • event volume (float32)
    +
  • event volume (float32)
  • Outputs

      -
    • stream gain (float32)
    +
  • stream gain (float32)
  • Variables

    float32 targetGain

    @@ -452,11 +461,11 @@

    Specialisation Parameters

    Inputs

    +
  • event noteIn (soul::note_events::NoteOn, soul::note_events::NoteOff)
  • Outputs

      -
    • stream levelOut (float32)
    +
  • stream levelOut (float32)
  • Variables

    bool active = false

    @@ -465,7 +474,9 @@

    namespace

    This namespace contains some random number generation helpers. We're assuming that nobody's going to be using these RNGs for security-critical cryptographic applications. All the algorithms here are chosen to be fast, and definitely not cryptographically strong!

    Structures

    -

    State for a Park-Miller random number generator.

    struct RandomNumberState
    {
        int64 seed;
    }

    +

    State for a Park-Miller random number generator.

    struct RandomNumberState
    {

    +
    +

    The current seed. Top tip: when generating a seed, you might want to use the processor.id constant, to make sure that each instance of a processor has a differently-seeded RNG. If you want the RNG to be different each time the program runs, you could also throw the processor.session constant into the mix too.

    int64 seed;

    }

    Functions

    reset

    @@ -483,27 +494,33 @@

    processor

    Outputs

      -
    • stream out (float32)

    +
  • stream out (float32)
  • processor soul::noise::Brown

    Brown noise generator

    Outputs

      -
    • stream out (float32)
    +
  • stream out (float32)
  • processor soul::noise::Pink

    Pink noise generator

    Outputs

      -
    • stream out (float32)

    Timeline event utilities

    The timeline namespace contains various structs and functions which are used when dealing with positions and tempos along a timeline.

    +
  • stream out (float32)
  • Timeline event utilities

    The timeline namespace contains various structs and functions which are used when dealing with positions and tempos along a timeline.

    namespace soul::timeline

    The timeline namespace contains various structs and functions which are used when dealing with positions and tempos along a timeline.

    Structures

    -

    Represents a simple time-signature.

    struct TimeSignature
    {
        int32 numerator;
        int32 denominator;
    }

    -

    Represents a tempo in BPM.

    struct Tempo
    {
        float32 bpm;
    }

    -

    Represents the state of a host which can play timeline-based material.

    struct TransportState
    {
        int32 state;
    }

    -

    Represents a position along a timeline, in terms of frames and also (where appropriate) quarter notes.

    struct Position
    {
        int64 currentFrame;
        float64 currentQuarterNote;
        float64 lastBarStartQuarterNote;
    }

    +

    Represents a simple time-signature.

    struct TimeSignature
    {

    +
    int32 numerator;
    int32 denominator;

    }

    +

    Represents a tempo in BPM.

    struct Tempo
    {

    +
    float32 bpm;

    }

    +

    Represents the state of a host which can play timeline-based material.

    struct TransportState
    {

    +
    +

    In the absence of enums, the valid values for the state are: 0 = stopped, 1 = playing, 2 = recording.

    int32 state;

    }

    +

    Represents a position along a timeline, in terms of frames and also (where appropriate) quarter notes.

    struct Position
    {

    +
    +

    A number of frames from the start of the timeline.

    int64 currentFrame;

    The number of quarter-notes since the beginning of the timeline. A host may not have a meaningful value for this, so it may just be 0. Bear in mind that a timeline may contain multiple changes of tempo and time-signature, so this value will not necessarily keep increasing at a constant rate.

    float64 currentQuarterNote;

    The number of quarter-notes from the beginning of the timeline to the start of the current bar. A host may not have a meaningful value for this, so it may just be 0. You can subtract this from currentQuarterNote to find out how which quarter-note the position represents within the current bar.

    float64 lastBarStartQuarterNote;

    }

    Functions

    quarterNotesPerBeat

    float32 quarterNotesPerBeat (TimeSignature timeSig)

    @@ -526,7 +543,10 @@

    Variables

    namespace soul::oscillators::phasor

    A unipolar ramp (phasor) oscillator. This is a non-bandlimited oscillator that will cause aliasing!

    -

    Structures

    struct State
    {
        PhaseType phase;
        PhaseType phaseIncrement;
    }

    +

    Structures

    struct State
    {

    +
    +

    The phase uses a range 0 to 1.0

    + PhaseType phase;
    PhaseType phaseIncrement;

    }

    Functions

    reset

    @@ -543,11 +563,11 @@

    Specialisation Parameters

    Inputs

      -
    • event frequencyIn (float32)
    +
  • event frequencyIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    @@ -559,11 +579,11 @@

    Specialisation Parameters

    Inputs

      -
    • event frequencyIn (float32)
    +
  • event frequencyIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    float32 phaseIncrement = float (initialFrequency * twoPi * processor.period)

    @@ -596,12 +616,12 @@

    Specialisation Parameters

    Inputs

      -
    • event shapeIn (float32)
    • -
    • event frequencyIn (float32)
    +
  • event shapeIn (float32)
  • +
  • event frequencyIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    @@ -612,7 +632,11 @@

    namespace

    Specialisation Parameters

    namespace soul::oscillators::quadrature (int32 updateInterval = 16)

    -

    Structures

    struct State
    {
        SampleType u;
        SampleType v;
    }

    struct Coeffs
    {
        SampleType k1;
        SampleType k2;
    }

    +

    Structures

    struct State
    {

    +

    }

    struct Coeffs
    {

    +

    }

    Functions

    reset

    @@ -629,12 +653,12 @@

    Specialisation Parameters

    Inputs

      -
    • event frequencyIn (float32)
    +
  • event frequencyIn (float32)
  • Outputs

    +
  • stream sineOut (SampleType)
  • +
  • stream cosineOut (SampleType)
  • Variables

    float32 frequency = initialFrequency

    @@ -662,7 +686,8 @@

    Variables

    namespace soul::oscillators::lfo::smoother

    Functions for applying a smoothing filter on a changing value.

    -

    Structures

    struct State
    {
        float32 currentValue;
        float32 targetValue;
        float32 increment;
        int32 steps;
    }

    +

    Structures

    struct State
    {

    +
    float32 currentValue;
    float32 targetValue;
    float32 increment;
    int32 steps;

    }

    Functions

    reset

    @@ -678,20 +703,20 @@

    Specialisation Parameters

    Inputs

    +
  • event positionIn (soul::timeline::Position)
  • +
  • event transportStateIn (soul::timeline::TransportState)
  • +
  • event tempoIn (soul::timeline::Tempo)
  • +
  • event rateHzIn (float32)
  • +
  • event rateTempoIn (float32)
  • +
  • event depthIn (float32)
  • +
  • event shapeIn (float32)
  • +
  • event polarityIn (float32)
  • +
  • event rateModeIn (float32)
  • +
  • event syncIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    @@ -753,8 +778,12 @@

    namespace https://ccrma.stanford.edu/~jos/fp/DC_Blocker.html

    Structures

    -

    Holds a set of filter coefficients.

    struct Coeffs
    {
        CoeffType b1;
        CoeffType a0;
    }

    -

    Holds the filter state.

    struct State
    {
        SampleType[1] x;
        SampleType[1] y;
    }

    +

    Holds a set of filter coefficients.

    struct Coeffs
    {

    +

    }

    +

    Holds the filter state.

    struct State
    {

    +
    + SampleType[1] x;
    SampleType[1] y;

    }

    Functions

    reset

    @@ -767,11 +796,11 @@

    Specialisation Parameters

    Inputs

    +
  • stream in (SampleType)
  • Outputs

    +
  • stream out (SampleType)
  • namespace soul::filters::biquad

    Biquadratic (two-pole-two-zero) IIR filter building block.

    Direct Form I (DFI):

        y[n] = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2] - a1 * y[n-1] - a2 * y[n-2]
    @@ -781,8 +810,13 @@ 

    namespace

    Structures

    -

    Holds a set of filter coefficients.

    struct Coeffs
    {
        CoeffType<3> b;
        CoeffType<3> a;
    }

    -

    Holds the filter state.

    struct State
    {
        SampleType[2] x;
        SampleType[2] y;
    }

    +

    Holds a set of filter coefficients.

    struct Coeffs
    {

    +
    + CoeffType<3> b;

    feed-forward, numerator, zero, FIR coefficients

    + CoeffType<3> a;

    }

    +

    Holds the filter state.

    struct State
    {

    +
    + SampleType[2] x;
    SampleType[2] y;

    }

    Functions

    set

    @@ -830,13 +864,13 @@

    Specialisation Parameters

    Inputs

      -
    • stream in (SampleType)
    • -
    • event frequencyIn (float32)
    • -
    • event modeIn (float32)
    +
  • stream in (SampleType)
  • +
  • event frequencyIn (float32)
  • +
  • event modeIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    float32 frequency = initialFrequency

    @@ -861,21 +895,20 @@

    Variables

    int32 notch = 6

    int32 allpass = 7

    processor soul::filters::rbj_eq::Processor

    -

    Specialisation Parameters

    processor soul::filters::rbj_eq::Processor (int32 initialMode = 0, float32 initialFrequency = defaultFreqHz, float32 initialQuality = defaultQuality, float32 initialGain = defaultGain)

    Inputs

      -
    • stream in (SampleType)
    • -
    • event modeIn (float32)
    • -
    • event frequencyIn (float32)
    • -
    • event qualityIn (float32)
    • -
    • event gainIn (float32)
    +
  • stream in (SampleType)
  • +
  • event modeIn (float32)
  • +
  • event frequencyIn (float32)
  • +
  • event qualityIn (float32)
  • +
  • event gainIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    float32 frequency = initialFrequency

    @@ -893,11 +926,11 @@

    Specialisation Parameters

    Inputs

    +
  • stream in (SampleType)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    numSOS = size (coeffs) / 6

    @@ -924,13 +957,13 @@

    Specialisation Parameters

    Inputs

      -
    • stream in (SampleType)
    • -
    • event frequencyIn (float32)
    • -
    • event modeIn (float32)
    +
  • stream in (SampleType)
  • +
  • event frequencyIn (float32)
  • +
  • event modeIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    float32 frequency = initialFrequency

    @@ -944,7 +977,9 @@

    namespace namespace soul::filters::analytic (int32 numFilters = 6, float32 transitionBandwidthHz = 20.0f)

    Structures

    -

    Holds the filter state.

    struct State
    {
        dual_apf::State[numFilters] apfs;
        SampleType[1] x;
    }

    +

    Holds the filter state.

    struct State
    {

    +
    + dual_apf::State[numFilters] apfs;
    SampleType[1] x;

    }

    Functions

    update

    @@ -955,7 +990,9 @@

    namespace

    Polyphase IIR Designer. Based on HIIR http://ldesoras.free.fr/prod.html#src_hiir

    Structures

    -

    Holds a set of filter coefficients.

    struct Coeffs
    {
        float64[numCoefficients] coeffs;
    }

    struct TransitionParams
    {
        float64 k;
        float64 q;
    }

    +

    Holds a set of filter coefficients.

    struct Coeffs
    {

    +
    float64[numCoefficients] coeffs;

    }

    struct TransitionParams
    {

    +
    float64 k;
    float64 q;

    }

    Functions

    compute

    @@ -970,22 +1007,23 @@

    namespace

    Structures

    -

    Holds the filter state.

    struct State
    {
        SampleType[2] x1;
        SampleType[2] y1;
        SampleType[2] x2;
        SampleType[2] y2;
        CoeffType[2] c;
    }

    +

    Holds the filter state.

    struct State
    {

    +
    + SampleType[2] x1;
    SampleType[2] y1;
    SampleType[2] x2;
    SampleType[2] y2;
    CoeffType[2] c;

    }

    Functions

    process

    SampleType[2] process (State& s,
                           SampleType[2] x)

    processor soul::filters::analytic::Processor

    -

    Inputs

    +
  • stream in (SampleType)
  • Outputs

    +
  • stream realOut (SampleType)
  • +
  • stream imagOut (SampleType)
  • Variables

    @@ -994,8 +1032,11 @@

    namespace

    Complex Resonator filter.

    See https://ccrma.stanford.edu/~jos/smac03maxjos/smac03maxjos.pdf This filter is suitable for modulation

    Structures

    -

    Holds the filter state.

    struct State
    {
        SampleType yReal;
        SampleType yImag;
    }

    -

    Holds a set of filter coefficients.

    struct Coeffs
    {
        complex64 v;
    }

    +

    Holds the filter state.

    struct State
    {

    +
    + SampleType yReal;
    SampleType yImag;

    }

    +

    Holds a set of filter coefficients.

    struct Coeffs
    {

    +
    complex64 v;

    }

    Functions

    update

    @@ -1003,26 +1044,25 @@

    Functions

    process

    SampleType[2] process (State& s,
                           Coeffs& c,
                           SampleType x)

    processor soul::filters::complex_resonator::Processor

    -

    Specialisation Parameters

    processor soul::filters::complex_resonator::Processor (float32 initialFrequency = defaultFreqHz, float32 initialDecay = 1.0f, float32 initialGain = 1.0f)

    Inputs

      -
    • stream in (SampleType)
    • -
    • event frequencyIn (float32)
    • -
    • event decayIn (float32)
    • -
    • event gainIn (float32)
    +
  • stream in (SampleType)
  • +
  • event frequencyIn (float32)
  • +
  • event decayIn (float32)
  • +
  • event gainIn (float32)
  • Outputs

    +
  • stream realOut (SampleType)
  • +
  • stream imagOut (SampleType)
  • Variables

    float32 frequency = initialFrequency

    -

    float32 decay = initialFrequency

    -

    float32 gain = initialFrequency

    +

    float32 decay = initialDecay

    +

    float32 gain = initialGain

    bool recalc = true

    namespace soul::filters::tpt

    This namespace contains a set of "Topology preserving transform" filters.

    @@ -1030,8 +1070,12 @@

    namespace

    "Topology preserving transform" one-pole filter.

    Derived from work by Zavalishin and Pirkle. This filter is suitable for modulation.

    Structures

    -

    Holds a set of filter coefficients.

    struct Coeffs
    {
        CoeffType b;
    }

    -

    Holds the filter state.

    struct State
    {
        SampleType z1;
    }

    +

    Holds a set of filter coefficients.

    struct Coeffs
    {

    +
    + CoeffType b;

    }

    +

    Holds the filter state.

    struct State
    {

    +
    + SampleType z1;

    }

    Functions

    clear

    @@ -1054,19 +1098,18 @@

    Variables

    int32 highpass = 1

    int32 allpass = 2

    processor soul::filters::tpt::onepole::Processor

    -

    Specialisation Parameters

    processor soul::filters::tpt::onepole::Processor (int32 initialMode = 0, float32 initialFrequency = defaultFreqHz)

    Inputs

      -
    • stream in (SampleType)
    • -
    • event frequencyIn (float32)
    • -
    • event modeIn (float32)
    +
  • stream in (SampleType)
  • +
  • event frequencyIn (float32)
  • +
  • event modeIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    float32 frequency = initialFrequency

    @@ -1076,8 +1119,12 @@

    namespace

    "Topology preserving transform" multi-mode state variable filter (SVF).

    Derived from work by Zavalishin and Pirkle. This filter is suitable for modulation.

    Structures

    -

    Holds a set of filter coefficients.

    struct Coeffs
    {
        CoeffType a0;
        CoeffType a;
        CoeffType p;
    }

    -

    Holds the filter state.

    struct State
    {
        SampleType[2] z;
    }

    +

    Holds a set of filter coefficients.

    struct Coeffs
    {

    +

    }

    +

    Holds the filter state.

    struct State
    {

    +
    + SampleType[2] z;

    }

    Functions

    reset

    @@ -1094,25 +1141,24 @@

    Variables

    int32 highpass = 1

    int32 bandpass = 2

    processor soul::filters::tpt::svf::Processor

    -

    Specialisation Parameters

    processor soul::filters::tpt::svf::Processor (float32 initialFrequency = defaultFreqHz, float32 initialQuality = defaultQuality)

    Inputs

      -
    • stream in (SampleType)
    • -
    • event frequencyIn (float32)
    • -
    • event qualityIn (float32)
    +
  • stream in (SampleType)
  • +
  • event frequencyIn (float32)
  • +
  • event qualityIn (float32)
  • Outputs

    +
  • stream lowpassOut (SampleType)
  • +
  • stream bandpassOut (SampleType)
  • +
  • stream highpassOut (SampleType)
  • Variables

    float32 frequency = initialFrequency

    -

    float32 quality = initialFrequency

    +

    float32 quality = initialQuality

    bool recalc = true

    namespace soul::filters::tpt::butterworth

    N-th order Butterworth filter, made by cascading TPT filters. This filter is suitable for modulation

    @@ -1135,13 +1181,13 @@

    Specialisation Parameters

    Inputs

      -
    • stream in (SampleType)
    • -
    • event frequencyIn (float32)
    • -
    • event modeIn (float32)
    +
  • stream in (SampleType)
  • +
  • event frequencyIn (float32)
  • +
  • event modeIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    float32 frequency = initialFrequency

    @@ -1151,22 +1197,23 @@

    namespace

    4th-order Linkwitz-Riley crossover filter, which outputs two bands of audio.

    The channels should sum together to produce a flat response. This filter is suitable for modulation.

    Structures

    -

    Holds the filter state.

    struct State
    {
        SVF::State svf1;
        SVF::State svf2;
    }

    -

    Holds a set of filter coefficients.

    struct Coeffs
    {
        SVF::Coeffs svf1;
        SVF::Coeffs svf2;
    }

    +

    Holds the filter state.

    struct State
    {

    +
    SVF::State svf1;
    SVF::State svf2;

    }

    +

    Holds a set of filter coefficients.

    struct Coeffs
    {

    +
    SVF::Coeffs svf1;
    SVF::Coeffs svf2;

    }

    processor soul::filters::tpt::crossover::Processor

    -

    Specialisation Parameters

    processor soul::filters::tpt::crossover::Processor (float32 initialFrequency = defaultFreqHz)

    Inputs

      -
    • stream in (float32)
    • -
    • event frequencyIn (float32)
    +
  • stream in (float32)
  • +
  • event frequencyIn (float32)
  • Outputs

      -
    • stream lowOut (float32)
    • -
    • stream highOut (float32)
    +
  • stream lowOut (float32)
  • +
  • stream highOut (float32)
  • Functions

    update

    @@ -1179,8 +1226,12 @@

    namespace

    SVF EQ.

    Based on the work of Andy Simper: https://cytomic.com/files/dsp/SvfLinearTrapOptimised2.pdf

    This filter is suitable for modulation.

    Structures

    -

    Holds a set of filter coefficients.

    struct Coeffs
    {
        CoeffType a1;
        CoeffType a2;
        CoeffType a3;
        CoeffType m0;
        CoeffType m1;
        CoeffType m2;
    }

    -

    Holds the filter state.

    struct State
    {
        SampleType ic1eq;
        SampleType ic2eq;
    }

    +

    Holds a set of filter coefficients.

    struct Coeffs
    {

    +

    }

    +

    Holds the filter state.

    struct State
    {

    +
    + SampleType ic1eq;
    SampleType ic2eq;

    }

    Functions

    reset

    @@ -1203,33 +1254,33 @@

    Variables

    int32 allpass = 7

    int32 bell = 8

    processor soul::filters::tpt::simper_eq::Processor

    -

    Specialisation Parameters

    processor soul::filters::tpt::simper_eq::Processor (int32 initialMode = 0, float32 initialFrequency = defaultFreqHz, float32 initialQuality = defaultQuality, float32 initialGain = defaultGain)

    Inputs

      -
    • stream in (SampleType)
    • -
    • event frequencyIn (float32)
    • -
    • event qualityIn (float32)
    • -
    • event gainIn (float32)
    • -
    • event modeIn (float32)
    +
  • stream in (SampleType)
  • +
  • event frequencyIn (float32)
  • +
  • event qualityIn (float32)
  • +
  • event gainIn (float32)
  • +
  • event modeIn (float32)
  • Outputs

    +
  • stream out (SampleType)
  • Variables

    float32 frequency = initialFrequency

    -

    float32 quality = initialFrequency

    -

    float32 gain = initialFrequency

    +

    float32 quality = initialQuality

    +

    float32 gain = initialGain

    int32 mode = initialMode

    bool recalc = true

    MIDI utilities

    In general, the SOUL policy towards MIDI is to avoid it as much as is humanly possible, so most of these helper functions are concerned with converting MIDI messages to soul::note_events types, and then the other libraries use these strongly-typed events to model note actions, rather than dealing with raw MIDI events.

    namespace soul::midi

    Various MIDI-related types and functions.

    Structures

    -

    This type is used to represent a packed short MIDI message. When you create an input event endpoint and would like it to receive MIDI, this is the type that you should use for it.

    struct Message
    {
        int32 midiBytes;
    }

    +

    This type is used to represent a packed short MIDI message. When you create an input event endpoint and would like it to receive MIDI, this is the type that you should use for it.

    struct Message
    {

    +
    int32 midiBytes;

    }

    Functions

    getByte1

    @@ -1243,11 +1294,11 @@

    processor

    Inputs

    +
  • event parseMIDI (Message)
  • Outputs

    +
  • event eventOut (soul::note_events::NoteOn, soul::note_events::NoteOff, soul::note_events::PitchBend, soul::note_events::Pressure, soul::note_events::Slide, soul::note_events::Control)
  • Variables

    int32 MPESlideControllerID = 74

    Frequency-domain utilities

    diff --git a/docs/souldoc_style.css b/docs/souldoc_style.css index a5cb173e..c3082adf 100644 --- a/docs/souldoc_style.css +++ b/docs/souldoc_style.css @@ -100,7 +100,7 @@ h1.file_title { div.module { padding: 0; - margin: 0; + margin: 1em 0 0 0; border-top: 1px solid rgba(0, 0, 0, 0.2); } @@ -117,21 +117,38 @@ h2.module { } .description { + font-family: var(--serif-font); padding-left: 1em; } +.description_member { + font-family: var(--serif-font); + font-style: italic; +} + .module_type { opacity: 50%; font-style: italic; } -.code_block { +.code_block, .struct_members, .struct_top { font-family: var(--code-font); padding: 0; padding-left: 1em; margin: 0 0 1em 0; } +.struct_top { + margin-top: 0; + margin-bottom: 0; +} + +.struct_members { + margin-left: 4em; + margin-bottom: 0; + padding: 0; +} + .primitive_type, .typename_text, .struct_name, .function_name, .parameter_name, .endpoint_name, .endpoint_type, .module_name, .variable_name, .member_name, .keyword { @@ -156,6 +173,12 @@ h2.module { color: rgb(60, 65, 134); } +.endpoint_desc { + font-family: var(--code-font); + padding: 0; + margin: 0 0 1em 0; +} + .endpoint_type { font-style: italic; opacity: 60%; diff --git a/source/modules/soul_core/documentation/soul_HTMLGeneration.cpp b/source/modules/soul_core/documentation/soul_HTMLGeneration.cpp index 1785f7f9..b74cf3ec 100644 --- a/source/modules/soul_core/documentation/soul_HTMLGeneration.cpp +++ b/source/modules/soul_core/documentation/soul_HTMLGeneration.cpp @@ -107,9 +107,7 @@ struct HTMLGenerator .addContent (file.title); if (! file.summary.empty()) - addMarkdownAsHTML (parent.addDiv() - .setID ("summary") - .setClass ("description"), + addMarkdownAsHTML (parent.addDiv().setID ("summary").setClass ("description"), choc::text::splitIntoLines (file.summary, false)); } @@ -212,8 +210,7 @@ struct HTMLGenerator title.addSpan ("module_type").addContent (m.typeOfModule).addContent (" "); title.addSpan ("module_name").addContent (m.fullyQualifiedName); - if (m.comment.valid) - addMarkdownAsHTML (div.addDiv().setClass ("description"), m.comment.lines); + addComment (div, m.comment); printSpecialisationParams (div, m); printEndpoints (div, m); @@ -294,7 +291,7 @@ struct HTMLGenerator void printEndpoint (choc::html::HTMLElement& ul, const DocumentationModel::ModuleDesc& parent, const DocumentationModel::EndpointDesc& e) { - auto& li = ul.addChild ("li").setClass ("code_block"); + auto& li = ul.addChild ("li").setClass ("endpoint_desc"); li.addSpan ("endpoint_type").addContent (e.type); li.addNBSP (1); @@ -328,23 +325,27 @@ struct HTMLGenerator auto& desc = section.addParagraph() .setID (makeTypeID (s.fullName)); - if (s.comment.valid && ! s.comment.getText().empty()) - addMarkdownAsHTML (desc.addDiv().setClass ("description"), s.comment.lines); + addComment (desc, s.comment); - auto& block = desc.addParagraph().setClass ("code_block"); - block.addSpan ("keyword").addContent ("struct "); - block.addSpan ("struct_name").addContent (s.shortName); - block.addLineBreak().addContent ("{").addLineBreak(); + auto& start = desc.addParagraph().setClass ("struct_top"); + start.addSpan ("keyword").addContent ("struct "); + start.addSpan ("struct_name").addContent (s.shortName); + start.addLineBreak().addContent ("{").addLineBreak(); + + auto& memberBlock = desc.addDiv().setClass ("struct_members"); for (auto& member : s.members) { - block.addNBSP (4); - printType (block, module, member.type); - block.addContent (" ").addSpan ("member_name").addContent (member.name); - block.addContent (";").addLineBreak(); + if (member.comment.valid && ! member.comment.getText().empty()) + addMarkdownAsHTML (memberBlock.addDiv().setClass ("description_member"), member.comment.lines); + + printType (memberBlock, module, member.type); + memberBlock.addContent (" ").addSpan ("member_name").addContent (member.name); + memberBlock.addContent (";").addLineBreak(); } - block.addContent ("}"); + desc.addParagraph().setClass ("code_block") + .addContent ("}"); } } } @@ -362,8 +363,7 @@ struct HTMLGenerator div.addParagraph().setClass ("function_name") .addContent (f.bareName); - if (f.comment.valid && ! f.comment.getText().empty()) - addMarkdownAsHTML (div.addDiv().setClass ("description"), f.comment.lines); + addComment (div, f.comment); auto& proto = div.addParagraph().setClass ("code_block"); @@ -413,15 +413,16 @@ struct HTMLGenerator auto& name = div.addParagraph().setClass ("code_block"); - if (v.isExternal) name.addSpan ("typename_text").addContent ("external"); + if (v.isExternal) + name.addSpan ("typename_text").addContent ("external"); + printType (name, m, v.type); name.addContent (" ").addSpan ("variable_name").addContent (v.name); if (! v.initialiser.empty()) name.addContent (" = " + v.initialiser); - if (v.comment.valid) - addMarkdownAsHTML (div.addDiv().setClass ("description"), v.comment.lines); + addComment (div, v.comment); } } } @@ -627,6 +628,12 @@ struct HTMLGenerator appendSpansForContent (getParent().addParagraph(), trimmed); } } + + static void addComment (choc::html::HTMLElement& parent, const SourceCodeOperations::Comment& comment) + { + if (comment.valid && ! comment.getText().empty()) + addMarkdownAsHTML (parent.addDiv().setClass ("description"), comment.lines); + } }; std::string generateHTMLDocumentation (soul::CompileMessageList& errors, diff --git a/source/soul_library/soul_library_noise.soul b/source/soul_library/soul_library_noise.soul index 0871d984..2bea6326 100644 --- a/source/soul_library/soul_library_noise.soul +++ b/source/soul_library/soul_library_noise.soul @@ -34,10 +34,10 @@ namespace soul::random struct RandomNumberState { /** The current seed. - Top tip: when generating a seed, you might want to use the processor.id constant, + Top tip: when generating a seed, you might want to use the `processor.id` constant, to make sure that each instance of a processor has a differently-seeded RNG. If you want the RNG to be different each time the program runs, you could also throw the - processor.session constant into the mix too. + `processor.session` constant into the mix too. */ int64 seed; }