+static double
+note_height(TimeAxisView& trackview, MidiStreamView* mv)
+{
+ const double tv_height = trackview.current_height();
+ const double note_range = mv->contents_note_range();
+
+ return std::max(1.0, floor(tv_height / note_range - 1.0));
+}
+
+static double
+note_y(TimeAxisView& trackview, MidiStreamView* mv, uint8_t note_num)
+{
+ const double tv_height = trackview.current_height();
+ const double note_range = mv->contents_note_range();
+ const double s = tv_height / note_range;
+
+ return tv_height - (note_num + 1 - mv->lowest_note()) * s;
+}
+