2,733
edits
m (Grammar) |
Red Leader (talk | contribs) m (→Creating a configuration file: Table, indentation, syntaxhighlight (lang="cpp", because source language is in C++)) |
||
Line 280: | Line 280: | ||
sane configuration when a certain entry is omitted. | sane configuration when a certain entry is omitted. | ||
Default | {| class="wikitable" | ||
! Tag !! Default value | |||
|- | |||
type | | '''<type>''' || lin | ||
factor | |- | ||
offset | | '''<factor>''' || 1.0 | ||
min | |- | ||
max | | '''<offset>''' || 0.0 for volume, 1.0 for pitch | ||
|- | |||
| '''<min>''' || 0.0 | |||
|- | |||
| '''<max>''' || 0.0 (don't check) | |||
|} | |||
Calculations are made the following way (for both pitch and volume): | Calculations are made the following way (for both pitch and volume): | ||
< | <syntaxhighlight lang="cpp"> | ||
value = 0; | |||
offs = 0; | |||
for (n = 0; n < max; n++) { | |||
if (factor < 0) { | |||
value += offset[n] - abs(factor[n]) * function(property[n]); | |||
} else { | |||
value += factor[n] * function(property[n]); | |||
offs += offset[n]; | |||
} | |||
} | |||
volume = offs + value; | |||
</ | </syntaxhighlight> | ||
where function can be one of: lin, ln, log, inv, abs or sqrt | where function can be one of: lin, ln, log, inv, abs or sqrt | ||