Search Results for

    Show / Hide Table of Contents

    Class Resizer

    Provides methods to resize MIDI data in many different ways. More info in the Resizer article.
    Inheritance
    object
    Resizer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Tools
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public static class Resizer

    Methods

    Resize(MidiFile, ITimeSpan)

    Resizes MidiFile to the specified length. More info in the Resizer article.
    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:

    • midiFile is null.
    • length is null.

    Resize(MidiFile, double)

    Resizes MidiFile by the specified ratio. More info in the Resizer article.
    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:

    • trackChunk is null.
    • length is null.
    • tempoMap is null.

    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:

    • trackChunks is null.
    • length is null.
    • tempoMap is null.

    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:

    • objects is null.
    • length is null.
    • tempoMap is null.
    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:

    • objects is null.
    • tempoMap is null.
    ArgumentOutOfRangeException ratio is negative.
    ArgumentException BarBeatTicks or BarBeatFraction is used for DistanceCalculationType of the settings which is unsupported.
    In this article
    Back to top 2024 / Generated by DocFX