Search Results for

    Show / Hide Table of Contents

    Class Quantizer

    Performs quantization of objects. The process can be adjusted in many ways by QuantizingSettings. More info in the Quantizer article.
    Inheritance
    object
    Quantizer
    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 class Quantizer

    Methods

    OnObjectQuantizing(ITimedObject, QuantizedTime, IGrid, LengthedObjectTarget, TempoMap, QuantizingSettings)

    Performs additional actions before the new time will be set to an object after search for nearest grid time.
    Declaration
    protected virtual TimeProcessingInstruction OnObjectQuantizing(ITimedObject obj, QuantizedTime quantizedTime, IGrid grid, LengthedObjectTarget target, TempoMap tempoMap, QuantizingSettings settings)
    Parameters
    Type Name Description
    ITimedObject obj Object to set new time for.
    QuantizedTime quantizedTime Holds information about new time for obj.
    IGrid grid Grid to quantize obj by.
    LengthedObjectTarget target Target time (start or end) to update.
    TempoMap tempoMap Tempo map used to quantize obj.
    QuantizingSettings settings Settings according to which quantization performed.
    Returns
    Type Description
    TimeProcessingInstruction An object indicating whether the new time should be set to the object or not. Also returned object contains that new time.

    OnObjectRandomizing(ITimedObject, long, LengthedObjectTarget, TempoMap, QuantizingSettings)

    Performs additional actions before the new time will be set to an object after search for random time within bounds defined by Bounds.
    Declaration
    protected virtual TimeProcessingInstruction OnObjectRandomizing(ITimedObject obj, long time, LengthedObjectTarget target, TempoMap tempoMap, QuantizingSettings settings)
    Parameters
    Type Name Description
    ITimedObject obj Object to set new time for.
    long time New time for obj.
    LengthedObjectTarget target Target time (start or end) to update.
    TempoMap tempoMap Tempo map used to quantize obj.
    QuantizingSettings settings Settings according to which quantization performed.
    Returns
    Type Description
    TimeProcessingInstruction An object indicating whether the new time should be set to the object or not. Also returned object contains that new time.

    Quantize(IEnumerable<ITimedObject>, IGrid, TempoMap, QuantizingSettings)

    Quantizes objects using the specified grid.
    Declaration
    public void Quantize(IEnumerable<ITimedObject> objects, IGrid grid, TempoMap tempoMap, QuantizingSettings settings = null)
    Parameters
    Type Name Description
    IEnumerable<ITimedObject> objects Objects to quantize.
    IGrid grid Grid to use for quantization.
    TempoMap tempoMap Tempo map used to perform time and length conversions.
    QuantizingSettings settings Settings according to which objects should be quantized.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • objects is null.
    • grid is null.
    • tempoMap is null.
    In this article
    Back to top 2024 / Generated by DocFX