Resizer
DryWetMIDI provides the tool to resize a group of objects or an entire MIDI file – Resizer. Quick example of resizing in action:
So as you can see the tool treats all passed objects as a single group and then sizes this group to the new length saving all time-to-length ratios. For example, if an event was at the middle of an objects group, it will be at the middle of the group too after resizing. Following image explains this visually for the group of three notes:
You use ResizeObjectsGroup methods to stretch or shrink a group of timed objects. You can size a group either to the specified new length or by ratio. Ratio means that all distances from the start of a group will be multiplied by this value. So if ratio of 2
is specified, an objects group will be enlarged by 2 times. And 0.5
means the group will be shrunk by 2 times (new length will be half (0.5
) of the original one).
There are also Resize methods to resize MidiFile or TrackChunk.
If you're resizing a group or file to the specified length, please take care of the distance calculation type which can be set via ObjectsGroupResizingSettings.DistanceCalculationType property of the settings that you can pass to the tool's methods. For example, if you specify new length as a metric one – 10
seconds – it's worth to set the DistanceCalculationType
to the TimeSpanType.Metric value.