Show / Hide Table of Contents

Class Song

The song created in the music composer. Consisting of patterns and tracks.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.ScriptableObject
EditorSampleSetAssetScriptableObject
Song
Inherited Members
EditorSampleSetAssetScriptableObject.editorSampleSetAsset
EditorSampleSetAssetScriptableObject.OnCreate(SampleSetAssetType)
EditorSampleSetAssetScriptableObject.SampleSetAsset
EditorSampleSetAssetScriptableObject.IsPlaying
EditorSampleSetAssetScriptableObject.IsLooping
EditorSampleSetAssetScriptableObject.PlaybackPosition
EditorSampleSetAssetScriptableObject.Volume
EditorSampleSetAssetScriptableObject.AudioClip
EditorSampleSetAssetScriptableObject.Play(Boolean)
EditorSampleSetAssetScriptableObject.Stop()
Namespace: InsaneScatterbrain.RetroKit.Editor
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
Type Description
Song

GenerateAudioClip()

Declaration
public void GenerateAudioClip()

GetPatternByName(String)

Declaration
public Pattern GetPatternByName(string patternName)
Parameters
Type Name Description
System.String patternName
Returns
Type Description
Pattern

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
public void Regenerate()

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
public void StopTracks()

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
UnityEngine.Object.ToString()
Back to top Generated by DocFX