src/tool-autostem.cpp
void Tool_autostem::printNotePositions(HumdrumFile& infile,
		vector<vector<vector<int> > >& notepos) {
	vector<string> posinfo(infile.getLineCount());
	for (int i=0; i<infile.getLineCount(); i++) {
		if (!infile[i].isData()) {
			continue;
		}
		for (int j=0; j<infile[i].getFieldCount(); j++) {
			if (!infile.token(i, j)->isKern()) {
				continue;
			}
			if (infile.token(i, j)->isNull()) {
				// ignore null tokens
				continue;
			}
			if (infile.token(i, j)->isRest()) {
				// ignore rests
				continue;
			}
			for (int k=0; k<(int)notepos[i][j].size(); k++) {
				posinfo[i] += notepos[i][j][k];
			}
			if (posinfo[i].back() == ' ') {
				posinfo[i].pop_back();
			}
		}
	}
	infile.appendDataSpine(posinfo, "", "**vpos");
}
//////////////////////////////
//
// Tool_autostem::printNotePositions -- prints the vertical position of notes on the
//    staves.  Mostly for debugging purposes.  A spine at the end of the
//    data will be added containing all positions for notes on the line
//    in the sequence in which the notes occur from left to right.
//
//    The middle line of a 5-line staff is the zero position, and
//    position values are diatonic steps above or below that level:
//
//    ===== +4
//          +3
//    ===== +2
//          +1
//    =====  0
//          -1
//    ===== -2
//          -3
//    ===== -4
//
:printNotePositions -- prints the vertical position of notes on the
staves.  Mostly for debugging purposes.  A spine at the end of the
data will be added containing all positions for notes on the line
in the sequence in which the notes occur from left to right.

The middle line of a 5-line staff is the zero position, and
position values are diatonic steps above or below that level.


: printNotePositions -- prints the vertical position of notes on the staves . Mostly for debugging purposes . A spine at the end of the data will be added containing all positions for notes on the line in the sequence in which the notes occur from left to right . The middle line of a 5 - line staff is the zero position and position values are diatonic steps above or below that level .
void Tool_autostem::printNotePositions(HumdrumFile& infile,
		vector<vector<vector<int> > >& notepos) {
	vector<string> posinfo(infile.getLineCount());
	for (int i=0; i<infile.getLineCount(); i++) {
		if (!infile[i].isData()) {
			continue;
		}
		for (int j=0; j<infile[i].getFieldCount(); j++) {
			if (!infile.token(i, j)->isKern()) {
				continue;
			}
			if (infile.token(i, j)->isNull()) {
				continue;
			}
			if (infile.token(i, j)->isRest()) {
				continue;
			}
			for (int k=0; k<(int)notepos[i][j].size(); k++) {
				posinfo[i] += notepos[i][j][k];
			}
			if (posinfo[i].back() == ' ') {
				posinfo[i].pop_back();
			}
		}
	}
	infile.appendDataSpine(posinfo, "", "**vpos");
}
void Tool_autostem :: printNotePositions ( HumdrumFile & infile , vector < vector < vector < int > > > & notepos ) { vector < string > posinfo ( infile . getLineCount ( ) ) ; for ( int i = 0 ; i < infile . getLineCount ( ) ; i ++ ) { if ( ! infile [ i ] . isData ( ) ) { continue ; } for ( int j = 0 ; j < infile [ i ] . getFieldCount ( ) ; j ++ ) { if ( ! infile . token ( i , j ) -> isKern ( ) ) { continue ; } if ( infile . token ( i , j ) -> isNull ( ) ) { continue ; } if ( infile . token ( i , j ) -> isRest ( ) ) { continue ; } for ( int k = 0 ; k < ( int ) notepos [ i ] [ j ] . size ( ) ; k ++ ) { posinfo [ i ] += notepos [ i ] [ j ] [ k ] ; } if ( posinfo [ i ] . back ( ) == ' ' ) { posinfo [ i ] . pop_back ( ) ; } } } infile . appendDataSpine ( posinfo , " " , " " ) ; }
Tool_autostem::printNotePositions -- prints the vertical position of notes on the
staves.
Tool_autostem :: printNotePositions -- prints the vertical position of notes on the staves .
// ignore null tokens // ignore rests