Class SetTempoEvent
Represents a Set Tempo meta event.
Inherited Members
Namespace: Melanchall.DryWetMidi.Core
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class SetTempoEvent : MetaEvent
Remarks
The MIDI set tempo meta message sets the tempo of a MIDI sequence in terms
of microseconds per quarter note.
Constructors
SetTempoEvent()
Initializes a new instance of the SetTempoEvent.
Declaration
public SetTempoEvent()
SetTempoEvent(Int64)
Initializes a new instance of the SetTempoEvent with the
specified number of microseconds per quarter note.
Declaration
public SetTempoEvent(long microsecondsPerQuarterNote)
Parameters
Type | Name | Description |
---|---|---|
Int64 | microsecondsPerQuarterNote | Number of microseconds per quarter note. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | microsecondsPerQuarterNote is out of
[MinMicrosecondsPerQuarterNote; MaxMicrosecondsPerQuarterNote] range. |
Fields
DefaultMicrosecondsPerQuarterNote
Default tempo.
Declaration
public const long DefaultMicrosecondsPerQuarterNote = 500000L
Field Value
Type | Description |
---|---|
Int64 |
MaxMicrosecondsPerQuarterNote
Represents the largest possible microseconds-per-quarter-note value.
Declaration
public const long MaxMicrosecondsPerQuarterNote = 16777215L
Field Value
Type | Description |
---|---|
Int64 |
MinMicrosecondsPerQuarterNote
Represents the smallest possible microseconds-per-quarter-note value.
Declaration
public const long MinMicrosecondsPerQuarterNote = 1L
Field Value
Type | Description |
---|---|
Int64 |
Properties
MicrosecondsPerQuarterNote
Gets or sets number of microseconds per quarter note.
Declaration
public long MicrosecondsPerQuarterNote { get; set; }
Property Value
Type | Description |
---|---|
Int64 |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | value is out of
[MinMicrosecondsPerQuarterNote; MaxMicrosecondsPerQuarterNote] range. |
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 |
---|---|
Int32 | Size of the event's content. |
Overrides
ReadContent(MidiReader, ReadingSettings, Int32)
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. |
Int32 | 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. |