Skip to content

Commit

Permalink
Corrected NRPN wrong displayed values
Browse files Browse the repository at this point in the history
Replaced splash screen png with svg version
  • Loading branch information
abrolag committed Sep 9, 2017
1 parent 48b6482 commit d0a7949
Show file tree
Hide file tree
Showing 7 changed files with 2,437 additions and 11 deletions.
5 changes: 5 additions & 0 deletions Changelog
@@ -1,5 +1,10 @@
yoshimi 1.5.3 M

2017-9-9 Will
* Corrected NRPN wrong displayed values.
Actual values were quite correct.
* Replaced splash screen png with svg version.

2017-9-8 Will
* Most of envelopes transferred.
Only graph points to do.
Expand Down
Binary file removed Util/YoshimiSplash.png
Binary file not shown.
2,408 changes: 2,408 additions & 0 deletions Util/YoshimiSplash.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/Interface/MidiDecode.cpp
Expand Up @@ -17,7 +17,7 @@
yoshimi; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
Modified July 2017
Modified September 2017
*/

#include <iostream>
Expand Down Expand Up @@ -489,7 +489,7 @@ void MidiDecode::nrpnProcessData(unsigned char chan, int type, int par, bool in_

if (nHigh != 64 && nLow < 0x7f)
{
synth->getRuntime().Log("Go away NRPN 0x" + asHexString(nHigh >> 1) + asHexString(nLow) +" We don't know you!");
synth->getRuntime().Log("Go away NRPN 0x" + asHexString(nHigh) + " " + asHexString(nLow) +" We don't know you!");
//done this way to ensure we see both bytes even if nHigh is zero
synth->getRuntime().nrpnActive = false; // we were sent a turkey!
return;
Expand Down
20 changes: 14 additions & 6 deletions src/Interface/MidiLearn.cpp
Expand Up @@ -17,7 +17,7 @@
yoshimi; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
Modified August 2017
Modified September 2017
*/

#include <iostream>
Expand Down Expand Up @@ -681,10 +681,10 @@ void MidiLearn::insert(unsigned int CC, unsigned char chan)
unsigned int CCh = entry.CC;
string CCtype;
if (CCh < 0xff)
CCtype = to_string(CCh);
CCtype = "CC " + to_string(CCh);
else
CCtype = asHexString((CCh >> 8) & 0x7f) + asHexString(CCh & 0x7f) + " h";
synth->getRuntime().Log("CC " + CCtype + " Chan " + to_string((int)entry.chan + 1) + " " + entry.name);
CCtype = "NRPN " + asHexString((CCh >> 7) & 0x7f) + " " + asHexString(CCh & 0x7f);
synth->getRuntime().Log(CCtype + " Chan " + to_string((int)entry.chan + 1) + " " + entry.name);
updateGui(1);
learning = false;
}
Expand Down Expand Up @@ -765,7 +765,7 @@ void MidiLearn::updateGui(int opp)
if (newCC > 0xff || (it->status & 8) > 0)
{ // status now used in case NRPN is < 0x100
putData.data.control = 9; // it's an NRPN
putData.data.engine = ((newCC >> 8) & 0x7f);
putData.data.engine = ((newCC >> 8) & 0xff);
writeToGui(&putData);
}
++it;
Expand Down Expand Up @@ -830,7 +830,15 @@ bool MidiLearn::insertMidiListData(bool full, XMLwrapper *xml)
xml->addparbool("Mute", (it->status & 4) > 0);
xml->addparbool("NRPN", (it->status & 8) > 0);
xml->addparbool("7_bit", (it->status & 16) > 0);
xml->addpar("Midi_Controller", it->CC & 0x7fff); // clear out top bit
xml->addpar("Midi_Controller", it->CC & 0x7fff);
/*
* Clear out top bit - NRPN marker
* Yoshimi NRPNs are internally stored as
* integers in 'CC', not MIDI 14 bit pairs.
* A high bit marker is added to identify these.
* For user display they are split and shown as
* MSB and LSB.
*/
xml->addpar("Midi_Channel", it->chan);
xml->addparreal("Midi_Min", it->min_in / 1.575f);
xml->addparreal("Midi_Max", it->max_in / 1.575f);
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/ConfBuild.cpp
Expand Up @@ -3,4 +3,4 @@
*/

#define BUILD_NUMBER 1124
#define BUILD_NUMBER 1125
9 changes: 7 additions & 2 deletions src/UI/MidiLearnUI.fl
Expand Up @@ -24,7 +24,7 @@ You should have received a copy of the GNU General Public License along with
yoshimi; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.

Modified May 2017} {in_source in_header
Modified September 2017} {in_source in_header
}

decl {\#include <FL/fl_ask.H>
Expand Down Expand Up @@ -408,6 +408,7 @@ collect_data(synth, value, type, control, 216, kititem, engine, insert, paramete
unsigned char parameter = getData->data.parameter;
unsigned char par2 = getData->data.par2;
string hex;
int nrpnTot;
unsigned int IDold;
unsigned int IDnew;
switch(control)
Expand Down Expand Up @@ -436,7 +437,11 @@ collect_data(synth, value, type, control, 216, kititem, engine, insert, paramete
midilearnkititem[value]->maxval->value(parameter / 2.0f);
break;
case 9: // set NRPN fixed value in place
hex = (asHexString(int(engine))) + " " + (asHexString(int(kititem))) + " h";
nrpnTot = (int(engine) << 8) + (int(kititem));
/* These were stored 8 bit values so must be joined then
* split as two 7 bit values to give NRPN msb and lsb
*/
hex = (asHexString(nrpnTot >> 7)) + " " + (asHexString(nrpnTot & 0x7f));
midilearnkititem[value]->stat |= 0x10;
midilearnkititem[value]->nrpn->copy_label(hex.c_str());
midilearnkititem[value]->CCcounter->hide();
Expand Down

0 comments on commit d0a7949

Please sign in to comment.