
SAMPLING 2 / LUT OSC (PLAIN, DUO, PMOD, SYNC, MODULATABLE AND LFO VERSION)
--------------------------------------------------------------------------


Single-cycle look-up table oscillators based on Sample V2 standard.

The supplied sample always corresponds to a complete waveform period, no matter which its content.

To prevent troubles and unintended modulation attempts, Start and End offset pins are no longer provided; offsetting, if required, must be done externally by usage of the Sample Range module.

DC offset resulting from an unbalanced LUT sample can be removed with the apposite Remove DC option, if required (except LFO version, where this option is usually not needed or even not wanted).

A power switch is provided to turn the oscillator off when not used, to save CPU.

Anti Aliasing is performed for both up-sampling and down-sampling, including jumps caused by Sync or Phase Modulation; for this reason, oversampling is forbidden (an error dialog will immediately pop up if you do).
Anti Aliasing quality can be set with the Anti Alias pin; please refer to SAMPLING_V2.pdf for the available filters.

Pitch (in Octaves) can range from theorically -Infinity (0 Hz) up to a pitch corresponding to (Nyquist / 2) Hz.

All oscillators except the Modulatable ("M") version are not suitable to receive dynamically changing samples (by any means).
When a new sample is received, phase is resetted if the length differs. However, even when switching samples of the same size, tiny clicks may occur.
To use dynamically changing samples without clicks or other artifacts (eg. when using modulatable shapes via the Shape To Sample DSP converter) please use the Modulatable version.



!!! ABOUT LONG LUTS AND CPU LOAD - IMPORTANT !!!
------------------------------------------------

Always keep in mind that up-sampling (interpolation) is cheaper and has a fixed CPU cost, while down-sampling (skipping samples) increases CPU load proportionally with the amount of skipped samples to anti-alias.
However, not to pose any constrains, the down-sampling factor is NOT internally limited.

In general, it is advisable to use relatively SHORT LUT samples (e.g 100/200 samples long or even less). LONGER LUTS DO NOT MEAN HIGHER QUALITY ! The Anti Aliasing interpolation filters used can offer an excellent up-sampling quality depending on the settings. Using long LUTs causes the oscillator to work in down-sampling mode most of time, i.e having to always SKIP samples from the table, rather than interpolating. To avoid high CPU loads, try to have the oscillator work in up-sampling mode most of time, avoiding unnecessarily long LUTs, or choose a cheaper Anti Alias filter.

Normally, a LUT is meant to contain a single cycle waveform. Whenever usage of LUTs containing many periods is really necessary, it is therefore advisable to scale the pitch down. For example, if a LUT contains 100 periods, the oscillator frequency itself must be scaled by 1/100 (this is achieved by adding log2(1/100) to the pitch).



PLAIN VERSION
-------------

Plain oscillator.
Only pitch can be modulated.


DUO VERSION
-----------

Accepts two samples, which must be the same size.
The Mod pin allows modulation (x-fading) between sample A and sample B


PMOD VERSION
------------

Supports phase modulation, from -10 V (one whole table backwards) to +10 V (one whole table forward); thus, PM extent can be easily adjusted with an external multiplier.


SYNC VERSION
------------

Supports internal Soft Sync. No external oscillator is required, this allows to achieve true, smooth, phase-accurate and anti-aliased sync.

Hard Sync is equivalent to scaling the waveform within its natural LUT limits, either making it larger (the exceeding portion is trimmed) or narrower (the empty space is filled with the same waveform repeating).

However, this module implements a kind of soft-sync, which offers the same typical effect of classic hard-sync yet sounding much smoother and more natural, by not presenting the abrupt discontinuity at the LUT end.
Soft sync here is implemented by cross-fading thru a whole LUT two identical LUT waveforms scaled as above, one anchored at beginning and one anchored at the end.

For convenience, an audio pin (Scal Mod) is provided, which allows free modulation (from 0 to 10V) of the waveform scaling factor within a specified range (min = 0.1x, max = 10x). Usually you may want to contract the waveform, for a typical sync effect (Scal values >=1, default); however, with some waveforms rich with harmonics, even scaling factors smaller than 1 may lead to interesting results.

The LUT Quality pin selects whether LUTs shall be scaled using a simple linear interpolating reader with no anti-aliasing (Low quality, lower CPU load) or with the same, full-blown anti-aliasing filter used by the oscillator to read the LUT (High quality, higher CPU load).
CPU load will be sensibly affected by this setting only when Scal Mod pin gets dynamically modulated though (eg. by an LFO, by Aftertouch, by Mod Wheel, ...). If you plan to just allow manual control, or to at most control its value with Velocity, feel free to set quality to High.

Note: DC removal may not be 100% accurate, because every wavecycle with different scaling factor may have a different DC level than the original LUT. On the other hand, compensating for it in this scenario would have been overcomplicated. This does not represent an issue most of times though.



M (MODULATABLE) VERSION
-----------------------

Works like the Plain version but allows samples to be dynamically modulated or switched without producing audible clicks or artifacts, as long as they have all a same size.
Can be used together with the Shape To Sample DSP module to replace the old Shape Osc in case of dynamically changing shapes.

Max sample length is limited to 256.



LFO VERSION
-----------

For LFO usage only.

Pitch is expressed in Hz, and can range from 0 (still wave) up to 100 Hz.

The Reset pin resets the oscillator phase to zero, thus allowing to re-trigger the LFO at keypress when required (vs. "free run"). A very quick fade is performed, to prevent an abrupt transitiom from current phase to beginning phase, which could result in clicks depending on the application.

Since this is a low-frequency oscillator, the anti-aliasing filter selected performs up-sampling only (interpolation), and no down-sampling is performed.










