| 1128 | } |
| 1129 | |
| 1130 | void Note::evaluateState(int octave, int note, int pitch) |
| 1131 | { |
| 1132 | pitch_ = pitch % SEMITONE_PITCH; |
| 1133 | note += pitch / SEMITONE_PITCH; |
| 1134 | name_ = ((note % 12) + 12) % 12;; |
| 1135 | octave_ = (int)(octave + std::floor(note / 12.)); |
| 1136 | if (octave_ < 0 || (!octave_ && !name_ && pitch_ < 0)) { |
| 1137 | octave_ = 0; |
| 1138 | name_ = NoteName::C; |
| 1139 | pitch_ = 0; |
| 1140 | } |
| 1141 | else if (OCTAVE_RANGE <= octave_) { |
| 1142 | octave_ = OCTAVE_RANGE - 1; |
| 1143 | name_ = NoteName::B; |
| 1144 | pitch_ = SEMITONE_PITCH - 1; |
| 1145 | } |
| 1146 | request_eval_ = false; |
| 1147 | } |
nothing calls this directly
no outgoing calls
no test coverage detected