fix #25340
This commit is contained in:
parent
d2405f0e8d
commit
d995222b65
2 changed files with 16 additions and 13 deletions
|
@ -718,7 +718,9 @@ void Score::putNote(const Position& p, bool replace)
|
|||
AccidentalVal acci = s->measure()->findAccidental(s, staffIdx, line);
|
||||
int step = absStep(line, clef);
|
||||
int octave = step/7;
|
||||
nval.pitch = step2pitch(step) + octave * 12 + acci + instr->transpose().chromatic;
|
||||
nval.pitch = step2pitch(step) + octave * 12 + acci;
|
||||
if (!styleB(ST_concertPitch))
|
||||
nval.pitch += instr->transpose().chromatic;
|
||||
nval.tpc = step2tpc(step % 7, acci);
|
||||
}
|
||||
break;
|
||||
|
@ -814,8 +816,10 @@ void Score::repitchNote(const Position& p, bool replace)
|
|||
AccidentalVal acci = s->measure()->findAccidental(s, p.staffIdx, p.line);
|
||||
int step = absStep(p.line, clef);
|
||||
int octave = step / 7;
|
||||
nval.pitch = step2pitch(step) + octave * 12 + acci + st->part()->instr(s->tick())->transpose().chromatic;
|
||||
nval.tpc = step2tpc(step % 7, acci);
|
||||
nval.pitch = step2pitch(step) + octave * 12 + acci;
|
||||
if (!styleB(ST_concertPitch))
|
||||
nval.pitch += st->part()->instr(s->tick())->transpose().chromatic;
|
||||
nval.tpc = step2tpc(step % 7, acci);
|
||||
|
||||
Chord* chord;
|
||||
if (_is.cr()->type() == Element::REST) { //skip rests
|
||||
|
|
|
@ -4787,26 +4787,26 @@ void ScoreView::cmdAddPitch(int note, bool addFlag)
|
|||
Element* el = score()->selection().element();
|
||||
if (addFlag && el && el->type() == Element::NOTE) {
|
||||
Chord* chord = static_cast<Note*>(el)->chord();
|
||||
Note * n = chord->upNote();
|
||||
Note* n = chord->upNote();
|
||||
octave = n->pitch() / 12;
|
||||
if (note < n->pitch() / (octave * 7))
|
||||
octave++;
|
||||
}
|
||||
else {
|
||||
int curPitch = -1;
|
||||
if(is.segment()) {
|
||||
if (is.segment()) {
|
||||
Staff* staff = score()->staff(is.track() / VOICES);
|
||||
Segment* seg = is.segment()->prev1(Segment::SegChordRest | Segment::SegClef);
|
||||
while(seg) {
|
||||
if(seg->segmentType() == Segment::SegChordRest) {
|
||||
if (seg->segmentType() == Segment::SegChordRest) {
|
||||
Element* p = seg->element(is.track());
|
||||
if(p && p->type() == Element::CHORD) {
|
||||
if (p && p->type() == Element::CHORD) {
|
||||
Chord* ch = static_cast<Chord*>(p);
|
||||
curPitch = ch->downNote()->pitch();
|
||||
curPitch = ch->downNote()->epitch();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(seg->segmentType() == Segment::SegClef) {
|
||||
else if (seg->segmentType() == Segment::SegClef) {
|
||||
Element* p = seg->element( (is.track() / VOICES) * VOICES); // clef on voice 1
|
||||
if(p && p->type() == Element::CLEF) {
|
||||
Clef* clef = static_cast<Clef*>(p);
|
||||
|
@ -4820,7 +4820,7 @@ void ScoreView::cmdAddPitch(int note, bool addFlag)
|
|||
}
|
||||
seg = seg->prev1(Segment::SegChordRest | Segment::SegClef);
|
||||
}
|
||||
octave = curPitch / 12;
|
||||
octave = curPitch / 12;
|
||||
}
|
||||
|
||||
static const int tab[] = { 0, 2, 4, 5, 7, 9, 11 };
|
||||
|
@ -4849,9 +4849,8 @@ void ScoreView::cmdAddPitch(int note, bool addFlag)
|
|||
Chord* chord = static_cast<Note*>(el)->chord();
|
||||
NoteVal val;
|
||||
val.pitch = line2pitch(pos.line, clef, 0);
|
||||
// val.tpc = INVALID_TPC;
|
||||
// val.fret = FRET_NONE;
|
||||
// val.string = STRING_NONE;
|
||||
if (!chord->concertPitch())
|
||||
val.pitch += chord->staff()->part()->instr()->transpose().chromatic;
|
||||
_score->addNote(chord, val);
|
||||
_score->endCmd();
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue