Class Song
The song created in the music composer. Consisting of patterns and tracks.
Inheritance
System.Object
UnityEngine.Object
UnityEngine.ScriptableObject
Song
Syntax
public class Song : EditorSampleSetAssetScriptableObject
Properties
Bpm
Get/sets the number of beats per minute.
Declaration
public int Bpm { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
NotesPerBeat
Get/sets the number of notes each beat consists of.
Declaration
public int NotesPerBeat { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
NotesPerSecond
Gets the number of notes that are played each second, if this song is being played.
Declaration
public float NotesPerSecond { get; }
Property Value
| Type |
Description |
| System.Single |
|
Patterns
Declaration
public IList<Pattern> Patterns { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IList<Pattern> |
|
Tracks
Declaration
public IList<Track> Tracks { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IList<Track> |
|
Methods
AddPattern(Pattern)
Declaration
public void AddPattern(Pattern pattern)
Parameters
| Type |
Name |
Description |
| Pattern |
pattern |
|
AddTrack(Track)
Declaration
public void AddTrack(Track track)
Parameters
| Type |
Name |
Description |
| Track |
track |
|
Create(String)
Declaration
public static Song Create(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
GenerateAudioClip()
Declaration
public void GenerateAudioClip()
GetPatternByName(String)
Declaration
public Pattern GetPatternByName(string patternName)
Parameters
| Type |
Name |
Description |
| System.String |
patternName |
|
Returns
GetPatternNames()
Declaration
public string[] GetPatternNames()
Returns
| Type |
Description |
| System.String[] |
|
GetTrackNames()
Declaration
public string[] GetTrackNames()
Returns
| Type |
Description |
| System.String[] |
|
NoteToSampleCount(Single)
Returns the number of samples that are required to contain the number of notes given, based on the song's
notes per bar and bpm.
Declaration
public int NoteToSampleCount(float noteCount)
Parameters
| Type |
Name |
Description |
| System.Single |
noteCount |
The number of notes.
|
Returns
| Type |
Description |
| System.Int32 |
The sample count.
|
Regenerate()
Regenerates patterns, tracks and the sample set.
Declaration
RemovePattern(Pattern)
Declaration
public void RemovePattern(Pattern pattern)
Parameters
| Type |
Name |
Description |
| Pattern |
pattern |
|
RemoveTrack(Track)
Declaration
public void RemoveTrack(Track track)
Parameters
| Type |
Name |
Description |
| Track |
track |
|
RemoveTrackAt(Int32)
Declaration
public void RemoveTrackAt(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
StopTracks()
Stop playing all the tracks
Declaration
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
UnityEngine.Object.ToString()