Playback.Theme
Methods
GetThemeID
-
Return Type:
int
-
Description: Retrieves the ID of the current theme.
-
Example:
int themeID = Playback.Theme.GetThemeID();
IsLoaded
-
Return Type:
bool
-
Description: Checks if a theme is currently loaded.
-
Example:
bool loaded = Playback.Theme.IsLoaded();
Play
-
Return Type:
void
-
Description: Begins the playback of the current theme. If a track is already loaded in the playlist, it copies the pre-roll settings to the theme before starting.
-
Example:
Playback.Theme.Play();
Reset
-
Return Type:
void
-
Description: Resets the current theme track.
-
Example:
Playback.Theme.Reset();
Stop
-
Return Type:
void
-
Description: Stops the playback of the current theme.
-
Example:
Playback.Theme.Stop();
State
-
Return Type:
int
-
Description: Retrieves the current state of the theme playback.
-
Example:
int currentState = Playback.Theme.State();
GetControls
-
Return Type:
Dictionary<string, (float, string)>
-
Parameters: bool istheme = true, Engine engine = null
-
Description: Retrieves a list of control names associated with the theme or track, depending on the value of
istheme
. -
Example:
var (controlName, (controlValue, controlType)) = Playback.Theme.GetControls();
GetTriggers
-
Return Type:
List<string>
-
Parameters: bool istheme = true, Engine engine = null
-
Description: Retrieves a list of trigger names associated with the theme or track. Triggers are recognized by starting with the prefix "t_".
-
Example:
List<string> triggers = Playback.Theme.GetTriggers();
CurrentBeat
-
Return Type:
float
-
Description: Gets the current beat value of the theme.
-
Example:
float beat = Playback.Theme.CurrentBeat();
TempoBpm
-
Return Type:
float
-
Description: Retrieves the tempo (in BPM) of the current theme.
-
Example:
float bpm = Playback.Theme.TempoBpm();
SetControl
-
Return Type:
void
-
Parameters: string controlName, float value = 1f, bool istheme = true
-
Description: Sets the value of a specified control for the theme. This is the most important method as the control macros can be set up to fully control all of the music.
-
Example:
Playback.Theme.SetControl("MyControl", 0.8f);
GetControl
-
Return Type:
double
-
Parameters: string controlName, bool istheme = true
-
Description: Retrieves the value of a specified control for the theme or track.
-
Example:
double controlValue = Playback.Theme.GetControl("MyControl");
GetNumParts
-
Return Type:
int
-
Description: Retrieves the number of parts in theme.
-
Example:
int numOfParts = Playback.Theme.GetNumParts();
GetCurrentPart
-
Return Type:
int
-
Description: Retrieves the current part in theme.
-
Example:
int part = Playback.Theme.GetCurrentPart();
GetPartName
-
Return Type:
string
-
Parameters: int part
-
Description: Retrieves the name of the part with the correlated id.
-
Example:
string partName = Playback.Theme.GetPartName(0);
GetPartOffset
-
Return Type:
float
-
Parameters:
int
part -
Description: Retrieves the offset of the part with the correlated id.
-
Example:
float offset = Playback.Theme.GetPartOffset(0);
GetPartDuration
-
Return Type:
float
-
Parameters:
int
part -
Description: Retrieves the duration of the part with the correlated id.
-
Example:
float duration = Playback.Theme.GetPartDuration();
GetNumBars
-
Return Type:
int
-
Description: Retrieves the numbers of bars in the loaded theme.
-
Example:
int numBars = Playback.Theme.GetNumBars();
GetCurrentBar
-
Return Type:
int
-
Description: Retrieves the current bars in the loaded theme.
-
Example:
int currentBar = Playback.Theme.GetCurrentBar();
GetBarOffset
-
Return Type:
float
-
Parameters:
int
bar -
Description: Retrieves the offset of the bar with the id of variable 'bar' in the loaded theme.
-
Example:
int currentBar = Playback.Theme.GetCurrentBar();
float offset = Playback.Theme.GetBarOffset(currentBar);
GetBarDuration
-
Return Type:
float
-
Parameters:
int
bar -
Description: Retrieves the duration of the bar with the id of variable 'bar' in the loaded theme.
-
Example:
int currentBar = Playback.Theme.GetCurrentBar();
float duration = Playback.Theme.GetBarDuration(currentBar);
TriggerStinger
-
Return Type:
void
-
Overloads:
TriggerStinger(string stingerName, MusicSystem.Quant quant = MusicSystem.Quant.Half)
TriggerStinger(string stingerName, float value) -
Description:
-
Example:
Playback.Theme.TriggerStinger("neutral, medium");
InstrumentOverride
-
Return Type:
void
-
Parameters: int instrument, float pulseRate, float pitch, float velocity, bool active, int legato
-
Description: Directly overrides and controls an instrument of the Interactive Theme. Can be used to give players direct influence over the soundtrack. PulseRate is how often a note trigger happens (1/1 at 0, 128th at 1). Pitch is a relative pitch position in the instruments defined range. Velocity is loudness/energy, Active sets the override to active or not. Legato defines if movement is needed to trigger new note.
-
Example:
Playback.Theme.InstrumentOverride(0, 0.5f, 0.6f, 1f, true, 1);
GetOverridableInstruments
-
Return Type:
List<string>
-
Description: Returns all overridable instrument from the loaded theme.
-
Example:
var instruments = Playback.Theme.GetOverridableInstruments();
Properties
Volume
-
Type:
float
-
Description: Get or set the volume (gain) for the theme.
-
Example:
Playback.Theme.Volume = 0.5f;
float volume = Playback.Theme.Volume;