Exemplo n.º 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;
                }
            }
        }
Exemplo n.º 2
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;
                }

            }
        }