Class QuantizingSettings
Settings according to which quantization should be performed by the Quantizer.
More info in the Quantizer article.
Inherited Members
Namespace: Melanchall.DryWetMidi.Tools
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class QuantizingSettings
Properties
DistanceCalculationType
Gets or sets the type of distance calculation used to find a time to snap an object to.
The default value is Midi.
Declaration
public TimeSpanType DistanceCalculationType { get; set; }
Property Value
Type | Description |
---|---|
TimeSpanType |
Filter
Gets or sets a predicate to filter objects that should be quantized. Use
null
if
all objects should be processed.Declaration
public Predicate<ITimedObject> Filter { get; set; }
Property Value
Type | Description |
---|---|
Predicate<ITimedObject> |
FixOppositeEnd
Gets or sets a value indicating whether an opposite side of an object should be fixed or not.
The default value is
false
.Declaration
public bool FixOppositeEnd { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
When an object's side is fixed the length can be changed during quantization.
LengthType
Gets or sets the type of an object's length that should be kept in case the opposite
side is not fixed. The default value is Midi.
Declaration
public TimeSpanType LengthType { get; set; }
Property Value
Type | Description |
---|---|
TimeSpanType |
Exceptions
Type | Condition |
---|---|
InvalidEnumArgumentException | value specified an invalid value. |
QuantizingBeyondFixedEndPolicy
Gets or sets policy according to which a quantizer should act in case of object's side
is going to be moved beyond an opposite one that is fixed. The default value is
CollapseAndFix.
Declaration
public QuantizingBeyondFixedEndPolicy QuantizingBeyondFixedEndPolicy { get; set; }
Property Value
Type | Description |
---|---|
QuantizingBeyondFixedEndPolicy |
Remarks
When one end of an object is fixed, there is a chance that the object's opposite end
will be quantized in a such way that the object will be reversed resulting to negative length.
This policy provides options to prevent this situation.
Exceptions
Type | Condition |
---|---|
InvalidEnumArgumentException | value specified an invalid value. |
QuantizingBeyondZeroPolicy
Gets or sets policy according to which a quantizer should act in case of an object is going
to be moved beyond zero. The default value is FixAtZero.
Declaration
public QuantizingBeyondZeroPolicy QuantizingBeyondZeroPolicy { get; set; }
Property Value
Type | Description |
---|---|
QuantizingBeyondZeroPolicy |
Remarks
When the start time of an object is not fixed, there is a chance that the object's end time
will be quantized in a such way that the start time will be negative due to the object is
moved to the left. Negative time is invalid so this policy provides options to prevent this
situation.
Exceptions
Type | Condition |
---|---|
InvalidEnumArgumentException | value specified an invalid value. |
QuantizingLevel
Gets or sets the level of quantization from 0.0 (no quantization) to 1.0 (full quantization).
Declaration
public double QuantizingLevel { get; set; }
Property Value
Type | Description |
---|---|
double |
Remarks
This setting specifies how close an object should be moved to nearest grid time. For example,
0.5 will lead to an object will be moved half the distance between its time and the nearest
grid time.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | value is out of valid range. |
RandomizingSettings
Gets or sets settings according to which randomizing should be performed.
Declaration
public RandomizingSettings RandomizingSettings { get; set; }
Property Value
Type | Description |
---|---|
RandomizingSettings |
Target
Gets or sets the side of an object that should be quantized.
The default value is Start.
Declaration
public QuantizerTarget Target { get; set; }
Property Value
Type | Description |
---|---|
QuantizerTarget |
Exceptions
Type | Condition |
---|---|
InvalidEnumArgumentException | value specified an invalid value. |