Skip to content
AutumnSky1010 edited this page Dec 10, 2022 · 6 revisions

Class Note

Definition

Namespace: SoundMaker.Sounds.Score
Assembly: SoundMaker.dll

The note.

public class Note : BasicSoundComponentBase

Inheritance

Object -> BasicSoundComponentBase -> Note

Implements

Constructors

Note(Scale, uint, LengthType, bool)

Declaration

public Note(Scale scale, uint scaleNumber, LengthType length, bool isDotted = false) : base(length, isDotted)

Parameters

Type Desctiption
Scale Scale of the note.
uint Sound height number. (C"4" is middle C.)
LengthType Length (ex. "quarter" note)
bool Is note/rest dotted.

Exceptions

Exception Desctiption
ArgumentException Scale and scale number must be only the range of sound that the piano can produce.

Note(Scale, uint, LengthType, bool)

Easiness constructor(use case: construct Tie).Scale is "A4".
Declaration

public Note(LengthType length, bool isDotted = false) : base(length, isDotted)

Parameters

Type Desctiption
LengthType Length (ex. "quarter" note)
bool Is note/rest dotted.

Properties

Hertz

Declaration

public double Hertz { get; } = 0d;

Property Value

Type Desctiption
double Hertz of the sound.

Scale

Declaration

public Scale Scale { get; }

Property Value

Type Desctiption
Scale Scale of the note.

ScaleNumber

Declaration

public int ScaleNumber { get; }

Property Value

Type Desctiption
int Sound height number. (C"4" is middle C.)

Volume

Declaration

public int Volume { get; set;}

Property Value

Type Desctiption
int Volume of the sound.(0 ~ 100) Default volume is 100;

Methods

GenerateWave(SoundFormat, int, int, WaveTypeBase)

Declaration

public abstract ushort[] GenerateWave(SoundFormat format, int tempo, int length, WaveTypeBase waveType);

Parameters

Type Desctiption
SoundFormat The format of the sound.
int Quarter note/rest per minute.
int Length of the array.
WaveTypeBase Type of wave.

Returns

Type Desctiption
ushort[] The array of wave data.

Exceptions

Exception Desctiption
ArgumentOutOfRangeException Tempo must be non-negative and greater than 0.
ArgumentOutOfRangeException Length must be non-negative.

GenerateWave(SoundFormat, int, WaveTypeBase)

Declaration

public abstract ushort[] GenerateWave(SoundFormat format, int tempo, WaveTypeBase waveType);

Parameters

Type Desctiption
SoundFormat The format of the sound.
int Quarter note/rest per minute.
WaveTypeBase Type of wave.

Returns

Type Desctiption
ushort[] The array of wave data.

Exceptions

Exception Desctiption
ArgumentOutOfRangeException Tempo must be non-negative and greater than 0.
Clone this wiki locally