Obsolete API
Here the table of current API that is obsolete and thus will be removed from the library by a next release.
OBS1
WritingSettings.CompressionPolicy has been replaced by corresponding properties of WritingSettings. No compression applied by default, as before.
For example, to write using running status and write Note Off events as Note On ones with zero velocity we need to write:
midiFile.Write("Great MIDI file.mid", settings: new WritingSettings
{
UseRunningStatus = true,
NoteOffAsSilentNoteOn = true
});
Obsolete from version 5.1.2.
Old API
WritingSettings.CompressionPolicy
CompressionPolicy
New API
- WritingSettings.DeleteDefaultKeySignature
- WritingSettings.DeleteDefaultSetTempo
- WritingSettings.DeleteDefaultTimeSignature
- WritingSettings.DeleteUnknownChunks
- WritingSettings.DeleteUnknownMetaEvents
- WritingSettings.NoteOffAsSilentNoteOn
- WritingSettings.UseRunningStatus
OBS2
Now MIDI file reading uses buffering by default so ReaderSettings.ReadFromMemory
property is deprecated. By default buffering policy is BufferingPolicy.UseFixedSizeBuffer and BufferSize is 4096
which gives the same reading speed as putting all data in memory. But if you want, you can specify BufferingPolicy = BufferingPolicy.BufferAllData
to achieve the same behavior as with ReadFromMemory
:
MidiFile.Read("Great MIDI file.mid", new ReadingSettings
{
ReaderSettings = new ReaderSettings
{
BufferingPolicy = BufferingPolicy.BufferAllData
}
});
Obsolete from version 5.1.2.
Old API
ReaderSettings.ReadFromMemory
New API
OBS3
TempoMap.TimeSignature
property has been replaced with more explicit and straightforward methods: GetTimeSignatureChanges and GetTimeSignatureAtTime:
foreach (var timeSignatureChange in tempoMap.GetTimeSignatureChanges())
{
var time = timeSignatureChange.Time;
var timeSignature = timeSignatureChange.Value;
}
// ...
tempoMap.GetTimeSignatureAtTime(MusicalTimeSpan.Whole);
Obsolete from version 5.1.2.
Old API
TempoMap.TimeSignature
New API
OBS4
TempoMap.Tempo
property has been replaced with more explicit and straightforward methods: GetTempoChanges and GetTempoAtTime:
foreach (var tempoChange in tempoMap.GetTempoChanges())
{
var time = tempoChange.Time;
var timeSignature = tempoChange.Value;
}
// ...
tempoMap.GetTempoAtTime(MusicalTimeSpan.Whole);
Obsolete from version 5.1.2.
Old API
TempoMap.Tempo
New API