C# Class kOS.Sound.NoteValue

Inheritance: kOS.Safe.Serialization.SerializableStructure
Show file Open project: KSP-KOS/KOS Class Usage Examples

Public Methods

Method Description
Dump ( ) : Dump
LetterToHertz ( string letterString ) : float

A utility function to return the frequency in Hertz given a note expressed as in "letter" form as a string.

LoadDump ( Dump dump ) : void
NoteValue ( ) : System
NoteValue ( float freq, float vol, float keyDownLength, float duration ) : System
NoteValue ( float freq, float endFreq, float vol, float keyDownLength, float duration ) : System
NoteValue ( string letterNote, float vol, float keyDownLength, float duration ) : System
NoteValue ( string letterNote, string endLetterNote, float vol, float keyDownLength, float duration ) : System
ToString ( ) : string

Private Methods

Method Description
InitializeSuffixes ( ) : void

Method Details

Dump() public method

public Dump ( ) : Dump
return Dump

LetterToHertz() public static method

A utility function to return the frequency in Hertz given a note expressed as in "letter" form as a string.
public static LetterToHertz ( string letterString ) : float
letterString string The format of the string must be as follows:
/// Starts with a Letter from A to G for the note.
/// Next, optionaly a "#" or "b" for sharp or flat.
/// Next, mandatorily, a digit of 0-8 for the octave.
/// Examples: "C4" = middle C. "C#4" = middle c sharp. "Cb4" = middle c flat. C5 = high C. C3 = low C.
/// octaves follow the weird musical convention of starting at C instead of at A. (i.e. C4 is one higher than B3, not B4)
return float

LoadDump() public method

public LoadDump ( Dump dump ) : void
dump Dump
return void

NoteValue() public method

public NoteValue ( ) : System
return System

NoteValue() public method

public NoteValue ( float freq, float vol, float keyDownLength, float duration ) : System
freq float
vol float
keyDownLength float
duration float
return System

NoteValue() public method

public NoteValue ( float freq, float endFreq, float vol, float keyDownLength, float duration ) : System
freq float
endFreq float
vol float
keyDownLength float
duration float
return System

NoteValue() public method

public NoteValue ( string letterNote, float vol, float keyDownLength, float duration ) : System
letterNote string
vol float
keyDownLength float
duration float
return System

NoteValue() public method

public NoteValue ( string letterNote, string endLetterNote, float vol, float keyDownLength, float duration ) : System
letterNote string
endLetterNote string
vol float
keyDownLength float
duration float
return System

ToString() public method

public ToString ( ) : string
return string