sessions

class Session(input_bus_channel_count=None, output_bus_channel_count=None, input_=None, name: Optional[str] = None, padding: Optional[float] = None)

Bases: object

A non-realtime session.

>>> import supriya.nonrealtime
>>> session = supriya.nonrealtime.Session()
>>> import supriya.synthdefs
>>> import supriya.ugens
>>> builder = supriya.synthdefs.SynthDefBuilder(frequency=440)
>>> with builder:
...     out = supriya.ugens.Out.ar(
...         source=supriya.ugens.SinOsc.ar(
...             frequency=builder["frequency"],
...         )
...     )
... 
>>> synthdef = builder.build()
>>> with session.at(0):
...     synth_a = session.add_synth(duration=10, synthdef=synthdef)
...     synth_b = session.add_synth(duration=15, synthdef=synthdef)
... 
>>> with session.at(5):
...     synth_c = session.add_synth(duration=10, synthdef=synthdef)
... 
>>> result = session.to_lists(duration=20)
>>> result == [
...     [
...         0.0,
...         [
...             ["/d_recv", bytearray(synthdef.compile(use_anonymous_name=True))],
...             ["/s_new", "9c4eb4778dc0faf39459fa8a5cd45c19", 1000, 0, 0],
...             ["/s_new", "9c4eb4778dc0faf39459fa8a5cd45c19", 1001, 0, 0],
...         ],
...     ],
...     [5.0, [["/s_new", "9c4eb4778dc0faf39459fa8a5cd45c19", 1002, 0, 0]]],
...     [10.0, [["/n_free", 1000]]],
...     [15.0, [["/n_free", 1001, 1002]]],
...     [20.0, [[0]]],
... ]
True
__graph__()

Graphs session.

TODO: Get graphviz to respect node order or reimplement as pure SVG.

>>> session = supriya.Session()
>>> with session.at(0):
...     group = session.add_group()
...     synth_a = group.add_synth(duration=15)
... 
>>> with session.at(5):
...     synth_b = group.add_synth(duration=15)
...     synth_c = group.add_synth(duration=5)
... 
>>> with session.at(7.5):
...     synth_d = synth_b.add_synth(duration=5, add_action="ADD_BEFORE")
... 
>>> with session.at(11):
...     _ = synth_d.move_node(synth_a, add_action="ADD_AFTER")
... 
>>> supriya.graph(session)  
__render__(output_file_path: Optional[os.PathLike] = None, render_directory_path: Optional[os.PathLike] = None, **kwargs) pathlib.Path
__session__() supriya.nonrealtime.sessions.Session
property active_moments: List[supriya.nonrealtime.states.Moment]
add_buffer(channel_count: Optional[int] = None, duration: Optional[float] = None, frame_count: Optional[int] = None, starting_frame: Optional[int] = None, file_path: Optional[os.PathLike] = None, offset: Optional[float] = None) supriya.nonrealtime.buffers.Buffer
add_buffer_group(buffer_count: int = 1, channel_count: Optional[int] = None, duration: Optional[float] = None, frame_count: Optional[int] = None, offset: Optional[float] = None) supriya.nonrealtime.buffers.BufferGroup
add_bus(calculation_rate: Optional[Union[supriya.enums.CalculationRate, SupportsInt, str]] = CalculationRate.CONTROL) supriya.nonrealtime.buses.Bus
add_bus_group(bus_count: int = 1, calculation_rate: Optional[Union[supriya.enums.CalculationRate, SupportsInt, str]] = CalculationRate.CONTROL) supriya.nonrealtime.buses.BusGroup
add_group(add_action: Optional[Union[supriya.enums.AddAction, SupportsInt, str]] = None, duration: Optional[float] = None, offset=None) supriya.nonrealtime.nodes.Group
add_synth(add_action: Optional[Union[supriya.enums.AddAction, SupportsInt, str]] = None, duration: Optional[float] = None, synthdef: Optional[supriya.synthdefs.synthdefs.SynthDef] = None, offset: Optional[float] = None, **synth_kwargs) supriya.nonrealtime.nodes.Synth
at(offset, propagate=True) supriya.nonrealtime.states.Moment
property audio_input_bus_group: supriya.nonrealtime.buses.AudioInputBusGroup
property audio_output_bus_group: supriya.nonrealtime.buses.AudioOutputBusGroup
property buffers
property buffers_by_session_id
property buses
property buses_by_session_id
cue_soundfile(file_path: os.PathLike, channel_count: Optional[int] = None, duration: Optional[float] = None, frame_count: int = 32768, starting_frame: int = 0, offset: Optional[float] = None) supriya.nonrealtime.buffers.Buffer
property duration: float
property input_
property input_bus_channel_count: int
static is_session_like(expr) bool
move_node(node: supriya.nonrealtime.nodes.Node, add_action: Optional[Union[supriya.enums.AddAction, SupportsInt, str]] = None, offset: Optional[float] = None) None
property name: Optional[str]
property nodes
property nodes_by_session_id
property offsets: List[float]
property options: supriya.scsynth.Options
property output_bus_channel_count: int
property padding: Optional[float]
rebuild_transitions() None
render(output_file_path: Optional[os.PathLike] = None, debug=None, duration: Optional[float] = None, header_format=HeaderFormat.AIFF, input_file_path=None, render_directory_path=None, sample_format=SampleFormat.INT24, sample_rate=44100, print_transcript=None, transcript_prefix=None, **kwargs) Tuple[int, pathlib.Path]
property root_node: supriya.nonrealtime.nodes.RootNode
set_rand_seed(rand_id: int = 0, rand_seed: int = 0, offset: Optional[float] = None) supriya.nonrealtime.nodes.Synth
property states
to_lists(duration: Optional[float] = None, header_format=HeaderFormat.AIFF, sample_format=SampleFormat.INT24, sample_rate: int = 44100) List
to_osc_bundles(duration: Optional[float] = None, header_format=HeaderFormat.AIFF, sample_format=SampleFormat.INT24, sample_rate: int = 44100) List[supriya.osc.messages.OscBundle]
to_strings(include_controls=False, include_timespans=False) str
property transcript