void SwingDetector::checkShuffle() { if (elements.size() == 2 && areAllNonTuplets() && elements[0]->type() == Element::CHORD && (elements[1]->type() == Element::CHORD || elements[1]->type() == Element::REST) && elements[0]->duration().reduced() == Fraction(3, 16) // dotted 8th && elements[1]->duration().reduced() == Fraction(1, 16)) { // swing with two 8th notes // or 8th note + 8th rest applySwing(); } }
void SwingDetector::checkShuffle() { if (elements.size() == 2 && areAllNonTuplets() && elements[0]->isChord() && (elements[1]->isChord() || elements[1]->isRest()) && elements[0]->ticks().reduced() == Fraction(3, 16) // dotted 8th && elements[1]->ticks().reduced() == Fraction(1, 16)) { // swing with two 8th notes // or 8th note + 8th rest applySwing(); } }