Canorus 0.0
Public Member Functions | Private Attributes | List of all members
CATranspose Class Reference

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
 

Detailed Description

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().

See also
CAInterval::fromSemitones()

Constructor & Destructor Documentation

◆ CATranspose() [1/4]

CATranspose::CATranspose ( )

◆ CATranspose() [2/4]

CATranspose::CATranspose ( CASheet sheet)

References addContext(), and CASheet::contextList().

Here is the call graph for this function:

◆ CATranspose() [3/4]

CATranspose::CATranspose ( QList< CAContext * >  contexts)

References addContext().

Here is the call graph for this function:

◆ CATranspose() [4/4]

CATranspose::CATranspose ( QList< CAMusElement * >  selection)

References _elements.

◆ ~CATranspose()

CATranspose::~CATranspose ( )

Member Function Documentation

◆ addContext()

void CATranspose::addContext ( CAContext context)

◆ addMusElement()

void CATranspose::addMusElement ( CAMusElement musElt)
inline

References _elements.

Referenced by addContext(), and CATransposeView::on_uiApply_clicked().

Here is the caller graph for this function:

◆ addSheet()

void CATranspose::addSheet ( CASheet s)

References addContext(), and CASheet::contextList().

Referenced by CATransposeView::on_uiApply_clicked().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reinterpretAccidentals()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transposeByInterval()

void CATranspose::transposeByInterval ( CAInterval  interval)

◆ transposeByKeySig()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transposeBySemitones()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _elements

QSet<CAMusElement*> CATranspose::_elements
private

The documentation for this class was generated from the following files: