C# Класс 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.

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Chromatic ScalePattern
HarmonicMinor ScalePattern
Major ScalePattern
MelodicMinorAscending ScalePattern
MelodicMinorDescending ScalePattern
NaturalMinor ScalePattern
Patterns Midi.ScalePattern[]

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
Build ( Midi.Note tonic, ScalePattern pattern, int positionInOctaveToSequenceIndex, Midi.Note noteSequence, int &numAccidentals ) : void

Builds a scale.

Описание методов

Contains() публичный Метод

Returns true if pitch is in this scale.
public Contains ( Pitch pitch ) : bool
pitch Pitch The pitch to test.
Результат bool

Equals() публичный Метод

Value equality.
public Equals ( System obj ) : bool
obj System
Результат bool

GetHashCode() публичный Метод

Hash code.
public GetHashCode ( ) : int
Результат int

Scale() публичный Метод

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.
Результат System

ScaleDegree() публичный Метод

Returns the scale degree of the given pitch in this scale.
public ScaleDegree ( Pitch pitch ) : int
pitch Pitch The pitch to test.
Результат int

ToString() публичный Метод

ToString returns the scale's human-readable name.
public ToString ( ) : string
Результат string

operator() публичный статический Метод

Inequality operator does value inequality because Chord is immutable.
public static operator ( ) : bool
Результат bool

Описание свойств

Chromatic публичное статическое свойство

Pattern for Chromatic scales.
public static ScalePattern,Midi Chromatic
Результат ScalePattern

HarmonicMinor публичное статическое свойство

Pattern for Harmonic Minor scales.
public static ScalePattern,Midi HarmonicMinor
Результат ScalePattern

Major публичное статическое свойство

Pattern for Major scales.
public static ScalePattern,Midi Major
Результат ScalePattern

MelodicMinorAscending публичное статическое свойство

Pattern for Melodic Minor scale as it ascends.
public static ScalePattern,Midi MelodicMinorAscending
Результат ScalePattern

MelodicMinorDescending публичное статическое свойство

Pattern for Melodic Minor scale as it descends.
public static ScalePattern,Midi MelodicMinorDescending
Результат ScalePattern

NaturalMinor публичное статическое свойство

Pattern for Natural Minor scales.
public static ScalePattern,Midi NaturalMinor
Результат ScalePattern

Patterns публичное статическое свойство

Array of all the built-in scale patterns.
public static ScalePattern[],Midi Patterns
Результат Midi.ScalePattern[]