예제 #1
0
파일: key.cpp 프로젝트: SSMN/MuseScore
void AccidentalState::init(const KeySigEvent& ks)
      {
      int type = ks.accidentalType();
      memset(state, 0, 74);
      for (int octave = 0; octave < 11; ++octave) {
            if (type > 0) {
                  for (int i = 0; i < type; ++i) {
                        int idx = tpc2step(20 + i) + octave * 7;
                        if (idx < 74)
                              state[idx] = 1;
                        }
                  }
            else {
                  for (int i = 0; i > type; --i) {
                        int idx = tpc2step(12 + i) + octave * 7;
                        if (idx < 74)
                              state[idx] = -1;
                        }
                  }
            }
      }