public int GetSoundCode(int i, int j) { Tile tile = Main.tile[i, j]; int styleX = tile.frameX / 18; int styleY = tile.frameY / 18; return(PitchHelper.EncodeSoundCode((int)EPitchType.Piano, styleY + 3, styleX + 1)); }
public int GetSoundCode(int i, int j) { Tile tile = Main.tile[i, j]; int keyIndex = MicroKeyboardPitchMap[tile.frameX / 18 + tile.frameY / 18 * 4]; if (keyIndex == 13) { return(PitchHelper.EncodeSoundCode((int)EPitchType.Piano, 5, 1)); } return(PitchHelper.EncodeSoundCode((int)EPitchType.Piano, 4, keyIndex)); }
public void PlayPianoSound(int keyIndex) { if (keyIndex < keyRange) { int soundCode; if (keyIndex < 7) { soundCode = PitchHelper.EncodeSoundCode(1, 3, KeyIndex2Pitch[keyIndex] + 12); } else if (keyIndex < 14) { soundCode = PitchHelper.EncodeSoundCode(1, 4, KeyIndex2Pitch[keyIndex]); } else { soundCode = PitchHelper.EncodeSoundCode(1, 5, KeyIndex2Pitch[keyIndex] - 12); } PitchHelper.PlaySound(ModLoader.GetMod("Pianist"), soundCode); Main.NewText("PlayPianoSound " + keyIndex); } }