Skip to content

Commit

Permalink
fix #41326: correct transposition of MIDI input
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Dec 12, 2014
1 parent 4ba880a commit 7db2dbb
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions libmscore/cmd.cpp
Expand Up @@ -1695,17 +1695,14 @@ bool Score::processMidiInput()
}
NoteVal nval(ev.pitch);
Staff* st = staff(inputState().track() / VOICES);
Key key = st->key(inputState().tick());

if (styleB(StyleIdx::concertPitch)) {
nval.tpc1 = pitch2tpc(nval.pitch, key, Prefer::NEAREST);
nval.tpc2 = nval.tpc1; // DEBUG
}
else {
// if transposing, interpret MIDI pitch as representing desired written pitch
// set pitch based on corresponding sounding pitch
if (!styleB(StyleIdx::concertPitch))
nval.pitch += st->part()->instr(inputState().tick())->transpose().chromatic;
nval.tpc2 = pitch2tpc(nval.pitch, key, Prefer::NEAREST);
nval.tpc1 = nval.tpc2; // DEBUG
}
// let addPitch calculate tpc values from pitch
//Key key = st->key(inputState().tick());
//nval.tpc1 = pitch2tpc(nval.pitch, key, Prefer::NEAREST);

addPitch(nval, ev.chord);
}
Expand Down

0 comments on commit 7db2dbb

Please sign in to comment.