+bool
+GenericPluginUI::midinote_printer (char buf[32], Adjustment &adj, ControlUI* cui)
+{
+ float const v = adj.get_value ();
+
+ if (cui->scale_points) {
+ Plugin::ScalePoints::const_iterator i = cui->scale_points->begin ();
+ while (i != cui->scale_points->end() && i->second != v) {
+ ++i;
+ }
+
+ if (i != cui->scale_points->end ()) {
+ snprintf (buf, 32, "%s", i->first.c_str());
+ return true;
+ }
+ }
+ if (v >= 0 && v <= 127) {
+ int mn = rint(v);
+ const char notename[12][3] = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
+ snprintf (buf, 32, "%s %d", notename[mn%12], (mn/12)-2);
+ } else {
+ snprintf (buf, 32, "%.0f", v);
+ }
+ return true;
+}
+