
SAMPLING 2 / SAMPLE OSCILLATOR
------------------------------

Full-featured oscillator for V2 samples with several playback modes.

A valid V2 sample must be provided at the input. Samples shorter than 64 frames are rejected.

POWER:
------
Power can be switched off manually to save CPU when the module is not used.
Keep in mind that when a module is used polyphonically, it will be automatically turned off (i.e simply not computed) when its voice it not playing. Therefore, the Power switch can be used to turn off the oscillator manually either in monophonic circuits, or when used together with other oscillators in a polyphonic circuit but not required for voice generation in a given Preset.
In addition, in some play modes (check the list below), the oscillator goes to sleep automatically once playback is over.


ORIGINAL RATE AND PITCH:
------------------------
When the original sample rate of the input sample is known, its value must be specified to the Orig Rate pin (usually the required value is provided by sample loaders).
When its value is smaller than 1000 or negative, no resampling is performed (default), and the input sample is assumed having the same rate as the working sample rate.

When the pitch (in Hz) of the sample at its original sample rate is known, it should also be specified to the Orig Pitch pin: in this case, playing a note corresponding the original sample note will result in the original sample being played at its original pitch (by default this value is 440, this means that playing central A will result in the original un-scaled sample).


PITCH:
------
Pitch for playing must be specified in Octaves, absolute, from 0 to 10 V.
For low-frequency applications, please use the LUT LFO Oscillator.


ANTI ALIASING:
--------------
The anti-aliasing filter used for both upsampling (interpolation) and down-sampling (decimation) can be selected with the apposite pin. Please consult SAMPLING_V2.pdf for more information about the available filters.

Oversampling is therefore not allowed. If you do, a warning request will pop up immediately. There is really no need to oversample this module, please rather select a suitable Anti Aliasing filter.


MARKER POINTS:
--------------
Useful sample and loop ranges must be specified.
With this module, standard Sampling V2 rules for ranges can't apply, because we must have always valid ranges.
-Any negative value for *any* marker is interpreted as relative to the sample end (e.g -1 is the last sample frame)
-The resulting values are clipped within 0 and sample length minus one
-Start and End points are always inclusive
-Thus, start = 0 and end = -1 (default) indicate the whole sample.
-Positions need not be sorted; playback direction will be dictated by the relative start and end positions of the various points, always proceeding from start to end both for normal and for loop playing.
-One-sample-long ranges (i.e start == end) are still technically allowed despite pointless; please avoid setting too short ranges, or playback may become meningless as expectable, in particular at high pitches.


GATE:
-----
The Gate pin triggers or controls playback depending on the play mode selected. Note that this pin has been provided as Bool, since it is within every respect a low-rate pin, and doing so translated to increased efficiency (no audio buffer used and much simpler and smarter code). However, the Gate audio pin from the stock MIDI-CV converter can be plugged directly without issues. We support the idea that the Gate pin of the MIDI CV 2 module (and also of the ADSR) should have been made Bool aswell.


SAMPLE POSITIONING:
-------------------
Sample positioning internally is performed by a 64 bits double-precision index: this warrants accurate positioning without any accuracy loss (as it happened with V1 instead) even with long samples. However, usage of long samples is always discouraged, in particular with the Sample Osc (which is intended for *playing notes*).



AVAILABLE PLAY MODES:
---------------------

ONCE: when Gate is set, the whole sample is played entirely ("one-shot") from Start to End position. Gate Off events are ignored. Loop range is ignored. Playback can be re-triggered from Start by further Gate On events. The oscillator goes to sleep once the End point is reached.

LOOP: when Gate is set, the specified loop part is played forever from Loop Start to Loop End until the voice is muted. Gate Off events are ignored. Position is resetted to Loop Start on further Gate On events.

START+LOOP: when Gate is set, playback starts from Start position and proceeds to Loop Start, continuing inside the loop part forever until the voice is muted. Gate Off events are ignored. Position is resetted to Start on further Gate On events.

LOOP+END: when Gate is set, playback starts at Loop Start and continues looping to Loop End until Gate is released, then playback proceeds from the current position to End position. The oscillator goes to sleep once End point is reached. Position is resetted to Loop Start on further Gate On events.

START+LOOP+END: when Gate is set, playback start at Start position and proceeds to Loop Start looping to Loop end until Gate is released, then playback proceeds from the current position to End position. The oscillator goes to sleep once End position is reached. Position is resetted to Start on further Gate On events.

ONCE+BACK: ("one-shot" forth and back) when Gate is set, the whole sample is played from Start to End position, then back to Start position. Gate Off events are ignored. Loop range is ignored. The oscillator goes to sleep once Start point is reached back. Playback is re-triggered from Start position on further Gate On events.

FWD+BACK: ("handsaw" mode) when Gate is set, playback starts at Start position (or resumes from current position if already playing) proceeding to End position where it gets stuck. Playback resumes backwards from current position to Start position when Gate is released. The oscillator goes to sleep once Gate is disabled and Start point is reached back. Loop range is ignored.


PING PONG:
----------
By enabling the Loop Ping Pong pin, loops in looping modes will be played back and forth (from Loop Start to Loop End then again to Loop Start and so on indefinitely).
Note that Ping Pong feature wasn't meant to be provided any longer with V2, since it was judged pointless and naturally prone to clicks, because of abrupt waveform inversion. It was restored nonetheless following requests by some users.


NOTE:
-----
Loop smoothing ("x-fade") feature of v1 was removed, because was ultimately judged ineffective, other than resulting in more complicated, less efficient code more prone to bugs; also, it was definitely not suitable for all play modes.
The same feature might be emulated in future though, by means of an external DSP sample processing module.





