# Generator

A **generator** is an interval which is stacked repeatedly to create pitches in a tuning system or a scale.

In mos scales, the generator is an interval that you stack up and reduce by the period of the mos to construct the mos pattern within each period. Along with the period, it is one of two defining intervals of the mos. For example:

- In diatonic (LLLsLLs), the perfect fifth is a generator: stacking 6 fifths up from the tonic and reducing by the octave produces the pattern LLLsLLs, the Lydian mode. Note that the perfect fourth and the perfect twelfth can also work as generators.
- In jaric (ssLssssLss), the perfect fifth (~3/2) is a generator and the half-octave is the period.

See Periods and generators for a beginner-level introduction.

## Mathematical definition

A **generating set** of a group is a subset of the elements of the group which is not contained in any proper subgroup, which is to say, any subgroup which is not the whole group. If the set is a finite set, the group is called finitely generated. If it is also an abelian group, it is called a finitely generated abelian group. An element of a generating set is called a generator.

A **minimal generating set** is a generating set which has no "redundant" or "unnecessary" generators. In free abelian groups such as just intonation subgroups or its regular temperaments, this is the same thing as a basis. For example, {2, 3, 5} and {2, 3, 5/3} are bases for the JI subgroup 2.3.5. However, {2, 3, 5, 15} is not a basis: 15 = 3 × 5, so we can take out 15 from this generating set and the set will remain a generating set.

If the group operation is written additively, then if [math]\lbrace g_1, g_2, \ldots g_k \rbrace[/math] is the generating set, every element [math]g[/math] of the group can be written

[math]g = n_1 g_1 + n_2 g_2 + \ldots + n_k g_k[/math]

where the [math]n_i[/math] are integers. If the group operation is written multiplicatively,

[math]g = {g_1}^{n_1} {g_2}^{n_2} \ldots {g_k}^{n_k}[/math]

### Relation to music

An important example is provided by regular temperaments, where if a particular tuning for the temperament is written additively, the generators can be taken as intervals expressed in terms of cents, and if multiplicatively, as intervals given as frequency ratios. Another example is provided by just intonation subgroups, where the generators are a finite set of positive rational numbers, forming a basis, which are typically the literal prime numbers up to a given prime limit. These two example converge when we seek generators for the abstract temperament rather than any particular tuning of it.

### Convention

In multirank systems, it is customary that generators are said as opposed to the period. Specifically, the first generator is called the period, and only the rest are called the generators.