From 2e62ca9631286df44a42f250323c5eb9775a8aee Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 29 Dec 2014 20:18:57 -0500 Subject: Fix off-by-one MIDI note names. Much like everything else in midnam, it's not specified whether the numbers are 0 or 1 relative, but everything out there seems to be 0 relative and this matches the canvas, so go with that. --- libs/midi++2/midnam_patch.cc | 6 +- patchfiles/Casio_CZ-1.midnam | 130 ------------------------------------- patchfiles/Korg_Volca_Beats.midnam | 20 +++--- 3 files changed, 13 insertions(+), 143 deletions(-) diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc index e69842e6cd..55e7ac1898 100644 --- a/libs/midi++2/midnam_patch.cc +++ b/libs/midi++2/midnam_patch.cc @@ -151,7 +151,7 @@ XMLNode& Note::get_state (void) { XMLNode* node = new XMLNode("Note"); - node->add_property("Number", _number + 1); + node->add_property("Number", _number); node->add_property("Name", _name); return *node; @@ -163,14 +163,14 @@ Note::set_state (const XMLTree& tree, const XMLNode& node) assert(node.name() == "Note"); const int num = string_to_int(tree, node.property("Number")->value()); - if (num < 1 || num > 128) { + if (num > 127) { PBD::warning << string_compose("%1: Note number %2 (%3) out of range", tree.filename(), num, _name) << endmsg; return -1; } - _number = num - 1; + _number = num; _name = node.property("Name")->value(); return 0; diff --git a/patchfiles/Casio_CZ-1.midnam b/patchfiles/Casio_CZ-1.midnam index 9d30efc3b0..776d91550d 100644 --- a/patchfiles/Casio_CZ-1.midnam +++ b/patchfiles/Casio_CZ-1.midnam @@ -113,135 +113,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/patchfiles/Korg_Volca_Beats.midnam b/patchfiles/Korg_Volca_Beats.midnam index 2357936329..b3be55ab9c 100644 --- a/patchfiles/Korg_Volca_Beats.midnam +++ b/patchfiles/Korg_Volca_Beats.midnam @@ -21,16 +21,16 @@ - - - - - - - - - - + + + + + + + + + + -- cgit v1.2.3