SetharesModel class

Implementation of Sethares' model from "Tuning, Timbre, Spectrum, Scale" (2005).

$$d(f_1,f_2,a_1,a_2) = min(a_1,a_2)[e^{-b_1s(f_2-f_1)}+e^{-b_2s(f_2-f_1)}]$$

where

$$s = \frac{x}{s_1f_1 + s_2}$$

for

$$f_1 < f_2$$

Base classes

class CBRModel
Base class for implementing dissonance models based on summed critical-band roughness.

Constructors, destructors, conversion operators

SetharesModel ()
Creates a SetharesModel object.
~SetharesModel ()
Destructor.

Public functions

auto calculateRoughness (float firstFreq, float firstAmp, float secondFreq, float secondAmp) -> float override
Calculates the roughness between two partials.
auto cloneModel () -> std::unique_ptr<DissonanceModel> override
For dynamic allocation via std::unique_ptr in DissonanceCalc.

Protected variables

const float maxDiss
This is the point of maximum dissonance.
const float plcInterp1
These values are used to allow a single functional form to interpolate beween the various P&L curves of different frequencies by sliding, stretching/compressing the curve so that its max dissonance occurse at dstar.
const float plcInterp2
These values are used to allow a single functional form to interpolate beween the various P&L curves of different frequencies by sliding, stretching/compressing the curve so that its max dissonance occurse at dstar.
const float plCurveRate1
Theses values determine the rates at which the function rises and falls and are based on a gradient minimisation of the squared error between Plomp and Levelt's averaged data and the curve.
const float plCurveRate2
Theses values determine the rates at which the function rises and falls and are based on a gradient minimisation of the squared error between Plomp and Levelt's averaged data and the curve.
const float plcFit1
These parameters have values to fit the experimental data of Plomp and Levelt.
const float plcFit2
These parameters have values to fit the experimental data of Plomp and Levelt.
float curveInterp
This stores the result of $s = \frac{x}{s_1f_1 + s_2}$ .
float freqDiff
This stores the difference in frequency between the partials.

Variable documentation

const float SetharesModel::maxDiss protected

This is the point of maximum dissonance.

The value is derived from a model of the Plom Levelt dissonance curves for all frequencies. Denoted by $$x$$ .

const float SetharesModel::plcInterp1 protected

These values are used to allow a single functional form to interpolate beween the various P&L curves of different frequencies by sliding, stretching/compressing the curve so that its max dissonance occurse at dstar.

A least-square-fit was made to determine the values. Denoted by $$s_1$$ .

const float SetharesModel::plcInterp2 protected

These values are used to allow a single functional form to interpolate beween the various P&L curves of different frequencies by sliding, stretching/compressing the curve so that its max dissonance occurse at dstar.

A least-square-fit was made to determine the values. Denoted by $$s_2$$ .

const float SetharesModel::plCurveRate1 protected

Theses values determine the rates at which the function rises and falls and are based on a gradient minimisation of the squared error between Plomp and Levelt's averaged data and the curve.

Denoted by $$b_1$$ .

const float SetharesModel::plCurveRate2 protected

Theses values determine the rates at which the function rises and falls and are based on a gradient minimisation of the squared error between Plomp and Levelt's averaged data and the curve.

Denoted by $$b_2$$ .