Class KeySignatureEvent
Represents a Key Signature meta event.
Inheritance
KeySignatureEvent
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class KeySignatureEvent : MetaEvent
Constructors
KeySignatureEvent()
Declaration
public KeySignatureEvent()
KeySignatureEvent(sbyte, byte)
Initializes a new instance of the
KeySignatureEvent with the
specified key and scale.
Declaration
public KeySignatureEvent(sbyte key, byte scale)
Parameters
Type |
Name |
Description |
sbyte |
key |
The number of flats (if negative) or
sharps (if positive). |
byte |
scale |
The scale (0 for major or 1 for minor). |
Exceptions
Fields
DefaultKey
Default key (C).
Declaration
public const sbyte DefaultKey = 0
Field Value
DefaultScale
Default scale (major).
Declaration
public const byte DefaultScale = 0
Field Value
MaxKey
Represents the largest possible key value.
Declaration
public const sbyte MaxKey = 7
Field Value
MaxScale
Represents the largest possible scale value.
Declaration
public const byte MaxScale = 1
Field Value
MinKey
Represents the smallest possible key value.
Declaration
public const sbyte MinKey = -7
Field Value
MinScale
Represents the smallest possible scale value.
Declaration
public const byte MinScale = 0
Field Value
Properties
Key
Gets or sets key signature in terms of number of flats (if negative) or
sharps (if positive).
Declaration
public sbyte Key { get; set; }
Property Value
Exceptions
Scale
Gets or sets scale (0 for major or 1 for minor).
Declaration
public byte Scale { get; set; }
Property Value
Exceptions
Methods
CloneEvent()
Clones event by creating a copy of it.
Declaration
protected override MidiEvent CloneEvent()
Returns
Type |
Description |
MidiEvent |
Copy of the event. |
Overrides
GetContentSize(WritingSettings)
Gets the size of the content of a MIDI meta event.
Declaration
protected override int GetContentSize(WritingSettings settings)
Parameters
Type |
Name |
Description |
WritingSettings |
settings |
Settings according to which the event's content must be written. |
Returns
Type |
Description |
int |
Size of the event's content. |
Overrides
ReadContent(MidiReader, ReadingSettings, int)
Reads content of a MIDI meta event.
Declaration
protected override void ReadContent(MidiReader reader, ReadingSettings settings, int size)
Parameters
Type |
Name |
Description |
MidiReader |
reader |
Reader to read the content with. |
ReadingSettings |
settings |
Settings according to which the event's content must be read. |
int |
size |
Size of the event's content. |
Overrides
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
WriteContent(MidiWriter, WritingSettings)
Writes content of a MIDI meta event.
Declaration
protected override void WriteContent(MidiWriter writer, WritingSettings settings)
Parameters
Type |
Name |
Description |
MidiWriter |
writer |
Writer to write the content with. |
WritingSettings |
settings |
Settings according to which the event's content must be written. |
Overrides