Navigation
API > API/Plugins > API/Plugins/HarmonixMetasound
Interface for objects that produce musical time.
An IMusicSource is the owner of a music playback stream. It provides:
- Transport controls (Start/Stop/Pause/Continue)
- Current musical position (FMidiSongPos)
- Song map access for time<->beat conversions
- Discontinuity detection (loop/seek)
A single IMusicSource produces a single time stream. Calibrated time offsets (experienced, video render, etc.) are handled externally by UOffsetMusicSource feeding into a UMusicClock.
| Name | IMusicSource |
| Type | class |
| Header File | /Engine/Plugins/Runtime/Harmonix/Source/HarmonixMetasound/Public/HarmonixMetasound/MusicSource/MusicSource.h |
| Include Path | #include "HarmonixMetasound/MusicSource/MusicSource.h" |
Syntax
class IMusicSource
Derived Classes
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Continue() |
HarmonixMetasound/MusicSource/MusicSource.h |
|
|
float GetCurrentClockAdvanceRate() |
The current playback speed multiplier. | HarmonixMetasound/MusicSource/MusicSource.h | |
const ISongMapEvaluator * GetCurrentSongMapEvaluator() |
The song maps used to convert between time and musical position. | HarmonixMetasound/MusicSource/MusicSource.h | |
const FMidiSongPos & GetCurrentSongPos() |
The current musical position, updated once per frame via Update(). | HarmonixMetasound/MusicSource/MusicSource.h | |
FString GetDisplayName() |
HarmonixMetasound/MusicSource/MusicSource.h | ||
Harmonix::ESourceEvent GetLatestSourceEvent() |
Get the most recent source event for this frame (Start, Advance, Stop, Pause, Continue, Seek, Loop). | HarmonixMetasound/MusicSource/MusicSource.h | |
float GetLoopLengthMs() |
Length of the loop region in milliseconds. Only valid if IsLooping() is true. | HarmonixMetasound/MusicSource/MusicSource.h | |
float GetLoopStartMs() |
Start of the loop region in milliseconds. Only valid if IsLooping() is true. | HarmonixMetasound/MusicSource/MusicSource.h | |
const FMidiSongPos & GetPreviousSongPos() |
The previous frame's musical position. | HarmonixMetasound/MusicSource/MusicSource.h | |
Harmonix::ESourceState GetSourceState() |
Get the current transport state of the source (Stopped, Preparing, Paused, Running). | HarmonixMetasound/MusicSource/MusicSource.h | |
bool IsLooping() |
Whether this source is currently looping. | HarmonixMetasound/MusicSource/MusicSource.h | |
bool LoopedThisFrame() |
Whether the source crossed a loop boundary this frame. | HarmonixMetasound/MusicSource/MusicSource.h | |
void Pause() |
HarmonixMetasound/MusicSource/MusicSource.h |
|
|
bool SeekedThisFrame() |
Whether the source performed a non-contiguous time jump (seek) this frame. | HarmonixMetasound/MusicSource/MusicSource.h | |
void Start () |
- Transport Controls - The source owns playback. | HarmonixMetasound/MusicSource/MusicSource.h |
|
void Stop() |
HarmonixMetasound/MusicSource/MusicSource.h |
|
|
TOptional< FVector > TryGetAudioSourceLocation() |
Get the world-space location of the audio source, if available. | HarmonixMetasound/MusicSource/MusicSource.h | |
void Update () |
Called once per frame by the update subsystem. | HarmonixMetasound/MusicSource/MusicSource.h |
Public Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsPlaying() |
Whether the source is currently producing musical time. | HarmonixMetasound/MusicSource/MusicSource.h |
|
virtual bool IsPreparing() |
Whether the source intends to run but is waiting for data (e.g., Metasound not yet connected). | HarmonixMetasound/MusicSource/MusicSource.h |
|
virtual bool IsStopped() |
Whether the source is stopped (not producing time, position at zero). | HarmonixMetasound/MusicSource/MusicSource.h |
|
virtual void Seek
(
const FMusicTimestamp& Timestamp |
Seek to a musical position. | HarmonixMetasound/MusicSource/MusicSource.h |
|
virtual void SetSpeed
(
float Speed |
Set the playback speed multiplier (1.0 = normal speed). | HarmonixMetasound/MusicSource/MusicSource.h |
|
virtual void SetTempo
(
float BPM |
Set the tempo in BPM. | HarmonixMetasound/MusicSource/MusicSource.h |
|
virtual void SetTimeSignature
(
int32 Numerator, |
Set the time signature. | HarmonixMetasound/MusicSource/MusicSource.h |
|