コード例 #1
0
        public Piano(Viewport3D mainViewport, float whiteKeyWidth, float keyGap, float blackKeyWidth, float keyLength, float keyHeight, float blackKeyLengthRatio)
        {
            float runningTotalOrigin = 0;

            for (byte i = 0; i < 88; i++)
            {
                PianoKey pk = new PianoKey(mainViewport, i, runningTotalOrigin, keyLength, keyHeight, whiteKeyWidth);
                _PianoKeys.Add(pk);

                if (!pk.IsNextKeyBlack)
                {
                    runningTotalOrigin = runningTotalOrigin + whiteKeyWidth + keyGap;
                }
            }
        }
コード例 #2
0
ファイル: Piano.cs プロジェクト: hempnall/pianokeyboard
        public Piano(Viewport3D mainViewport, float whiteKeyWidth,float keyGap,float blackKeyWidth,float keyLength,float keyHeight,float blackKeyLengthRatio)
        {
            float runningTotalOrigin = 0;

            for (byte i = 0; i < 88; i++)
            {

                PianoKey pk = new PianoKey(mainViewport, i, runningTotalOrigin, keyLength, keyHeight, whiteKeyWidth);
                _PianoKeys.Add(pk);

                if ( !pk.IsNextKeyBlack  )
                {
                    runningTotalOrigin = runningTotalOrigin + whiteKeyWidth + keyGap;
                }

            }
        }