From 7762fa47eac8ca7d18324cc19792bbee65a9ff91 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 14 Nov 2023 11:05:13 -0700 Subject: [PATCH] make an attempt to show note length with verbose cursor Likely much more intelligent string formatting is needed to make this actually useful to most people --- gtk2_ardour/midi_region_view.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 2be350910d..f8ecbf6a1b 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -4563,11 +4563,12 @@ MidiRegionView::get_note_name (std::shared_ptr n, uint8_t note_value) } char buf[128]; - snprintf (buf, sizeof (buf), "%s #%d\nCh %d Vel %d", + snprintf (buf, sizeof (buf), "%s #%d\nCh %d Vel %d\n%.3f beats", name.empty() ? ParameterDescriptor::midi_note_name (note_value).c_str() : name.c_str(), (int) note_value, (int) n->channel() + 1, - (int) n->velocity()); //we display velocity 0-based; velocity 0 is a 'note-off' so the user just sees values 1..127 which 'looks' 1-based + (int) n->velocity(), //we display velocity 0-based; velocity 0 is a 'note-off' so the user just sees values 1..127 which 'looks' 1-based + n->length().get_beats() + (n->length().get_ticks()/(float)Temporal::ticks_per_beat)); return buf; }