PianoRoll: fix odd time signature issues (bugs #274 and #172 at SF)

Porting a few oneliners over from Sourceforge. These should be pretty obvious:
- A cast makes divisions go right in drawing the grid.
- A whole note has the same length regardless of the time signature.