MCPcopy Create free account
hub / github.com/BambooTracker/BambooTracker / evaluateState

Method evaluateState

BambooTracker/note.cpp:1130–1147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1128}
1129
1130void 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected