Range

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph cluster_builtins { graph [label=builtins]; node [color=1]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_supriya.synthdefs" { graph [label="supriya.synthdefs"]; node [color=2]; "supriya.synthdefs.Range.Range" [URL="../api/supriya/synthdefs/Range.html#supriya.synthdefs.Range.Range", color=black, fontcolor=white, label=Range, target=_top]; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=3]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/synthdefs/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.synthdefs.Range.Range"; }

class supriya.synthdefs.Range.Range(minimum=None, maximum=None)[source]

A range.

>>> supriya.synthdefs.Range(-1., 1.)
Range(
    maximum=1.0,
    minimum=-1.0,
    )
>>> supriya.synthdefs.Range(minimum=0.)
Range(
    maximum=inf,
    minimum=0.0,
    )
>>> supriya.synthdefs.Range()
Range(
    maximum=inf,
    minimum=-inf,
    )
>>> supriya.synthdefs.Range((0.1, 0.9))
Range(
    maximum=0.9,
    minimum=0.1,
    )
>>> supriya.synthdefs.Range(supriya.synthdefs.Range(-3, 3))
Range(
    maximum=3.0,
    minimum=-3.0,
    )

Attributes Summary

maximum
minimum
scale Scales value from input_range to output_range.
width

Special methods

(SupriyaObject).__repr__()

Return repr(self).


Class & static methods

static scale(value, input_range, output_range, exponent=1.0)[source]

Scales value from input_range to output_range.

Curve value exponentially by exponent.

>>> input_range = supriya.synthdefs.Range(0., 10.)
>>> output_range = supriya.synthdefs.Range(-2.5, 2.5)
>>> supriya.synthdefs.Range.scale(0., input_range, output_range)
-2.5
>>> supriya.synthdefs.Range.scale(5., input_range, output_range)
0.0
>>> supriya.synthdefs.Range.scale(5., input_range, output_range, 2.)
-1.25
>>> supriya.synthdefs.Range.scale(5., input_range, output_range, 0.5)
1.0355...

Returns float.


Read-only properties

maximum
minimum
width