unreal.RuntimeMusicSource

class unreal.RuntimeMusicSource(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

A music source that combines an ITimeSource (providing raw time in seconds) with an ISongMapEvaluator (providing time-to-musical-position mapping).

This is the “simple” music source for non-Metasound use cases: wall clock, animation-driven, media-driven, etc. The specific time behavior is determined by which ITimeSource implementation is provided.

Transport controls delegate to the ITimeSource if it supports them (e.g., FWorldTimeSourceController has Start/Stop/Pause/Continue).

C++ Source:

  • Plugin: Harmonix

  • Module: HarmonixMetasound

  • File: RuntimeMusicSource.h

clear_loop_region() None

Clear the loop region, disabling looping.

continue_() None

Continue

is_playing() bool

Whether the source is currently producing musical time.

Return type:

bool

is_preparing() bool

Whether the source intends to run but is waiting for data (e.g., Metasound not yet connected).

Return type:

bool

is_stopped() bool

Whether the source is stopped (not producing time, position at zero).

Return type:

bool

pause() None

Pause

seek(timestamp) None

Seek to a musical position. For RuntimeMusicSource: converts the timestamp to seconds via song maps and seeks the time source. For MetasoundMusicSource: requires Metasound interface support (future work).

Parameters:

timestamp (MusicTimestamp)

set_loop_region_by_bars(start_bar, num_bars) None

Set a loop region by musical time.

Parameters:
  • start_bar (int32) – The bar to start looping at (1-based, where Bar 1 = start of song).

  • num_bars (int32) – Number of bars in the loop. Pass 0 to disable looping.

set_speed(speed) None

Set the playback speed multiplier (1.0 = normal speed). For RuntimeMusicSource: sets the speed on the underlying ITimeSource. For MetasoundMusicSource: requires Metasound interface support (future work).

Parameters:

speed (float)

set_tempo(bpm) None

Set the tempo in BPM. For RuntimeMusicSource: modifies the underlying song maps directly. For MetasoundMusicSource: requires Metasound interface support (future work).

Parameters:

bpm (float)

set_time_signature(numerator, denominator) None

Set the time signature. For RuntimeMusicSource: modifies the underlying song maps directly. For MetasoundMusicSource: requires Metasound interface support (future work).

Parameters:
  • numerator (int32)

  • denominator (int32)

start() None

—- Transport Controls —- The source owns playback. Consumers (UMusicClock) are read-only views.

stop() None

Stop