double beatsOfFigure(Figure figure, String time) { if (time == '6/8') return figure.eighths.toDouble(); return figure.eighths / 2.0; }