src/tool-autostem.cpp
void Tool_autostem::getVoiceInfo(vector<vector<int> >& voice,
		HumdrumFile& infile) {

	voice.resize(infile.getLineCount());

	int i, j, v;
	for (i=0; i<infile.getLineCount(); i++) {
		if (!infile[i].isData()) {
			continue;
		}
		voice[i].resize(infile[i].getFieldCount());
		fill(voice[i].begin(), voice[i].end(), -1);
		for (j=0; j<infile[i].getFieldCount(); j++) {
			if (!infile.token(i, j)->isKern()) {
				continue;
			}
			if (infile.token(i, j)->isNull()) {
				continue;
			}
			v = getVoice(infile, i, j);
			voice[i][j] = v;
		}
	}
}
//////////////////////////////
//
// Tool_autostem::getVoiceInfo -- 0 = only voice in track, 1 = layer 1,
//     2 = layer 2, etc.
//
// 0 voices will be stemmed up or down based on vertical positions of notes
// 1 voices will be stemmed up always
// 2 voices will be stemmed down always.
// 3 and higher are still to be determined.
//
// Future enhancement of this algorithm: if one voice contains an invisible
// rest, then it will be ignored in the voice calculation.
//
:getVoiceInfo -- 0 = only voice in track, 1 = layer 1,
2 = layer 2, etc.

0 voices will be stemmed up or down based on vertical positions of notes
1 voices will be stemmed up always
2 voices will be stemmed down always.
3 and higher are still to be determined.

Future enhancement of this algorithm: if one voice contains an invisible
rest, then it will be ignored in the voice calculation.
: getVoiceInfo -- 0 = only voice in track 1 = layer 1 2 = layer 2 etc . 0 voices will be stemmed up or down based on vertical positions of notes 1 voices will be stemmed up always 2 voices will be stemmed down always . 3 and higher are still to be determined . Future enhancement of this algorithm : if one voice contains an invisible rest then it will be ignored in the voice calculation .
void Tool_autostem::getVoiceInfo(vector<vector<int> >& voice,
		HumdrumFile& infile) {
	voice.resize(infile.getLineCount());
	int i, j, v;
	for (i=0; i<infile.getLineCount(); i++) {
		if (!infile[i].isData()) {
			continue;
		}
		voice[i].resize(infile[i].getFieldCount());
		fill(voice[i].begin(), voice[i].end(), -1);
		for (j=0; j<infile[i].getFieldCount(); j++) {
			if (!infile.token(i, j)->isKern()) {
				continue;
			}
			if (infile.token(i, j)->isNull()) {
				continue;
			}
			v = getVoice(infile, i, j);
			voice[i][j] = v;
		}
	}
}
void Tool_autostem :: getVoiceInfo ( vector < vector < int > > & voice , HumdrumFile & infile ) { voice . resize ( infile . getLineCount ( ) ) ; int i , j , v ; for ( i = 0 ; i < infile . getLineCount ( ) ; i ++ ) { if ( ! infile [ i ] . isData ( ) ) { continue ; } voice [ i ] . resize ( infile [ i ] . getFieldCount ( ) ) ; fill ( voice [ i ] . begin ( ) , voice [ i ] . end ( ) , -1 ) ; for ( j = 0 ; j < infile [ i ] . getFieldCount ( ) ; j ++ ) { if ( ! infile . token ( i , j ) -> isKern ( ) ) { continue ; } if ( infile . token ( i , j ) -> isNull ( ) ) { continue ; } v = getVoice ( infile , i , j ) ; voice [ i ] [ j ] = v ; } } }
Tool_autostem::getVoiceInfo -- 0 = only voice in track, 1 = layer 1,
2 = layer 2, etc.
Tool_autostem :: getVoiceInfo -- 0 = only voice in track 1 = layer 1 2 = layer 2 etc .