Class Scale
Represents a musical scale.
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class Scale
Constructors
Scale(IEnumerable<Interval>, NoteName)
Initializes a new instance of the
Scale with the
specified intervals and root note.
Declaration
public Scale(IEnumerable<Interval> intervals, NoteName rootNote)
Parameters
Type |
Name |
Description |
IEnumerable<Interval> |
intervals |
Intervals between adjacent notes of the scale. |
NoteName |
rootNote |
Root note (tonic) of the scale. |
Exceptions
Properties
Intervals
Gets intervals between adjacent notes of the current
Scale.
Declaration
public IEnumerable<Interval> Intervals { get; }
Property Value
RootNote
Gets root note (tonic) of the current
Scale.
Declaration
public NoteName RootNote { get; }
Property Value
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
The object to compare with the current object. |
Returns
Type |
Description |
bool |
true if the specified object is equal to the current object; otherwise, false . |
Overrides
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
int |
A hash code for the current object. |
Overrides
Parse(string)
Converts the string representation of a musical scale to its
Scale equivalent.
Declaration
public static Scale Parse(string input)
Parameters
Type |
Name |
Description |
string |
input |
A string containing a scale to convert. |
Returns
Type |
Description |
Scale |
A Scale equivalent to the musical scale contained in input . |
Exceptions
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type |
Description |
string |
A string that represents the current object. |
Overrides
TryParse(string, out Scale)
Converts the string representation of a musical scale to its
Scale
equivalent. A return value indicates whether the conversion succeeded.
Declaration
public static bool TryParse(string input, out Scale scale)
Parameters
Type |
Name |
Description |
string |
input |
A string containing a scale to convert. |
Scale |
scale |
When this method returns, contains the Scale
equivalent of the musical scale contained in input , if the conversion succeeded,
or null if the conversion failed. The conversion fails if the input is null or
Empty, or is not of the correct format. This parameter is passed uninitialized;
any value originally supplied in result will be overwritten. |
Returns
Type |
Description |
bool |
true if input was converted successfully; otherwise, false . |
Operators
operator ==(Scale, Scale)
Determines if two
Scale objects are equal.
Declaration
public static bool operator ==(Scale scale1, Scale scale2)
Parameters
Type |
Name |
Description |
Scale |
scale1 |
The first Scale to compare. |
Scale |
scale2 |
The second Scale to compare. |
Returns
Type |
Description |
bool |
true if the scales are equal, false otherwise. |
operator !=(Scale, Scale)
Determines if two
Scale objects are not equal.
Declaration
public static bool operator !=(Scale scale1, Scale scale2)
Parameters
Type |
Name |
Description |
Scale |
scale1 |
The first Scale to compare. |
Scale |
scale2 |
The second Scale to compare. |
Returns
Type |
Description |
bool |
false if the scales are equal, true otherwise. |
Extension Methods