In musical sound synthesis, oscillators conventionally form the most fundamental synthesis building block. With analog synthesizers, they are realized as electronic oscillators and with digital or software synthesizers they are generated algorithmically. Modern software synthesis environments such as CSound have generalized the oscillator as a type of unit generator (UG), where UGs are primitive modules that produce, modify or acquire audio or control signals.
A reciprocating or vibrating mechanical device like a piston or a tuning fork are both mechnical oscillators.
The mathematical description of an oscillator involves a description of a continuous function that varies periodically above and below a mean or other reference, extending from -infinity to +infinity, never fading, never diverging. This can be represented as a sequence:
For example the sequence 1, -1, 1, -1, 1, -1,... is an oscillation that is analogous to a square-wave generator. [This paragraph is horribly written; a mathematician who knows the conventions of this area could correct it. I have changed the incorrect word "series" to "sequence".]