Ejemplo n.º 1
0
int ChordEdit::root()
      {
      int tpc = step2tpc(rootGroup->checkedId(), accidentalsGroup->checkedId() - 3);
//      qDebug("ChordEdit::root() rootid=%d accid=%d -> tpc=%d\n",
//             rootGroup->checkedId(), accidentalsGroup->checkedId() - 3, tpc);
      return tpc;
      }
Ejemplo n.º 2
0
static void xmlSetPitch(Ms::Note* n, char step, int alter, int octave)
      {
      int istep = step - 'A';
      //                       a  b   c  d  e  f  g
      static int table[7]  = { 9, 11, 0, 2, 4, 5, 7 };
      if (istep < 0 || istep > 6) {
            qDebug("xmlSetPitch: illegal pitch %d, <%c>", istep, step);
            return;
            }
      int pitch = table[istep] + alter + (octave+1) * 12;

      if (pitch < 0)
            pitch = 0;
      if (pitch > 127)
            pitch = 127;

      n->setPitch(pitch);

      //                        a  b  c  d  e  f  g
      static int table1[7]  = { 5, 6, 0, 1, 2, 3, 4 };
      int tpc  = step2tpc(table1[istep], Ms::AccidentalVal(alter));
      n->setTpc(tpc);
      }