|
Canorus 0.0
|
Class used for transposing a set of notes for the given interval. More...
#include <transpose.h>
Public Member Functions | |
| CATranspose () | |
| CATranspose (CASheet *sheet) | |
| CATranspose (QList< CAContext * > contexts) | |
| CATranspose (QList< CAMusElement * > selection) | |
| ~CATranspose () | |
| void | transposeBySemitones (int semitones) |
| void | transposeByInterval (CAInterval) |
| void | transposeByKeySig (CADiatonicKey from, CADiatonicKey to, int direction) |
| void | reinterpretAccidentals (int type) |
| void | addSheet (CASheet *s) |
| void | addContext (CAContext *context) |
| void | addMusElement (CAMusElement *musElt) |
Private Attributes | |
| QSet< CAMusElement * > | _elements |
Class used for transposing a set of notes for the given interval.
Copyright (c) 2008, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See COPYING for details.
This is a control class used for making a transposition of a set of music elements, contexts or even the whole score sheet.
Use: 1) Create a CATranspose class 2) Pass the music elements you want to transpose in the constructor or by calling addMusElement() or addContext(). 3) Transpose the elements by calling transposeByKeySig(), transposeByInterval(), transposeBySemitones() or reinterpretAccidentals().
| CATranspose::CATranspose | ( | ) |
| CATranspose::CATranspose | ( | CASheet * | sheet | ) |
| CATranspose::CATranspose | ( | QList< CAContext * > | contexts | ) |
| CATranspose::CATranspose | ( | QList< CAMusElement * > | selection | ) |
References _elements.
| CATranspose::~CATranspose | ( | ) |
| void CATranspose::addContext | ( | CAContext * | context | ) |
References _elements, addMusElement(), CAContext::contextType(), CAContext::FiguredBassContext, CAContext::FunctionMarkContext, CAContext::LyricsContext, CAContext::Staff, and CAStaff::voiceList().
Referenced by addSheet(), CATranspose(), and CATransposeView::on_uiApply_clicked().


|
inline |
References _elements.
Referenced by addContext(), and CATransposeView::on_uiApply_clicked().

| void CATranspose::addSheet | ( | CASheet * | s | ) |
References addContext(), and CASheet::contextList().
Referenced by CATransposeView::on_uiApply_clicked().


| void CATranspose::reinterpretAccidentals | ( | int | type | ) |
Changes note accidentals dependent on type: 1) If type==1, sharps -> flats 2) If type==-1, flats -> sharps 3) if type==0, invert
This function also changes Key signatures dependent on type, if their number of accidentals is greater or equal than 5 or lesser or equal than -5.
References _elements, CADiatonicPitch::accs(), CAMusElement::Barline, CAMusElement::Clef, CAKeySignature::diatonicKey(), CADiatonicKey::diatonicPitch(), CANote::diatonicPitch(), CAMusElement::FiguredBassMark, CAMusElement::FunctionMark, CADiatonicKey::gender(), CAMusElement::KeySignature, CAMusElement::Mark, CAMusElement::MidiNote, CAMusElement::musElementType(), CAMusElement::Note, CADiatonicKey::numberOfAccs(), CAMusElement::Rest, CAKeySignature::setDiatonicKey(), CANote::setDiatonicPitch(), CAMusElement::Slur, CAMusElement::Syllable, CAMusElement::TimeSignature, CAMusElement::Tuplet, and CAMusElement::Undefined.
Referenced by CATransposeView::on_uiApply_clicked().


| void CATranspose::transposeByInterval | ( | CAInterval | interval | ) |
Transposes the music elements by the given interval. If the interval quantity is negative, elements are transposed down.
References _elements, CAMusElement::Barline, CAMusElement::Clef, CAKeySignature::diatonicKey(), CAMusElement::FiguredBassMark, CAMusElement::FunctionMark, CAFunctionMark::key(), CAMusElement::KeySignature, CAMusElement::Mark, CAMusElement::MidiNote, CAMusElement::musElementType(), CAMusElement::Note, CAMusElement::Rest, CAMusElement::Slur, CAMusElement::Syllable, CAMusElement::TimeSignature, CAMusElement::Tuplet, and CAMusElement::Undefined.
Referenced by CATransposeView::on_uiApply_clicked(), transposeByKeySig(), and transposeBySemitones().


| void CATranspose::transposeByKeySig | ( | CADiatonicKey | from, |
| CADiatonicKey | to, | ||
| int | direction | ||
| ) |
Transposes the music elements from the given key signature from to the key signature to in the given direction. Direction can be 1 for up or -1 for down.
References CADiatonicKey::diatonicPitch(), CADiatonicPitch::noteName(), CAInterval::quantity(), CAInterval::setQuantity(), and transposeByInterval().
Referenced by CATransposeView::on_uiApply_clicked().


| void CATranspose::transposeBySemitones | ( | int | semitones | ) |
Transposes the music elements by the given number of semitones. Number can be negative for the direction down.
References CAInterval::fromSemitones(), and transposeByInterval().
Referenced by CATransposeView::on_uiApply_clicked().


|
private |
Referenced by addContext(), addMusElement(), CATranspose(), reinterpretAccidentals(), and transposeByInterval().