void SwingDetector::checkNormalSwing() { if (elements.size() == 2 && areAllTuplets() && (elements[0]->type() == Element::CHORD || elements[1]->type() == Element::CHORD) && elements[0]->duration().reduced() == Fraction(1, 4) && elements[1]->duration().reduced() == Fraction(1, 8)) { // swing with two 8th notes // or 8th note + 8th rest // or 8th rest + 8th note applySwing(); } else if (elements.size() == 3 && elements[0]->type() == Element::CHORD && elements[1]->type() == Element::REST && elements[2]->type() == Element::CHORD && elements[0]->duration().reduced() == Fraction(1, 8) && elements[1]->duration().reduced() == Fraction(1, 8) && elements[2]->duration().reduced() == Fraction(1, 8)) { // swing with two 8th notes applySwing(); } }
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(); } }