unreal.MusicClockComponent¶
- class unreal.MusicClockComponent(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
ActorComponentMusic Clock Component
C++ Source:
Plugin: Harmonix
Module: HarmonixMetasound
File: MusicClockComponent.h
Editor Properties: (see get_editor_property/set_editor_property)
asset_user_data(Array[AssetUserData]): [Read-Write] Array of user data stored with the componentasset_user_data_editor_only(Array[AssetUserData]): [Read-Write] Array of user data stored with the componentaudio_render_music_time_discontinuity_event(MusicTimeDiscontinuityEvent): [Read-Write]auto_activate(bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.bar_event(BarEvent): [Read-Write]beat_event(BeatEvent): [Read-Write]can_ever_affect_navigation(bool): [Read-Write] Whether this component can potentially influence navigationcomponent_tags(Array[Name]): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.current_bar_duration_sec(float): [Read-Write]current_beat_duration_sec(float): [Read-Write]current_player_experienced_song_pos(MidiSongPos): [Read-Write]current_raw_audio_render_song_pos(MidiSongPos): [Read-Write]current_smoothed_audio_render_song_pos(MidiSongPos): [Read-Write] Don’t let C++ access these directly! They are a blueprint convenience and only work because they specify getter functions! NOTE These only have getters because a future refactor will get rid of them. -jwf + jake burga.current_video_render_song_pos(MidiSongPos): [Read-Write]default_clock_advance_rate(float): [Read-Write] Default Clock Advance Rate used for Wall clock with no tempo mapNOT THE CURRENT RUNNING TEMPO
default_tempo(float): [Read-Write] Default Tempo (BPM) used for Wall clock with no tempo mapNOT THE CURRENT RUNNING TEMPO
default_time_signature_denom(int32): [Read-Write] Default Time Signature (Denominator) used for the Wall clock with no tempo mapNOT THE CURRENT RUNNING TIME SIG
default_time_signature_num(int32): [Read-Write] Default Time Signature (Numerator) used for the Wall Clock with no tempo mapNOT THE CURRENT RUNNING TIME SIG
drive_method(MusicClockDriveMethod): [Read-Write]editable_when_inherited(bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor classis_editor_only(bool): [Read-Write] If true, the component will be excluded from non-editor buildsmetasound_output_name(Name): [Read-Write]metasounds_audio_component(AudioComponent): [Read-Only]music_clock_connected_event(MusicClockConnected): [Read-Write]music_clock_disconnected_event(MusicClockDisconnected): [Read-Write]on_component_activated(ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reseton_component_deactivated(ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivatedplay_state_event(PlayStateEvent): [Read-Write]player_experience_music_time_discontinuity_event(MusicTimeDiscontinuityEvent): [Read-Write]primary_component_tick(ActorComponentTickFunction): [Read-Write] Main tick function for the Componentreplicate_using_registered_sub_object_list(bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.replicates(bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!run_past_music_end(bool): [Read-Write]section_event(SectionEvent): [Read-Write]tempo_map(MidiFile): [Read-Write]timebase_for_bar_and_beat_events(CalibratedMusicTimebase): [Read-Write]video_render_music_time_discontinuity_event(MusicTimeDiscontinuityEvent): [Read-Write]
- property audio_render_music_time_discontinuity_event: MusicTimeDiscontinuityEvent¶
[Read-Write]
- Type:
- connect_to_metasound_on_audio_component(audio_component) bool¶
Connect to Metasound on Audio Component
- Parameters:
audio_component (AudioComponent)
- Return type:
- connect_to_wall_clock_for_midi(tempo_map) None¶
Connect to Wall Clock for Midi
- Parameters:
tempo_map (MidiFile)
- classmethod create_metasound_driven_music_clock(world_context_object, audio_component, metasound_ouput_pin_name='MIDI Clock', start=True) MusicClockComponent¶
Create Metasound Driven Music Clock
- Parameters:
world_context_object (Object)
audio_component (AudioComponent)
metasound_ouput_pin_name (Name)
start (bool)
- Return type:
- classmethod create_music_clock_component(world_context_object: Object, audio_component: AudioComponent, metasound_ouput_pin_name: Name = 'MIDI Clock', start: bool = True) MusicClockComponent¶
deprecated: ‘create_music_clock_component’ was renamed to ‘create_metasound_driven_music_clock’.
- classmethod create_wall_clock_driven_music_clock(world_context_object, with_tempo_map, start=True) MusicClockComponent¶
Create Wall Clock Driven Music Clock
- Parameters:
- Return type:
- property current_player_experienced_song_pos: MidiSongPos¶
[Read-Only]
- Type:
- property current_raw_audio_render_song_pos: MidiSongPos¶
[Read-Only]
- Type:
- property current_smoothed_audio_render_song_pos: MidiSongPos¶
[Read-Only] Don’t let C++ access these directly! They are a blueprint convenience and only work because they specify getter functions! NOTE These only have getters because a future refactor will get rid of them. -jwf + jake burga.
- Type:
- property current_song_pos: MidiSongPos¶
‘current_song_pos’ was renamed to ‘current_smoothed_audio_render_song_pos’.
- Type:
deprecated
- property current_video_render_song_pos: MidiSongPos¶
[Read-Only]
- Type:
- property default_clock_advance_rate: float¶
[Read-Write] Default Clock Advance Rate used for Wall clock with no tempo map
NOT THE CURRENT RUNNING TEMPO
- Type:
(float)
- property default_tempo: float¶
[Read-Write] Default Tempo (BPM) used for Wall clock with no tempo map
NOT THE CURRENT RUNNING TEMPO
- Type:
(float)
- property default_time_signature_denom: int¶
[Read-Write] Default Time Signature (Denominator) used for the Wall clock with no tempo map
NOT THE CURRENT RUNNING TIME SIG
- Type:
(int32)
- property default_time_signature_num: int¶
[Read-Write] Default Time Signature (Numerator) used for the Wall Clock with no tempo map
NOT THE CURRENT RUNNING TIME SIG
- Type:
(int32)
- get_bars_including_count_in(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Returns the fractional total bars from the beginning of the authored music content. NOTE: INCLUDES time for count-in and pickup bars.
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_beats_including_count_in(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Returns the fractional total beats from the beginning of the authored music content. NOTE: INCLUDES time for count-in and pickup bars.
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_current_bar_duration_seconds() float¶
Get The Current Bar Duration in Seconds Based on the current tempo, advance rate and time signature
0 if the clock is stopped
- Return type:
- get_current_beat_duration_seconds() float¶
Get The Current Beat Duration in Seconds Based on the current tempo, advance rate and time signature
0 if the clock is stopped
- Return type:
- get_current_clock_advance_rate() float¶
Get The Current Clock advance rate
0 if the clock is stopped
- Return type:
- get_current_player_experienced_song_pos() MidiSongPos¶
Get Current Player Experienced Song Pos
- Return type:
- get_current_raw_audio_render_song_pos() MidiSongPos¶
Get Current Raw Audio Render Song Pos
- Return type:
- get_current_section_index(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) int32¶
Returns the index of the current section for the provided time base. [0, Num-1]
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
int32
- get_current_section_length_ms(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Returns the length of the current section in milliseconds
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_current_section_name(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) str¶
Returns the name of the section that we’re currently in (intro, chorus, outro)
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_current_section_start_ms(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Returns the start time of the current section in milliseconds
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_current_smoothed_audio_render_song_pos() MidiSongPos¶
Getter functions for the Blueprint properties exposed above…
- Return type:
- get_current_tempo() float¶
Get The Current Tempo (BPM) of the runnig clock 0 if the clock is stopped
- Return type:
- get_current_time_signature() -> (out_numerator=int32, out_denominator=int32)¶
Get The Current Time Signature
0 if the clock is stopped
- Returns:
out_numerator (int32):
out_denominator (int32):
- Return type:
tuple
- get_current_timestamp(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) MusicTimestamp¶
- Returns the “classic” musical timestamp in the form Bar (int) & Beat (float). In this form…
Bar 1, Beat 1.0 is the “beginning of the song” AFTER count-in/pickups
Bar 0, Beat 1.0 would be one bar BEFORE the “beginning of the song”… eg. a bar of count-in or pickup.
While Bar can be positive or negative, Beat is always >= 1.0 and is read as “beat in the bar”. Again… ‘1’ based!
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_current_video_render_song_pos() MidiSongPos¶
Get Current Video Render Song Pos
- Return type:
- get_delta_bar(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Get Delta Bar
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_delta_beat(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Get Delta Beat
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_distance_from_current_bar(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Gets a value expressed in bars between 0-1 that indicates how much progress we made towards the current bar to the next one.
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_distance_from_current_beat(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Gets a value expressed in beats between 0-1 that indicates how much progress we made in the current beat
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_distance_to_closest_bar(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Gets value expressed in bars between 0-1 that indicates how close we are to the closest bar (current bar or next bar).
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_distance_to_closest_beat(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Gets a value expressed in beats between 0-1 that indicates how close we are to the closest beat (current beat or next beat).
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_distance_to_next_bar(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Gets a value expressed in bars between 0-1 that indicates how close we are to the next bar.
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_distance_to_next_beat(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Gets a value expressed in beats between 0-1 that indicates how close we are to the next beat.
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_num_sections() int32¶
Get Num Sections
- Return type:
int32
- get_previous_player_experienced_song_pos() MidiSongPos¶
Get Previous Player Experienced Song Pos
- Return type:
- get_previous_smoothed_audio_render_song_pos() MidiSongPos¶
Get Previous Smoothed Audio Render Song Pos
- Return type:
- get_previous_song_pos(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) MidiSongPos¶
Get Previous Song Pos
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_previous_video_render_song_pos() MidiSongPos¶
Get Previous Video Render Song Pos
- Return type:
- get_seconds_from_bar_one(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Time from Bar 1 Beat 1. The classic “start of the song”. NOTE: DOES NOT INCLUDE time for count-in and pickup bars.
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_seconds_including_count_in(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Time from the beginning of the authored music content. NOTE: INCLUDES time for count-in and pickup bars.
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_song_pos(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) MidiSongPos¶
Get Song Pos
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_song_remaining_ms(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Returns the remaining time until the end of the MIDI in milliseconds based on the timestamp corresponding to the passed Timebase
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- get_song_remaining_time(timebase: CalibratedMusicTimebase = Ellipsis) float¶
deprecated: ‘get_song_remaining_time’ was renamed to ‘get_song_remaining_ms’.
- get_song_sections() Array[SongSection]¶
Get Song Sections
- Return type:
- get_state() MusicClockState¶
Get State
- Return type:
- looped_this_frame(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) bool¶
Returns true if there was a seek in the specified timebase
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- measure_span_progress(span, timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) float¶
Measure Span Progress
- Parameters:
span (MusicalTimeSpan)
timebase (CalibratedMusicTimebase)
- Return type:
- property metasounds_audio_component: AudioComponent¶
[Read-Only]
- Type:
- property music_clock_connected_event: MusicClockConnected¶
[Read-Write]
- Type:
- property music_clock_disconnected_event: MusicClockDisconnected¶
[Read-Write]
- Type:
- property play_state_event: PlayStateEvent¶
[Read-Write]
- Type:
- property player_experience_music_time_discontinuity_event: MusicTimeDiscontinuityEvent¶
[Read-Write]
- Type:
- property section_event: SectionEvent¶
[Read-Write]
- Type:
- seeked_this_frame(timebase=CalibratedMusicTimebase.VIDEO_RENDER_TIME) bool¶
Returns true if there was a seek in the specified timebase
- Parameters:
timebase (CalibratedMusicTimebase)
- Return type:
- set_run_past_music_end(run_past_music_end) None¶
Set Run Past Music End
- Parameters:
run_past_music_end (bool)
- set_tempo_map_for_wall_clock(tempo_map) None¶
Set the tempo map when running off of wall clock
- Parameters:
tempo_map (MidiFile)
- property timebase_for_bar_and_beat_events: CalibratedMusicTimebase¶
[Read-Write]
- Type:
- property video_render_music_time_discontinuity_event: MusicTimeDiscontinuityEvent¶
[Read-Write]
- Type: