Skip to content

Commit

Permalink
add staff y position to pitch visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
dfober committed Dec 7, 2023
1 parent 041f750 commit 87d18b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/engine/lib/GUIDOEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,11 @@ GUIDOAPI GuidoErrCode GuidoAR2GR( ARHandler ar, const GuidoLayoutSettings * sett
GuidoDate date;
date.num = 3;
date.denom = 1;
GuidoErrCode err = GuidoGetPitchPos (grh, 1, 60, date, x, y);
if (err != guidoNoErr)
cerr << "GuidoAR2GR GuidoGetPitchPos err " << err << endl;
else
cerr << "GuidoAR2GR GuidoGetPitchPos at " << date << " : " << x << " " << y << endl;
// GuidoErrCode err = GuidoGetPitchPos (grh, 1, 60, date, x, y);
// if (err != guidoNoErr)
//cerr << "GuidoAR2GR GuidoGetPitchPos err " << err << endl;
//else
//cerr << "GuidoAR2GR GuidoGetPitchPos at " << date << " : " << x << " " << y << endl;
return guidoNoErr;
}

Expand Down
4 changes: 2 additions & 2 deletions src/engine/operations/GRPitchYVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ NVPoint GRPitchYVisitor::getPitchPos (GRMusic* music, int staffNum, int midipitc
int oct = (midipitch / 12) - 4;
int pitch = midipitch % 12;
pitch = ((pitch < 5) ? (pitch / 2) : (pitch+1) / 2) + 2;
//cerr << "GRPitchYVisitor::getPitchPos " << pitch << " " << oct << " date: " << date << endl;
float y = fStaff->getNotePosition ( pitch, oct, fBasePitch, fBaseLine, fBaseOct);
//cerr << "GRPitchYVisitor::getPitchPos " << pitch << " " << oct << " date: " << date << " staff y " << fStaff->getPosition() << endl;
float y = fStaff->getNotePosition ( pitch, oct, fBasePitch, fBaseLine, fBaseOct) + fStaff->getPosition().y;
p.x = fLastX;
p.y = y;
}
Expand Down

0 comments on commit 87d18b3

Please sign in to comment.