StatusResponse

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.commands" { graph [label="supriya.commands"]; node [color=2]; "supriya.commands.Response.Response" [URL="../api/supriya/commands/Response.html#supriya.commands.Response.Response", label=Response, target=_top]; "supriya.commands.StatusResponse.StatusResponse" [URL="../api/supriya/commands/StatusResponse.html#supriya.commands.StatusResponse.StatusResponse", color=black, fontcolor=white, label="Status\nResponse", target=_top]; "supriya.commands.Response.Response" -> "supriya.commands.StatusResponse.StatusResponse"; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=3]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/commands/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; "supriya.system.SupriyaValueObject.SupriyaValueObject" [URL="../api/supriya/commands/../system/SupriyaValueObject.html#supriya.system.SupriyaValueObject.SupriyaValueObject", label="Supriya\nValue\nObject", target=_top]; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.system.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaValueObject.SupriyaValueObject" -> "supriya.commands.Response.Response"; }

class supriya.commands.StatusResponse.StatusResponse(actual_sample_rate=None, average_cpu_usage=None, group_count=None, osc_message=None, peak_cpu_usage=None, synth_count=None, synthdef_count=None, target_sample_rate=None, ugen_count=None)[source]

Attributes Summary

actual_sample_rate
average_cpu_usage
from_osc_message Create response from OSC message.
group_count
peak_cpu_usage
synth_count
synthdef_count
target_sample_rate
to_dict Convert StatusResponse to JSON-serializable dictionay.
ugen_count

Special methods

(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)

Return self==value.

(SupriyaValueObject).__hash__()

Return hash(self).

(SupriyaObject).__repr__()

Return repr(self).


Methods

to_dict()[source]

Convert StatusResponse to JSON-serializable dictionay.

>>> status_response = supriya.commands.StatusResponse(
...     actual_sample_rate=44100.05692801021,
...     average_cpu_usage=8.151924133300781,
...     group_count=6,
...     peak_cpu_usage=15.151398658752441,
...     synth_count=19,
...     synthdef_count=42,
...     target_sample_rate=44100.0,
...     ugen_count=685
...     )
>>> import json
>>> result = status_response.to_dict()
>>> result = json.dumps(
...     result,
...     indent=4,
...     separators=(',', ': '),
...     sort_keys=True,
...     )
>>> print(result)
{
    "server_status": {
        "actual_sample_rate": 44100.05692801021,
        "average_cpu_usage": 8.151924133300781,
        "group_count": 6,
        "peak_cpu_usage": 15.151398658752441,
        "synth_count": 19,
        "synthdef_count": 42,
        "target_sample_rate": 44100.0,
        "ugen_count": 685
    }
}

Class & static methods

classmethod from_osc_message(osc_message)[source]

Create response from OSC message.

>>> message = supriya.osc.OscMessage(
...     '/status.reply', 1, 0, 0, 2, 4,
...     0.040679048746824265, 0.15118031203746796,
...     44100.0, 44100.00077873274,
...     )
>>> supriya.commands.StatusResponse.from_osc_message(message)
StatusResponse(
    actual_sample_rate=44100.00077873274,
    average_cpu_usage=0.040679048746824265,
    group_count=2,
    peak_cpu_usage=0.15118031203746796,
    synth_count=0,
    synthdef_count=4,
    target_sample_rate=44100.0,
    ugen_count=0,
    )

Read-only properties

actual_sample_rate
average_cpu_usage
group_count
(Response).osc_message
peak_cpu_usage
synth_count
synthdef_count
target_sample_rate
ugen_count