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; } } }
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; } } }