more RSClient refactoring
This commit is contained in:
@@ -35,42 +35,50 @@ public class Instrument {
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field413;
|
||||
@Export("pitch")
|
||||
SoundEnvelope pitch;
|
||||
@ObfuscatedName("f")
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field414;
|
||||
@Export("volume")
|
||||
SoundEnvelope volume;
|
||||
@ObfuscatedName("q")
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field415;
|
||||
@Export("pitchModifier")
|
||||
SoundEnvelope pitchModifier;
|
||||
@ObfuscatedName("w")
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field416;
|
||||
@Export("pitchModifierAmplitude")
|
||||
SoundEnvelope pitchModifierAmplitude;
|
||||
@ObfuscatedName("o")
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field417;
|
||||
@Export("volumeMultiplier")
|
||||
SoundEnvelope volumeMultiplier;
|
||||
@ObfuscatedName("u")
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field418;
|
||||
@Export("volumeMultiplierAmplitude")
|
||||
SoundEnvelope volumeMultiplierAmplitude;
|
||||
@ObfuscatedName("g")
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field419;
|
||||
@Export("release")
|
||||
SoundEnvelope release;
|
||||
@ObfuscatedName("l")
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field420;
|
||||
@Export("attack")
|
||||
SoundEnvelope attack;
|
||||
@ObfuscatedName("e")
|
||||
@Export("oscillatorVolume")
|
||||
int[] oscillatorVolume;
|
||||
@@ -96,7 +104,8 @@ public class Instrument {
|
||||
@ObfuscatedSignature(
|
||||
signature = "Lde;"
|
||||
)
|
||||
SoundEnvelope field421;
|
||||
@Export("filterEnvelope")
|
||||
SoundEnvelope filterEnvelope;
|
||||
@ObfuscatedName("z")
|
||||
@Export("duration")
|
||||
int duration;
|
||||
@@ -122,26 +131,26 @@ public class Instrument {
|
||||
return Instrument_samples;
|
||||
} else {
|
||||
double var3 = (double)var1 / ((double)var2 + 0.0D);
|
||||
this.field413.reset();
|
||||
this.field414.reset();
|
||||
this.pitch.reset();
|
||||
this.volume.reset();
|
||||
int var5 = 0;
|
||||
int var6 = 0;
|
||||
int var7 = 0;
|
||||
if (this.field415 != null) {
|
||||
this.field415.reset();
|
||||
this.field416.reset();
|
||||
var5 = (int)((double)(this.field415.end - this.field415.start) * 32.768D / var3);
|
||||
var6 = (int)((double)this.field415.start * 32.768D / var3);
|
||||
if (this.pitchModifier != null) {
|
||||
this.pitchModifier.reset();
|
||||
this.pitchModifierAmplitude.reset();
|
||||
var5 = (int)((double)(this.pitchModifier.end - this.pitchModifier.start) * 32.768D / var3);
|
||||
var6 = (int)((double)this.pitchModifier.start * 32.768D / var3);
|
||||
}
|
||||
|
||||
int var8 = 0;
|
||||
int var9 = 0;
|
||||
int var10 = 0;
|
||||
if (this.field417 != null) {
|
||||
this.field417.reset();
|
||||
this.field418.reset();
|
||||
var8 = (int)((double)(this.field417.end - this.field417.start) * 32.768D / var3);
|
||||
var9 = (int)((double)this.field417.start * 32.768D / var3);
|
||||
if (this.volumeMultiplier != null) {
|
||||
this.volumeMultiplier.reset();
|
||||
this.volumeMultiplierAmplitude.reset();
|
||||
var8 = (int)((double)(this.volumeMultiplier.end - this.volumeMultiplier.start) * 32.768D / var3);
|
||||
var9 = (int)((double)this.volumeMultiplier.start * 32.768D / var3);
|
||||
}
|
||||
|
||||
int var11;
|
||||
@@ -150,8 +159,8 @@ public class Instrument {
|
||||
Instrument_phases[var11] = 0;
|
||||
Instrument_delays[var11] = (int)((double)this.oscillatorDelays[var11] * var3);
|
||||
Instrument_volumeSteps[var11] = (this.oscillatorVolume[var11] << 14) / 100;
|
||||
Instrument_pitchSteps[var11] = (int)((double)(this.field413.end - this.field413.start) * 32.768D * Math.pow(1.0057929410678534D, (double)this.oscillatorPitch[var11]) / var3);
|
||||
Instrument_pitchBaseSteps[var11] = (int)((double)this.field413.start * 32.768D / var3);
|
||||
Instrument_pitchSteps[var11] = (int)((double)(this.pitch.end - this.pitch.start) * 32.768D * Math.pow(1.0057929410678534D, (double)this.oscillatorPitch[var11]) / var3);
|
||||
Instrument_pitchBaseSteps[var11] = (int)((double)this.pitch.start * 32.768D / var3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,19 +170,19 @@ public class Instrument {
|
||||
int var15;
|
||||
int[] var16;
|
||||
for (var11 = 0; var11 < var1; ++var11) {
|
||||
var12 = this.field413.doStep(var1);
|
||||
var13 = this.field414.doStep(var1);
|
||||
if (this.field415 != null) {
|
||||
var14 = this.field415.doStep(var1);
|
||||
var15 = this.field416.doStep(var1);
|
||||
var12 += this.evaluateWave(var7, var15, this.field415.form) >> 1;
|
||||
var12 = this.pitch.doStep(var1);
|
||||
var13 = this.volume.doStep(var1);
|
||||
if (this.pitchModifier != null) {
|
||||
var14 = this.pitchModifier.doStep(var1);
|
||||
var15 = this.pitchModifierAmplitude.doStep(var1);
|
||||
var12 += this.evaluateWave(var7, var15, this.pitchModifier.form) >> 1;
|
||||
var7 = var7 + var6 + (var14 * var5 >> 16);
|
||||
}
|
||||
|
||||
if (this.field417 != null) {
|
||||
var14 = this.field417.doStep(var1);
|
||||
var15 = this.field418.doStep(var1);
|
||||
var13 = var13 * ((this.evaluateWave(var10, var15, this.field417.form) >> 1) + 32768) >> 15;
|
||||
if (this.volumeMultiplier != null) {
|
||||
var14 = this.volumeMultiplier.doStep(var1);
|
||||
var15 = this.volumeMultiplierAmplitude.doStep(var1);
|
||||
var13 = var13 * ((this.evaluateWave(var10, var15, this.volumeMultiplier.form) >> 1) + 32768) >> 15;
|
||||
var10 = var10 + var9 + (var14 * var8 >> 16);
|
||||
}
|
||||
|
||||
@@ -182,7 +191,7 @@ public class Instrument {
|
||||
var15 = Instrument_delays[var14] + var11;
|
||||
if (var15 < var1) {
|
||||
var16 = Instrument_samples;
|
||||
var16[var15] += this.evaluateWave(Instrument_phases[var14], var13 * Instrument_volumeSteps[var14] >> 15, this.field413.form);
|
||||
var16[var15] += this.evaluateWave(Instrument_phases[var14], var13 * Instrument_volumeSteps[var14] >> 15, this.pitch.form);
|
||||
var16 = Instrument_phases;
|
||||
var16[var14] += (var12 * Instrument_pitchSteps[var14] >> 16) + Instrument_pitchBaseSteps[var14];
|
||||
}
|
||||
@@ -191,20 +200,20 @@ public class Instrument {
|
||||
}
|
||||
|
||||
int var17;
|
||||
if (this.field419 != null) {
|
||||
this.field419.reset();
|
||||
this.field420.reset();
|
||||
if (this.release != null) {
|
||||
this.release.reset();
|
||||
this.attack.reset();
|
||||
var11 = 0;
|
||||
boolean var18 = false;
|
||||
boolean var19 = true;
|
||||
|
||||
for (var14 = 0; var14 < var1; ++var14) {
|
||||
var15 = this.field419.doStep(var1);
|
||||
var17 = this.field420.doStep(var1);
|
||||
var15 = this.release.doStep(var1);
|
||||
var17 = this.attack.doStep(var1);
|
||||
if (var19) {
|
||||
var12 = (var15 * (this.field419.end - this.field419.start) >> 8) + this.field419.start;
|
||||
var12 = (var15 * (this.release.end - this.release.start) >> 8) + this.release.start;
|
||||
} else {
|
||||
var12 = (var17 * (this.field419.end - this.field419.start) >> 8) + this.field419.start;
|
||||
var12 = (var17 * (this.release.end - this.release.start) >> 8) + this.release.start;
|
||||
}
|
||||
|
||||
var11 += 256;
|
||||
@@ -228,11 +237,11 @@ public class Instrument {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.filter.field36[0] > 0 || this.filter.field36[1] > 0) {
|
||||
this.field421.reset();
|
||||
var11 = this.field421.doStep(var1 + 1);
|
||||
var12 = this.filter.method26(0, (float)var11 / 65536.0F);
|
||||
var13 = this.filter.method26(1, (float)var11 / 65536.0F);
|
||||
if (this.filter.pairs[0] > 0 || this.filter.pairs[1] > 0) {
|
||||
this.filterEnvelope.reset();
|
||||
var11 = this.filterEnvelope.doStep(var1 + 1);
|
||||
var12 = this.filter.compute(0, (float)var11 / 65536.0F);
|
||||
var13 = this.filter.compute(1, (float)var11 / 65536.0F);
|
||||
if (var1 >= var12 + var13) {
|
||||
var14 = 0;
|
||||
var15 = var13;
|
||||
@@ -242,18 +251,18 @@ public class Instrument {
|
||||
|
||||
int var20;
|
||||
while (var14 < var15) {
|
||||
var17 = (int)((long)Instrument_samples[var14 + var12] * (long)AudioFilter.field35 >> 16);
|
||||
var17 = (int)((long)Instrument_samples[var14 + var12] * (long)AudioFilter.forwardMultiplier >> 16);
|
||||
|
||||
for (var20 = 0; var20 < var12; ++var20) {
|
||||
var17 += (int)((long)Instrument_samples[var14 + var12 - 1 - var20] * (long)AudioFilter.field33[0][var20] >> 16);
|
||||
var17 += (int)((long)Instrument_samples[var14 + var12 - 1 - var20] * (long)AudioFilter.coefficients[0][var20] >> 16);
|
||||
}
|
||||
|
||||
for (var20 = 0; var20 < var14; ++var20) {
|
||||
var17 -= (int)((long)Instrument_samples[var14 - 1 - var20] * (long)AudioFilter.field33[1][var20] >> 16);
|
||||
var17 -= (int)((long)Instrument_samples[var14 - 1 - var20] * (long)AudioFilter.coefficients[1][var20] >> 16);
|
||||
}
|
||||
|
||||
Instrument_samples[var14] = var17;
|
||||
var11 = this.field421.doStep(var1 + 1);
|
||||
var11 = this.filterEnvelope.doStep(var1 + 1);
|
||||
++var14;
|
||||
}
|
||||
|
||||
@@ -266,18 +275,18 @@ public class Instrument {
|
||||
|
||||
int var21;
|
||||
while (var14 < var15) {
|
||||
var20 = (int)((long)Instrument_samples[var14 + var12] * (long)AudioFilter.field35 >> 16);
|
||||
var20 = (int)((long)Instrument_samples[var14 + var12] * (long)AudioFilter.forwardMultiplier >> 16);
|
||||
|
||||
for (var21 = 0; var21 < var12; ++var21) {
|
||||
var20 += (int)((long)Instrument_samples[var14 + var12 - 1 - var21] * (long)AudioFilter.field33[0][var21] >> 16);
|
||||
var20 += (int)((long)Instrument_samples[var14 + var12 - 1 - var21] * (long)AudioFilter.coefficients[0][var21] >> 16);
|
||||
}
|
||||
|
||||
for (var21 = 0; var21 < var13; ++var21) {
|
||||
var20 -= (int)((long)Instrument_samples[var14 - 1 - var21] * (long)AudioFilter.field33[1][var21] >> 16);
|
||||
var20 -= (int)((long)Instrument_samples[var14 - 1 - var21] * (long)AudioFilter.coefficients[1][var21] >> 16);
|
||||
}
|
||||
|
||||
Instrument_samples[var14] = var20;
|
||||
var11 = this.field421.doStep(var1 + 1);
|
||||
var11 = this.filterEnvelope.doStep(var1 + 1);
|
||||
++var14;
|
||||
}
|
||||
|
||||
@@ -286,22 +295,22 @@ public class Instrument {
|
||||
var20 = 0;
|
||||
|
||||
for (var21 = var14 + var12 - var1; var21 < var12; ++var21) {
|
||||
var20 += (int)((long)Instrument_samples[var14 + var12 - 1 - var21] * (long)AudioFilter.field33[0][var21] >> 16);
|
||||
var20 += (int)((long)Instrument_samples[var14 + var12 - 1 - var21] * (long)AudioFilter.coefficients[0][var21] >> 16);
|
||||
}
|
||||
|
||||
for (var21 = 0; var21 < var13; ++var21) {
|
||||
var20 -= (int)((long)Instrument_samples[var14 - 1 - var21] * (long)AudioFilter.field33[1][var21] >> 16);
|
||||
var20 -= (int)((long)Instrument_samples[var14 - 1 - var21] * (long)AudioFilter.coefficients[1][var21] >> 16);
|
||||
}
|
||||
|
||||
Instrument_samples[var14] = var20;
|
||||
this.field421.doStep(var1 + 1);
|
||||
this.filterEnvelope.doStep(var1 + 1);
|
||||
++var14;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var12 = this.filter.method26(0, (float)var11 / 65536.0F);
|
||||
var13 = this.filter.method26(1, (float)var11 / 65536.0F);
|
||||
var12 = this.filter.compute(0, (float)var11 / 65536.0F);
|
||||
var13 = this.filter.compute(1, (float)var11 / 65536.0F);
|
||||
var15 += 128;
|
||||
}
|
||||
}
|
||||
@@ -333,55 +342,55 @@ public class Instrument {
|
||||
)
|
||||
@Export("decode")
|
||||
final void decode(Buffer buffer) {
|
||||
this.field413 = new SoundEnvelope();
|
||||
this.field413.decode(buffer);
|
||||
this.field414 = new SoundEnvelope();
|
||||
this.field414.decode(buffer);
|
||||
this.pitch = new SoundEnvelope();
|
||||
this.pitch.decode(buffer);
|
||||
this.volume = new SoundEnvelope();
|
||||
this.volume.decode(buffer);
|
||||
int var2 = buffer.readUnsignedByte();
|
||||
if (var2 != 0) {
|
||||
--buffer.index;
|
||||
this.field415 = new SoundEnvelope();
|
||||
this.field415.decode(buffer);
|
||||
this.field416 = new SoundEnvelope();
|
||||
this.field416.decode(buffer);
|
||||
this.pitchModifier = new SoundEnvelope();
|
||||
this.pitchModifier.decode(buffer);
|
||||
this.pitchModifierAmplitude = new SoundEnvelope();
|
||||
this.pitchModifierAmplitude.decode(buffer);
|
||||
}
|
||||
|
||||
var2 = buffer.readUnsignedByte();
|
||||
if (var2 != 0) {
|
||||
--buffer.index;
|
||||
this.field417 = new SoundEnvelope();
|
||||
this.field417.decode(buffer);
|
||||
this.field418 = new SoundEnvelope();
|
||||
this.field418.decode(buffer);
|
||||
this.volumeMultiplier = new SoundEnvelope();
|
||||
this.volumeMultiplier.decode(buffer);
|
||||
this.volumeMultiplierAmplitude = new SoundEnvelope();
|
||||
this.volumeMultiplierAmplitude.decode(buffer);
|
||||
}
|
||||
|
||||
var2 = buffer.readUnsignedByte();
|
||||
if (var2 != 0) {
|
||||
--buffer.index;
|
||||
this.field419 = new SoundEnvelope();
|
||||
this.field419.decode(buffer);
|
||||
this.field420 = new SoundEnvelope();
|
||||
this.field420.decode(buffer);
|
||||
this.release = new SoundEnvelope();
|
||||
this.release.decode(buffer);
|
||||
this.attack = new SoundEnvelope();
|
||||
this.attack.decode(buffer);
|
||||
}
|
||||
|
||||
for (int var3 = 0; var3 < 10; ++var3) {
|
||||
int var4 = buffer.method48();
|
||||
int var4 = buffer.readUShortSmart();
|
||||
if (var4 == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
this.oscillatorVolume[var3] = var4;
|
||||
this.oscillatorPitch[var3] = buffer.method47();
|
||||
this.oscillatorDelays[var3] = buffer.method48();
|
||||
this.oscillatorPitch[var3] = buffer.readShortSmart();
|
||||
this.oscillatorDelays[var3] = buffer.readUShortSmart();
|
||||
}
|
||||
|
||||
this.delayTime = buffer.method48();
|
||||
this.delayDecay = buffer.method48();
|
||||
this.delayTime = buffer.readUShortSmart();
|
||||
this.delayDecay = buffer.readUShortSmart();
|
||||
this.duration = buffer.readUnsignedShort();
|
||||
this.offset = buffer.readUnsignedShort();
|
||||
this.filter = new AudioFilter();
|
||||
this.field421 = new SoundEnvelope();
|
||||
this.filter.method27(buffer, this.field421);
|
||||
this.filterEnvelope = new SoundEnvelope();
|
||||
this.filter.method27(buffer, this.filterEnvelope);
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
Reference in New Issue
Block a user