
SAMPLE MODIFIER
---------------

Performs various trivial operations on the sample present on the Data I/O BLOB pin within a [Start,End] range (endpoints included) and sends the result back to the same pin.

The Data I/O pin shall normally be connected to a Patch Memory Blob.

Range values outside physical sample end will be clipped to sample end. If range End is set to -1, (mostly for manual usage) the natural sample end will be used; if range Start is lower than zero, it will be clipped to zero. If both range Start and range End are set to -1 (no selection, consistently with the Sample Display module) no operation will be performed.
In all other cases, if range End is < range Start, the smallest value will be considered as range Start and the larger as range End.

Often however you may want to connect the Start, End, Sample Pos pins to the corresponding pins of ED Sample Display directly.

The Sample Val pin outputs the sample value found at the position specified by the Sample Pos pin.
This value can also be modified externally, and the altered sample will be sent back to the Data pin.

The Auto Update Rng option pin (unexposed, defaults to false) specifies whether the range Start and End pins shall be updated automatically after a range Crop and Trim operation, by setting the selection to the whole sample or by invalidating the selection (-1,-1) respectively.
*IN GENERAL IT IS ALWAYS ADVISABLE TO ENABLE THIS OPTION ONLY WHEN THE SAMPLE MODIFIER RANGE PINS ARE CONNECTED TO THE SELECTION PINS OF A SAMPLE DISPLAY MODULE. WHEN THE RANGE IS INSERTED MANUALLY OR COMPUTED BY OTHER MEANS, IT IS BETTER TO LEAVE THIS OPTION DISABLED TO AVOID IMPLICATIONS HARD TO PREDICT*
You shall pay attention when performing a common operation on a stereo or multi-channel sample by two or more Sample Modifiers operating in parallel: to avoid conflicts with the Range pins, you shall disable the Auto Update Rng option on all modules but the one operating last !
Keep in mind that when using an ED Splitter Bool to drive several Sample Modifier modules with a common command, the Modifier connected to the bottom-most splitter pin will always operate last; with other wiring schemes this order may not be always easily predictable and shall be discovered by trial and error.



By activating the respective right BOOL command pins, the following operations can be performed:

-Crop: the selected range is kept, the rest discarded. This will result in a shorter sample
       NOTE: if Auto Update Rng is enabled, range will be updated automatically to [0, sample end]
       after operation

-Trim: the selected range is discarded, the two remaining portions are kept and joined. This will
       result in a shorter sample.
       NOTE: if Auto Update Rng is enabled, range will be invalidated after a Trim operation
       (Start and End set to -1)

-Zero: the selected range is zeroed

-Invert: the selected range is inverted (negated)

-Flip: the selected range is flipped horizontally

-Normalize: the selected range is normalized to the level (in Volts) specified by the Norm V pin

-Fade In, Fade Out: the level of the selected range is tapered in or off, either linearly or with
                    exponential (VCA) response depending on the Exp Fade pin setting


