Skip to content

Python エンジンミキシング API ​

RealtimeEngine のミキサー側として、トラックレーン、センド、グループバス、インサート・パン・フェーダーを備えたストリップ、エンジンへオーディオを流し込むクリップページプロバイダを扱います。構築、トランスポート、クリップ、キャプチャ、レンダーは Python リアルタイムエンジン API にあります。ガイドは リアルタイムエンジン です。

トラックレーン、バス、ストリップ ​

トラックは id、マスターストリップは "master" で指します。resolve_*_automation_id は、未知のトラック、バス、インサート、出力先、パラメータ、またはリアルタイム安全でないものに対して SonareValueError を送出します。ストリップ、バス、レーンの呼び出しはコントロールスレッドの呼び出しで、オーディオ側はブロックの境界で取り込みます。

python
MAX_TRACK_LANES: int

# Key a strip insert from a track lane or (master only) a bus; ``None`` removes the
def set_strip_sidechain(
    self,
    ref: StripRef,
    insert_index: int,
    source: SidechainSource | None,
) -> None: ...

# Report whether :meth:`set_strip_sidechain` would accept the binding, without changing
def can_set_strip_sidechain(
    self,
    ref: StripRef,
    insert_index: int,
    source: SidechainSource,
) -> SidechainCheck: ...

# Key a bus-strip insert from a track lane or another bus; ``None`` removes the
def set_bus_sidechain(
    self,
    bus_id: int,
    insert_index: int,
    source: SidechainSource | None,
) -> None: ...

# Report whether :meth:`set_bus_sidechain` would accept the binding, without changing
def can_set_bus_sidechain(
    self,
    bus_id: int,
    insert_index: int,
    source: SidechainSource,
) -> SidechainCheck: ...

# Declare the mixer track lanes in order; more than :data:`MAX_TRACK_LANES` lanes raises
def set_track_lanes(self, lanes: Sequence[Mapping[str, object]]) -> None: ...

# Replace one track lane's sends (``bus_id``, ``level_db``, ``enabled``, ``send_timing``);
def set_track_sends(self, track_id: int, sends: Sequence[Mapping[str, object]]) -> None: ...

# Route a track lane to a bus; ``None`` returns it to the master mix and 0 is refused.
def set_track_output_bus(self, track_id: int, bus_id: int | None) -> None: ...

# Declare the group buses from their mappings.
def set_track_buses(self, buses: Sequence[Mapping[str, object]]) -> None: ...

# Replace a bus's strip with ``settings``; the bus comes from :meth:`set_track_buses`.
def set_bus_strip(self, bus_id: int, settings: MixSceneBusInput) -> None: ...

# Replace a strip with ``settings``: a track id or ``"master"``.
def set_strip(self, ref: StripRef, settings: MixSceneStripInput) -> None: ...

# Replace one equalizer band of a strip in realtime; a track id or ``"master"``.
def set_strip_eq_band(self, ref: StripRef, band_index: int, band: EqBandInput) -> None: ...

# Replace one equalizer band of a bus strip in realtime.
def set_bus_eq_band(self, bus_id: int, band_index: int, band: EqBandInput) -> None: ...

# Bypass or engage one strip insert; ``reset_on_bypass`` clears its state when
def set_strip_insert_bypassed(
    self,
    ref: StripRef,
    insert_index: int,
    bypassed: bool,
    reset_on_bypass: bool = False,
) -> None: ...

# Bus counterpart of :meth:`set_strip_insert_bypassed`.
def set_bus_insert_bypassed(
    self,
    bus_id: int,
    insert_index: int,
    bypassed: bool,
    reset_on_bypass: bool = False,
) -> None: ...

# Realtime change of one strip insert parameter, addressed by name.
def set_strip_insert_param(
    self,
    ref: StripRef,
    insert_index: int,
    name: str,
    value: float,
) -> None: ...

# Bus counterpart of :meth:`set_strip_insert_param`.
def set_bus_insert_param(self, bus_id: int, insert_index: int, name: str, value: float) -> None: ...

# Apply a strip insert parameter immediately on the calling thread; returns False for an
def apply_strip_insert_param_now(
    self,
    ref: StripRef,
    insert_index: int,
    name: str,
    value: float,
) -> bool: ...

# Bus counterpart of :meth:`apply_strip_insert_param_now`.
def apply_bus_insert_param_now(
    self,
    bus_id: int,
    insert_index: int,
    name: str,
    value: float,
) -> bool: ...

# Restore a retained strip insert value exactly, without a ramp; raises if the strip,
def restore_strip_insert_param(
    self,
    ref: StripRef,
    insert_index: int,
    name: str,
    value: float,
) -> None: ...

# Bus counterpart of :meth:`restore_strip_insert_param`.
def restore_bus_insert_param(
    self,
    bus_id: int,
    insert_index: int,
    name: str,
    value: float,
) -> None: ...

# Forget the remembered manual insert-parameter values of a strip and discard its queued
def clear_strip_insert_parameter_bases(self, ref: StripRef) -> None: ...

# Forget the remembered manual insert-parameter values of a bus strip.
def clear_bus_insert_parameter_bases(self, bus_id: int) -> None: ...

# Set a track strip's pan position (-1.0 hard left .. 1.0 hard right); the master strip
def set_strip_pan(self, ref: StripRef, pan: float) -> None: ...

# Set a track strip's pan law (a :data:`PanLaw` token); the master strip is refused.
def set_strip_pan_law(self, ref: StripRef, pan_law: PanLaw) -> None: ...

# Set a track strip's pan mode (a :data:`PanMode` token); the master strip is refused.
def set_strip_pan_mode(self, ref: StripRef, pan_mode: PanMode) -> None: ...

# Set a track strip's dual-pan positions; the master strip is refused.
def set_strip_dual_pan(self, ref: StripRef, left_pan: float, right_pan: float) -> None: ...

# Set a track strip's surround pan position; a non-finite or out-of-range value raises
def set_strip_surround_pan(
    self,
    ref: StripRef,
    *,
    azimuth: float = ...,
    divergence: float = ...,
    lfe: float = ...,
) -> None: ...

# Set a track strip's alignment delay in samples; the master strip is refused.
def set_strip_channel_delay_samples(self, ref: StripRef, delay_samples: int) -> None: ...

# Set a bus strip's pan position (-1.0 hard left .. 1.0 hard right).
def set_bus_pan(self, bus_id: int, pan: float) -> None: ...

# Set a bus strip's pan law (a :data:`PanLaw` token).
def set_bus_pan_law(self, bus_id: int, pan_law: PanLaw) -> None: ...

# Set a bus strip's pan mode (a :data:`PanMode` token).
def set_bus_pan_mode(self, bus_id: int, pan_mode: PanMode) -> None: ...

# Set a bus strip's dual-pan positions for the left and right channels.
def set_bus_dual_pan(self, bus_id: int, left_pan: float, right_pan: float) -> None: ...

# Set a strip's fader in dB in realtime through its reserved automation id.
def set_strip_fader_db(
    self,
    ref: StripRef,
    fader_db: float,
    render_frame: int | None = None,
) -> None: ...

# Set a bus's gain in dB in realtime through its reserved automation id.
def set_bus_gain_db(self, bus_id: int, gain_db: float, render_frame: int | None = None) -> None: ...

# Resolve a strip insert parameter to its automation id; an unknown strip, insert or
def resolve_strip_insert_automation_id(
    self,
    ref: StripRef,
    insert_index: int,
    param_name: str,
) -> int: ...

# Resolve a bus-strip insert parameter to its automation id; an unknown bus, insert or
def resolve_bus_insert_automation_id(
    self,
    bus_id: int,
    insert_index: int,
    param_name: str,
) -> int: ...

# Resolve a strip's ``"faderDb"``, ``"pan"`` or, for the master only, ``"width"`` to its
def resolve_strip_automation_id(
    self,
    ref: StripRef,
    kind: Literal['faderDb', 'pan', 'width'],
) -> int: ...

# Resolve a bus's ``"faderDb"`` to its automation id; an unknown bus or name raises
def resolve_bus_automation_id(self, bus_id: int, param_name: str) -> int: ...

# Return an insert parameter's immutable construction value.
def insert_parameter_constructed_value(self, param_id: int) -> float: ...

def set_track_solo_mute(
    self,
    track_id: int,
    *,
    solo: bool,
    mute: bool,
    render_frame: int | None = None,
) -> None: ...

def set_track_monitor_mode(
    self,
    track_id: int,
    mode: EngineTrackMonitorMode,
    render_frame: int | None = None,
) -> None: ...

クリップページプロバイダ ​

ClipPageProvider はリアルタイムのクリップストリーミング向けに、ホストが供給するページ単位の音声ソースです。FileClipPageProvider はファイルを裏付けにした float32 PCM のページ供給元です。

python
# Host-supplied paged audio source for realtime clip streaming.
class ClipPageProvider:
    def __init__(self, *, num_channels: int, num_samples: int, page_frames: int) -> None: ...
    # Release the native provider; idempotent.
    def close(self) -> None: ...
    # Return the provider for use as a context manager.
    def __enter__(self) -> ClipPageProvider: ...
    # Close the provider on leaving the ``with`` block.
    def __exit__(self, *_exc: object) -> None: ...
    # Make page ``page_index`` resident from one float sequence per channel.
    def supply(self, page_index: int, channels: PlanarChannels) -> None: ...
    # Mark page ``page_index`` as not resident.
    def clear(self, page_index: int) -> None: ...

# File-backed float32 PCM page supplier for realtime clip streaming.
class FileClipPageProvider(ClipPageProvider):
    data_offset_bytes: int
    num_channels: int
    num_samples: int
    page_frames: int
    def __init__(
        self,
        path: str | os.PathLike[str],
        *,
        num_channels: int,
        num_samples: int,
        page_frames: int,
        data_offset_bytes: int = 0,
    ) -> None: ...
    # Close the file and release the native provider; idempotent.
    def close(self) -> None: ...
    # Read page ``page_index`` from the file and supply it.
    def supply_page(self, page_index: int) -> bool: ...
    # Supply the page containing ``request.sample``; same result as :meth:`supply_page`.
    def supply_request(self, request: ClipPageRequest) -> bool: ...
    # Return the provider for use as a context manager.
    def __enter__(self) -> ClipPageProvider: ...
    # Close the provider on leaving the ``with`` block.
    def __exit__(self, *_exc: object) -> None: ...
    # Make page ``page_index`` resident from one float sequence per channel.
    def supply(self, page_index: int, channels: PlanarChannels) -> None: ...
    # Mark page ``page_index`` as not resident.
    def clear(self, page_index: int) -> None: ...