wiki.sine.space | sinespace

Difference between revisions of "Scripting/SAudioReactiveBase"

From wiki.sine.space
Jump to: navigation, search
Line 1: Line 1:
 +
The SAudioReactiveBase is a base class that can be used to access any of the Audio Reactive components base properties. For example: If you have an Audio Reactive Material component the base properties are accessed using SAudioReactiveBase class and the material specific properties will be accessed using the SAudioReactiveMaterial class.
 +
 
=Properties=
 
=Properties=
  
{{ScriptFunction|bool|Enabled|{get; set;}|Returns true if Enabled.|5=  
+
{{ScriptFunction|bool|Enabled|{get; set;}|Whether the Audio Reactive component is enabled or not.|5= <pre>Space.Host.ExecutingObject.</pre>|6=<pre>--clicking this object will Enable/Disable it's Audio Reactive Base component
local Object = Space.Scene.Find("Audio Source")<br>
+
Space.Log(Object.AudioReactive.Enabled)<br>
+
''-- print true.''|6=<pre>--clicking this object will Enable/Disable it's Audio Reactive Base component
+
 
thisGameObject = Space.Host.ExecutingObject
 
thisGameObject = Space.Host.ExecutingObject
 
component = thisGameObject.AudioReactive
 
component = thisGameObject.AudioReactive
Line 18: Line 17:
 
}}
 
}}
  
{{ScriptFunction|int|BandMin|{get; set;}|Returns BandMin value.|5=  
+
{{ScriptFunction|int|BandMin|{get; set;}|The Band Min property of an Audio Reactive component.|5=<pre>Space.Host.ExecutingObject.AudioReactive.BandMin= 1</pre>|6=<pre>--the below script will make a slider change an Audio Reactive Component's Band Min property
local Object = Space.Scene.Find("Audio Source")<br>
+
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
Space.Log(Object.AudioReactive.BandMin)
+
 
 +
slider = Space.Host.GetReference("theslider").UISlider
 +
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
 +
 
 +
 
 +
OVC = function()
 +
ar.BandMin = (slider.Value * 12.0) -- from 0 to 12
 +
end
 +
 
 +
slider.OnValueChanged(OVC)</pre>
 
}}
 
}}
  
{{ScriptFunction|int|BandMax|{get; set;}|Returns BandMax value.|5=  
+
{{ScriptFunction|int|BandMax|{get; set;}|The Band Max property of an Audio Reactive component.|5=<pre>Space.Host.ExecutingObject.AudioReactive.BandMax= 11</pre>|6=<pre>--the below script will make a slider change an Audio Reactive Component's Band Max property
local Object = Space.Scene.Find("Audio Source")<br>
+
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
Space.Log(Object.AudioReactive.BandMax)
+
 
 +
slider = Space.Host.GetReference("theslider").UISlider
 +
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
 +
 
 +
 
 +
OVC = function()
 +
ar.BandMax = (slider.Value * 12.0) -- from 0 to 12
 +
end
 +
 
 +
slider.OnValueChanged(OVC)</pre>
 
}}
 
}}
  
  
{{ScriptFunction|int|BPMWindow|{get; set;}|Returns BPMWindow value.|5=  
+
{{ScriptFunction|int|BPMWindow|{get; set;}|The BPM Window property of an Audio Reactive component.|5=<pre>Space.Host.ExecutingObject.AudioReactive.BPMWindow= 5</pre>|6=<pre>--the below script will make a slider change an Audio Reactive Component's BPM Window property
local Object = Space.Scene.Find("Audio Source")<br>
+
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
Space.Log(Object.AudioReactive.BPMWindow)
+
 
 +
slider = Space.Host.GetReference("theslider").UISlider
 +
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
 +
 
 +
 
 +
OVC = function()
 +
ar.BPMWindow = (slider.Value * 50) - 50  -- from -50 to 50
 +
end
 +
 
 +
slider.OnValueChanged(OVC)</pre>
 
}}
 
}}
  
{{ScriptFunction|int|LimitIncrease|{get; set;}|Returns LimitIncrease value.|5=  
+
{{ScriptFunction|int|LimitIncrease|{get; set;}|The Limit Increase property of an Audio Reactive component.|5=<pre>Space.Host.ExecutingObject.AudioReactive.LimitIncrease= 1</pre>|6=<pre>--the below script will make a slider change an Audio Reactive Component's Limit Increase property.
local Object = Space.Scene.Find("Audio Source")<br>
+
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
Space.Log(Object.AudioReactive.LimitIncrease)
+
 
 +
slider = Space.Host.GetReference("theslider").UISlider
 +
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
 +
 
 +
 
 +
OVC = function()
 +
ar.LimitIncrease= (slider.Value * 50) - 50  -- from -50 to 50
 +
end
 +
 
 +
slider.OnValueChanged(OVC)</pre>
 
}}
 
}}
  
{{ScriptFunction|int|LimitDecrease|{get; set;}|Returns LimitDecrease value.|5=  
+
{{ScriptFunction|int|LimitDecrease|{get; set;}|The Limit Decrease property of an Audio Reactive component.|5=<pre>Space.Host.ExecutingObject.AudioReactive.LimitDecrease= 3</pre>|6=<pre>--the below script will make a slider change an Audio Reactive Component's Limit Decrease property.
local Object = Space.Scene.Find("Audio Source")<br>
+
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
Space.Log(Object.AudioReactive.LimitDecrease)
+
 
 +
slider = Space.Host.GetReference("theslider").UISlider
 +
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
 +
 
 +
 
 +
OVC = function()
 +
ar.LimitDecrease= (slider.Value * 50) - 50  -- from -50 to 50
 +
end
 +
 
 +
slider.OnValueChanged(OVC)</pre>
 
}}
 
}}
  
{{ScriptFunction|int|MinValue|{get; set;}|Returns MinValue value.|5=  
+
{{ScriptFunction|int|MinValue|{get; set;}|The Min Value property of an Audio Reactive component.|5=<pre>Space.Host.ExecutingObject.AudioReactive.MinValue= 1</pre>|6=<pre>--the below script will make a slider change an Audio Reactive Component's Min Value property.
local Object = Space.Scene.Find("Audio Source")<br>
+
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
Space.Log(Object.AudioReactive.MinValue)
+
 
 +
slider = Space.Host.GetReference("theslider").UISlider
 +
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
 +
 
 +
 
 +
OVC = function()
 +
ar.MinValue= (slider.Value * 50) - 50  -- from -50 to 50
 +
end
 +
 
 +
slider.OnValueChanged(OVC)</pre>
 
}}
 
}}
  
{{ScriptFunction|int|MaxValue|{get; set;}|Returns MaxValue value.|5=  
+
{{ScriptFunction|int|MaxValue|{get; set;}|The Max Value property of an Audio Reactive component.|5=<pre>Space.Host.ExecutingObject.AudioReactive.MaxValue= 3</pre>|6=<pre>--the below script will make a slider change an Audio Reactive Component's Max Value property.
local Object = Space.Scene.Find("Audio Source")<br>
+
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
Space.Log(Object.AudioReactive.MaxValue)
+
 
 +
slider = Space.Host.GetReference("theslider").UISlider
 +
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
 +
 
 +
 
 +
OVC = function()
 +
ar.MaxValue= (slider.Value * 50) - 50  -- from -50 to 50
 +
end
 +
 
 +
slider.OnValueChanged(OVC)</pre>
 
}}
 
}}
  
{{ScriptFunction|int|Mode|{get; set;}|Returns Mode value.|5=  
+
{{ScriptFunction|int|Mode|{get; set;}|The Mode property of an Audio Reactive component. Band is 0, and BMP is 1.|5=<pre>Space.Host.ExecutingObject.AudioReactive.Mode= 1</pre>|6=<pre>--clicking this object will toggle between it's two Audio Reactive Modes
local Object = Space.Scene.Find("Audio Source")<br>
+
 
Space.Log(Object.AudioReactive.Mode)
+
thisGameObject = Space.Host.ExecutingObject
 +
component = thisGameObject.AudioReactive
 +
 
 +
 
 +
OnClick = function()
 +
  if component.Mode == 0 then
 +
    component.Mode = 1
 +
  else
 +
    component.Mode = 0
 +
  end
 +
end
 +
 
 +
 
 +
thisGameObject.AddClickable()
 +
thisGameObject.Clickable.OnClick(OnClick)</pre>
 
}}
 
}}
  
 
{{Scripting Navbox}}
 
{{Scripting Navbox}}

Revision as of 08:02, 23 January 2022

The SAudioReactiveBase is a base class that can be used to access any of the Audio Reactive components base properties. For example: If you have an Audio Reactive Material component the base properties are accessed using SAudioReactiveBase class and the material specific properties will be accessed using the SAudioReactiveMaterial class.

Properties

Enabled

bool Enabled {get; set;}

Whether the Audio Reactive component is enabled or not.

Space.Host.ExecutingObject.


--clicking this object will Enable/Disable it's Audio Reactive Base component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactive


OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

BandMin

int BandMin {get; set;}

The Band Min property of an Audio Reactive component.

Space.Host.ExecutingObject.AudioReactive.BandMin= 1


--the below script will make a slider change an Audio Reactive Component's Band Min property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.BandMin = (slider.Value * 12.0) -- from 0 to 12
end

slider.OnValueChanged(OVC)

BandMax

int BandMax {get; set;}

The Band Max property of an Audio Reactive component.

Space.Host.ExecutingObject.AudioReactive.BandMax= 11


--the below script will make a slider change an Audio Reactive Component's Band Max property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.BandMax = (slider.Value * 12.0) -- from 0 to 12
end

slider.OnValueChanged(OVC)


BPMWindow

int BPMWindow {get; set;}

The BPM Window property of an Audio Reactive component.

Space.Host.ExecutingObject.AudioReactive.BPMWindow= 5


--the below script will make a slider change an Audio Reactive Component's BPM Window property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.BPMWindow = (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)

LimitIncrease

int LimitIncrease {get; set;}

The Limit Increase property of an Audio Reactive component.

Space.Host.ExecutingObject.AudioReactive.LimitIncrease= 1


--the below script will make a slider change an Audio Reactive Component's Limit Increase property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.LimitIncrease= (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)

LimitDecrease

int LimitDecrease {get; set;}

The Limit Decrease property of an Audio Reactive component.

Space.Host.ExecutingObject.AudioReactive.LimitDecrease= 3


--the below script will make a slider change an Audio Reactive Component's Limit Decrease property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.LimitDecrease= (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)

MinValue

int MinValue {get; set;}

The Min Value property of an Audio Reactive component.

Space.Host.ExecutingObject.AudioReactive.MinValue= 1


--the below script will make a slider change an Audio Reactive Component's Min Value property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.MinValue= (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)

MaxValue

int MaxValue {get; set;}

The Max Value property of an Audio Reactive component.

Space.Host.ExecutingObject.AudioReactive.MaxValue= 3


--the below script will make a slider change an Audio Reactive Component's Max Value property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]

slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive


OVC = function()
ar.MaxValue= (slider.Value * 50) - 50   -- from -50 to 50
end

slider.OnValueChanged(OVC)

Mode

int Mode {get; set;}

The Mode property of an Audio Reactive component. Band is 0, and BMP is 1.

Space.Host.ExecutingObject.AudioReactive.Mode= 1


--clicking this object will toggle between it's two Audio Reactive Modes

thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactive


OnClick = function()
  if component.Mode == 0 then
    component.Mode = 1
  else
    component.Mode = 0
  end
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)