C# Class Midi.Scale

A scale based on a particular tonic.

For our purposes, a scale is defined by a tonic and then the pattern that it uses to ascend up to the next tonic and then descend back to the original tonic. The tonic is described with a NoteFamily because it is not specific to any one octave. The ascending/descending pattern is provided by the Pattern nested class.

This class comes with a collection of predefined patterns, such as Scale.Major and Scale.HarmonicMinor.

Afficher le fichier Open project: jstnryan/midi-dot-net Class Usage Examples

Méthodes publiques

Свойство Type Description
Chromatic ScalePattern
HarmonicMinor ScalePattern
Major ScalePattern
MelodicMinorAscending ScalePattern
MelodicMinorDescending ScalePattern
NaturalMinor ScalePattern
Patterns Midi.ScalePattern[]

Méthodes publiques

Méthode Description
Contains ( Pitch pitch ) : bool

Returns true if pitch is in this scale.

Equals ( System obj ) : bool

Value equality.

GetHashCode ( ) : int

Hash code.

Scale ( Midi.Note tonic, ScalePattern pattern ) : System

Constructs a scale from its tonic and its pattern.

ScaleDegree ( Pitch pitch ) : int

Returns the scale degree of the given pitch in this scale.

ToString ( ) : string

ToString returns the scale's human-readable name.

operator ( ) : bool

Inequality operator does value inequality because Chord is immutable.

Private Methods

Méthode Description
Build ( Midi.Note tonic, ScalePattern pattern, int positionInOctaveToSequenceIndex, Midi.Note noteSequence, int &numAccidentals ) : void

Builds a scale.

Method Details

Contains() public méthode

Returns true if pitch is in this scale.
public Contains ( Pitch pitch ) : bool
pitch Pitch The pitch to test.
Résultat bool

Equals() public méthode

Value equality.
public Equals ( System obj ) : bool
obj System
Résultat bool

GetHashCode() public méthode

Hash code.
public GetHashCode ( ) : int
Résultat int

Scale() public méthode

Constructs a scale from its tonic and its pattern.
tonic or pattern is null.
public Scale ( Midi.Note tonic, ScalePattern pattern ) : System
tonic Midi.Note The tonic note.
pattern ScalePattern The scale pattern.
Résultat System

ScaleDegree() public méthode

Returns the scale degree of the given pitch in this scale.
public ScaleDegree ( Pitch pitch ) : int
pitch Pitch The pitch to test.
Résultat int

ToString() public méthode

ToString returns the scale's human-readable name.
public ToString ( ) : string
Résultat string

operator() public static méthode

Inequality operator does value inequality because Chord is immutable.
public static operator ( ) : bool
Résultat bool

Property Details

Chromatic public_oe static_oe property

Pattern for Chromatic scales.
public static ScalePattern,Midi Chromatic
Résultat ScalePattern

HarmonicMinor public_oe static_oe property

Pattern for Harmonic Minor scales.
public static ScalePattern,Midi HarmonicMinor
Résultat ScalePattern

Major public_oe static_oe property

Pattern for Major scales.
public static ScalePattern,Midi Major
Résultat ScalePattern

MelodicMinorAscending public_oe static_oe property

Pattern for Melodic Minor scale as it ascends.
public static ScalePattern,Midi MelodicMinorAscending
Résultat ScalePattern

MelodicMinorDescending public_oe static_oe property

Pattern for Melodic Minor scale as it descends.
public static ScalePattern,Midi MelodicMinorDescending
Résultat ScalePattern

NaturalMinor public_oe static_oe property

Pattern for Natural Minor scales.
public static ScalePattern,Midi NaturalMinor
Résultat ScalePattern

Patterns public_oe static_oe property

Array of all the built-in scale patterns.
public static ScalePattern[],Midi Patterns
Résultat Midi.ScalePattern[]