music.inversely_proportional

music.inversely_proportional(numerator=1000.0, offset=0.0)[source]

A bond that falls with the frequency: numerator / f + offset.

The article’s second example, “a tremolo depth inversely proportional to pitch”.

Parameters:
numeratorscalar

Divided by the frequency.

offsetscalar

Added afterwards.

Returns:
callable()

A function of one frequency, for Bonds.

Raises:
ValueError

When called with a frequency of zero.

Parameters:
Return type:

Callable[[float], float]

Examples

>>> depth = inversely_proportional(1000)
>>> depth(200), depth(500)
(5.0, 2.0)