*/
public int getDuration() {
if (!hasNoteOffEvent()) return 0;
- return (int)(getTick() - noteOffEvent.getTick());
+ return (int)(noteOffEvent.getTick() - getTick());
}
/**
// Moves the note element to the appropriate place.
x = insets.left;
y = insets.top + (int)(mn.getTick() / 24) * NOTE_HEIGHT;
- height = NOTE_HEIGHT;
- // height = (mn.getDuration() / 24) * NOTE_HEIGHT;
+ height = (mn.getDuration() / 24) * NOTE_HEIGHT;
+ if (height == 0) height = NOTE_HEIGHT;
Rectangle r = new Rectangle(x, y, NOTE_WIDTH, height);
while(isOccupied(r)) r.translate(NOTE_WIDTH, 0);
elem.setBounds(r);