EXPORT_SYMBOL(snd_gf1_atten_table); /* for snd-gus-synth module */
unsignedshort snd_gf1_lvol_to_gvol_raw(unsignedint vol)
{ unsignedshort e, m, tmp;
if (vol > 65535)
vol = 65535;
tmp = vol;
e = 7; if (tmp < 128) { while (e > 0 && tmp < (1 << e))
e--;
} else { while (tmp > 255) {
tmp >>= 1;
e++;
}
}
m = vol - (1 << e); if (m > 0) { if (e > 8)
m >>= e - 8; elseif (e < 8)
m <<= 8 - e;
m &= 255;
} return (e << 8) | m;
}
#if 0
unsignedint snd_gf1_gvol_to_lvol_raw(unsignedshort gf1_vol)
{ unsignedint rvol; unsignedshort e, m;
if (!gf1_vol) return 0;
e = gf1_vol >> 8;
m = (unsignedchar) gf1_vol;
rvol = 1 << e; if (e > 8) return rvol | (m << (e - 8)); return rvol | (m >> (8 - e));
}
long depth; constshort *vi1, *vi2; short pcents, v1;
pcents = cents < 0 ? -cents : cents; for (vi1 = vibrato_table, vi2 = vi1 + 2; pcents > *vi2; vi1 = vi2, vi2 += 2);
v1 = *(vi1 + 1); /* The FC table above is a list of pairs. The first number in the pair */ /* is the cents index from 0-255 cents, and the second number in the */ /* pair is the FC adjustment needed to change the pitch by the indexed */ /* number of cents. The table was created for an FC of 32768. */ /* The following expression does a linear interpolation against the */ /* approximated log curve in the table above, and then scales the number */ /* by the FC before the LFO. This calculation also adjusts the output */ /* value to produce the appropriate depth for the hardware. The depth */ /* is 2 * desired FC + 1. */
depth = (((int) (*(vi2 + 1) - *vi1) * (pcents - *vi1) / (*vi2 - *vi1)) + v1) * fc_register >> 14; if (depth)
depth++; if (depth > 255)
depth = 255; return cents < 0 ? -(short) depth : (short) depth;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.