示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
 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);
     }
 }