mostly indent

This commit is contained in:
Gordon JC Pearce 2024-12-31 15:13:28 +00:00
parent 1c3c6adf3c
commit d07b50491b

View File

@ -73,7 +73,7 @@ void Synth::run() {
// noise[i] = (1 - (tr21 & 0x00ffffff) / 8388608.0f) * (patchRam.noiseLevel * 0.0063);
}
//printf("updating\n");
// printf("updating\n");
for (uint8_t i = 0; i < NUM_VOICES; i++) {
voices[i].update();
@ -163,6 +163,7 @@ Voice::Voice() {
}
void Voice::calcPitch() {
uint16_t ea;
uint16_t target = note << 8;
// Portamento is a linear change of pitch - it'll take twice as long
@ -171,7 +172,7 @@ void Voice::calcPitch() {
// This is implemented here by adding on a step value until you pass
// the desired final pitch. Once that happens the value is clamped to the
// desired pitch.
/*
if (ic29.portaCoeff != 0) {
// portamento up
if (pitch < target) {
@ -187,27 +188,26 @@ void Voice::calcPitch() {
pitch = target;
}
pitch += ic29.masterPitch;
ea = pitch + ic29.masterPitch;
if (pitch < 0x3000) pitch = 0x3000; // lowest note
if (pitch > 0x9700) pitch = 0x6700; // highest note
if (ea < 0x3000) ea = 0x3000; // lowest note
if (ea > 0x9700) ea = 0x6700; // highest note
pitch -= 0x3000;
ea -= 0x3000;
// interpolate between the two table values
double o1 = ic29.pitchTable[pitch >> 8];
double o2 = ic29.pitchTable[(pitch >> 8) + 1];
double frac = (pitch & 0xff) / 256.0f;
double o1 = ic29.pitchTable[ea >> 8];
double o2 = ic29.pitchTable[(ea >> 8) + 1];
double frac = (ea & 0xff) / 256.0f;
omega = ((o2 - o1) * frac) + o1;
*/
}
void Voice::update() {
// calculate the once-per-block values
env.run();
calcPitch();
//printf("env=%04x\n", env.level);
// printf("env=%04x\n", env.level);
/*
pw = (patchRam.switch1 & 0x08) ? ic29.pwm : 0.0f;
saw = (ic29.patchRam.switch1 & 0x10) ? 1.0f : 0.0f;