from core import MIDI_PITCH, OFFSET_64


def transpose(semitones):
    def _(point):
        if MIDI_PITCH in point:
            point[MIDI_PITCH] = point[MIDI_PITCH] + semitones
        return point
    return _


def shift(offset):
    def _(point):
        point[OFFSET_64] = point[OFFSET_64] + offset
        return point
    return _

@@ -31,16 +31,29 @@
 FFSET_64
+, DURATION_64
 %0A%0A%0Adef t
@@ -325,28 +325,272 @@
   return point%0A    return _%0A
+%0A%0Adef stretch(multiplier):%0A    def _(point):%0A        point%5BOFFSET_64%5D = int(point%5BOFFSET_64%5D * multiplier)%0A        if DURATION_64 in point:%0A            point%5BDURATION_64%5D = int(point%5BDURATION_64%5D * multiplier)%0A        return point%0A    return _%0A

add stretch transform for augmentation/diminution