A sound comes from a preset, whose zones choose instruments, whose zones choose samples. Each level may have its own generators and modulators, and a global zone shares its values with the other zones of the same object. This page gives the rules of the specification for how they combine.
Levels
- A preset (preset level) is made of preset zones, each containing generators, modulators and an instrument. An instrument (instrument level) is made of instrument zones, each containing generators, modulators and a sample (spec 2.1 and 12, “preset zone” and “instrument zone”).
- Most generators exist at both levels and have a default value (spec 8.5).
- An instrument that no preset zone references and a sample that no instrument zone references are orphans; a file with orphans need not be rejected (spec 2.1, 7.6, 7.10).
Absolute and relative values
Generators at the instrument level are absolute and determine the actual physical value of the parameter, used instead of the default. A value of 1200 for attackVolEnv gives an attack of 1200 timecents, 2 seconds, instead of the default −12000 timecents, 1 ms.
Generators at the preset level are relative and additive to the default or instrument-level generators within the preset zone. A value of 2400 timecents for attackVolEnv in a preset zone whose instrument has two zones, one with the default and one with an absolute 1200, gives −9600 timecents (4 ms) for the first and 3600 timecents (8 seconds) for the second (spec 8.5).
The generators that are not available at the preset level are numbers 0, 1, 2, 3, 4, 12, 45, 46, 47, 50, 54, 57 and 58 (the address offsets, keynum, velocity, sampleModes, exclusiveClass and overridingRootKey); if found there they are ignored (spec 8.5). The only index generator legal at the preset level is instrument, and at the instrument level sampleID; substitution and sample generators are illegal at the preset level (spec 9.4).
Precedence of generators
The rules of the generator model (spec 9.4):
- A generator sets or offsets the value of a destination. Range, index, sample and substitution generators only set values and never offset them. Two generators are identical when their generator operator is the same.
- A generator in a global instrument zone that is identical to a default generator supersedes it. A generator in a local instrument zone that is identical to a default or to one in the global instrument zone supersedes that one.
- The points below apply to value generators only. A generator at the preset level adds to an identical one at the instrument level. A generator in a global preset zone that is identical to a default or to an instrument generator adds to it, and one that is identical to neither has its effect added to the synthesis parameter.
- A generator in a local preset zone that is identical to one in the global preset zone supersedes it; the result is added to the summing node of all zones in the instrument. A local preset zone generator identical to neither is added to the summing node of all zones in the instrument.
- A range generator at the preset level is not added to the instrument level: it works as an intersection filter on the key or velocity ranges of the instrument used in the preset zone.
Precedence of modulators
A modulator is identical to another when its source, destination, amount source and transform are the same. The rules (spec 9.5.1):
- The ranges over which modulators are active are defined in the generator list referenced by the same bag record that indexes the modulator list.
- A modulator in a global instrument zone that is identical to a default modulator supersedes it; one with the same destination but different source or transform adds its effect to the destination. A modulator in a local instrument zone that is identical to a default or a global-zone modulator supersedes it; one with the same destination but different source or transform adds.
- A modulator at the preset level adds to an identical modulator at the instrument level; otherwise its effect is added to the instrument-level effects. A global preset zone modulator identical to a default or instrument modulator adds to it, otherwise its effect is added to the destination. A local preset zone modulator identical to a global preset zone one supersedes it; either then adds to the summing node of all zones in the instrument.
- The result of one modulator “adding to” an identical one is a single modulator whose amount is the sum of the amounts. That is legal only when the modulators are identical; modulators with the same destination that are not identical keep their own amounts.
- With the exception of the file format’s size limits there is no limit to how many modulators a file has, where in the hierarchy they sit, how many times a destination is affected or how many destinations one source drives.
- The amount must match the units of the destination, which must be perceptually additive; generators and destinations added later must have additive units as well.
The explorer lists the generators and modulators of each zone, in file order, with the statuses ignored and superseded from the rules of the generator and modulator lists. Its Note tab then adds them up by these rules for a key and a velocity: the instrument-level value, what the preset adds, what the modulators add and the final value of every generator of every voice, and the modulators in effect (see the synthesiser).
Source: SoundFont Technical Specification 2.04, sections 2.1, 7.3 to 7.9, 8.5, 9.4, 9.5.1 and 12 (the glossary).