Class Resizer
Provides methods to resize MIDI data in many different ways. More info in the
Resizer article.
Inherited Members
Namespace: Melanchall.DryWetMidi.Tools
Assembly: Melanchall.DryWetMidi.dll
Syntax
public static class Resizer
Methods
Resize(MidiFile, ITimeSpan)
Declaration
public static void Resize(this MidiFile midiFile, ITimeSpan length)
Parameters
Type | Name | Description |
---|---|---|
MidiFile | midiFile | MidiFile to resize. |
ITimeSpan | length | New length of the midiFile . |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | One of the following errors occurred:
|
Resize(MidiFile, double)
Declaration
public static void Resize(this MidiFile midiFile, double ratio)
Parameters
Type | Name | Description |
---|---|---|
MidiFile | midiFile | MidiFile to resize. |
double | ratio | Ratio to resize midiFile by. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | midiFile is null . |
ArgumentOutOfRangeException | ratio is negative. |
Resize(TrackChunk, ITimeSpan, TempoMap)
Resizes TrackChunk to the specified length. More info in the
Resizer article.
Declaration
public static void Resize(this TrackChunk trackChunk, ITimeSpan length, TempoMap tempoMap)
Parameters
Type | Name | Description |
---|---|---|
TrackChunk | trackChunk | TrackChunk to resize. |
ITimeSpan | length | New length of the trackChunk . |
TempoMap | tempoMap | Tempo map used to calculate length. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | One of the following errors occurred:
|
Resize(TrackChunk, double)
Resizes TrackChunk by the specified ratio. More info in the
Resizer article.
Declaration
public static void Resize(this TrackChunk trackChunk, double ratio)
Parameters
Type | Name | Description |
---|---|---|
TrackChunk | trackChunk | TrackChunk to resize. |
double | ratio | Ratio to resize trackChunk by. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | trackChunk is null . |
ArgumentOutOfRangeException | ratio is negative. |
Resize(IEnumerable<TrackChunk>, ITimeSpan, TempoMap)
Resizes collection of TrackChunk to the specified length. More info in the
Resizer article.
Declaration
public static void Resize(this IEnumerable<TrackChunk> trackChunks, ITimeSpan length, TempoMap tempoMap)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TrackChunk> | trackChunks | Collection of TrackChunk to resize. |
ITimeSpan | length | New length of the trackChunks . |
TempoMap | tempoMap | Tempo map used to calculate length. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | One of the following errors occurred:
|
Resize(IEnumerable<TrackChunk>, double)
Resizes collection of TrackChunk by the specified ratio. More info in the
Resizer article.
Declaration
public static void Resize(this IEnumerable<TrackChunk> trackChunks, double ratio)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TrackChunk> | trackChunks | Collection of TrackChunk to resize. |
double | ratio | Ratio to resize trackChunks by. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | trackChunks is null . |
ArgumentOutOfRangeException | ratio is negative. |
ResizeObjectsGroup(IEnumerable<ITimedObject>, ITimeSpan, TempoMap, ObjectsGroupResizingSettings)
Resizes group of objects to the specified length treating all objects as a single one. More info in the
Resizer article.
Declaration
public static void ResizeObjectsGroup(this IEnumerable<ITimedObject> objects, ITimeSpan length, TempoMap tempoMap, ObjectsGroupResizingSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ITimedObject> | objects | Objects to resize. |
ITimeSpan | length | New length of the objects collection. |
TempoMap | tempoMap | Tempo map used to calculate length. |
ObjectsGroupResizingSettings | settings | Settings according to which objects should be resized. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | One of the following errors occurred:
|
ArgumentException | BarBeatTicks or BarBeatFraction
is used for DistanceCalculationType of the settings
which is unsupported. |
ResizeObjectsGroup(IEnumerable<ITimedObject>, double, TempoMap, ObjectsGroupResizingSettings)
Resizes group of objects by the specified ratio treating all objects as a single object. More info in the
Resizer article.
Declaration
public static void ResizeObjectsGroup(this IEnumerable<ITimedObject> objects, double ratio, TempoMap tempoMap, ObjectsGroupResizingSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ITimedObject> | objects | Objects to resize. |
double | ratio | Ratio to resize objects by. |
TempoMap | tempoMap | Tempo map used to calculate length. |
ObjectsGroupResizingSettings | settings | Settings according to which objects should be resized. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | One of the following errors occurred:
|
ArgumentOutOfRangeException | ratio is negative. |
ArgumentException | BarBeatTicks or BarBeatFraction
is used for DistanceCalculationType of the settings
which is unsupported. |