|
Canorus
0.7
|
#include <midiimport.h>

enum CAMidiImport::CALilyPondDepth [private] |
enum CAMidiImport::smtpOffsComponents [private] |
| CAMidiImport::CAMidiImport | ( | QTextStream * | in = 0 | ) |
| CAMidiImport::~CAMidiImport | ( | ) | [virtual] |
| void CAMidiImport::addError | ( | QString | description, |
| int | lineError = 0, |
||
| int | charError = 0 |
||
| ) | [private] |
| CABarline::CABarlineType CAMidiImport::barlineTypeFromLilyPond | ( | const QString | bar | ) | [private] |
Genarates barline type from the LilyPond syntax for the given barline from format "barlineType".
References CABarline::Dotted, CABarline::Double, CABarline::End, CABarline::RepeatClose, CABarline::RepeatCloseOpen, CABarline::RepeatOpen, CABarline::Single, and CAImport::Undefined.
| int CAMidiImport::clefOffsetFromLilyPond | ( | const QString | constClef | ) | [private] |
Returns the Canorus octava or whichever interval above or below the clef.
| void CAMidiImport::closeFile | ( | ) |
| void CAMidiImport::combineMidiFileEvents | ( | ) | [private] |
Combines the midi on/off events and reduces them to a note with a length. Note off events are, which can also be a note on with velocity zero, are thus eaten up and are invalidated by pitch -1.
todo: rounding fine grained note lenghts, dispersing small rests
todo: combine concurrent notes to chords or export concurrent notes to a next voice.
References _allChannelsEvents.
Referenced by importSheetImpl().

| int CAMidiImport::curChar | ( | ) | [inline, private] |
| CALilyPondDepth CAMidiImport::curDepth | ( | ) | [inline, private] |
References _depth.
| int CAMidiImport::curLine | ( | ) | [inline, private] |
| CAVoice* CAMidiImport::curVoice | ( | ) | [inline, private] |
References _curVoice.
Referenced by findSharedElement().

| CADiatonicKey::CAGender CAMidiImport::diatonicKeyGenderFromLilyPond | ( | QString | gender | ) | [private] |
Returns the key signature gender from format \genderType.
References CADiatonicKey::Major, and CADiatonicKey::Minor.
| void CAMidiImport::exportNonChordsToOtherVoices | ( | ) | [private] |
If not a chord move overlapping notes to other voices.
The algorithm is this: For every note on event we look if there are follow up events that overlap. If there is a overlap the second note will be moved to a higher (index of the) voice, so high, where it can be stay without overlap.
References _allChannelsEvents, and next.
Referenced by importSheetImpl().

| CAMusElement * CAMidiImport::findSharedElement | ( | CAMusElement * | elt | ) | [private] |
Gathers a list of music elements with the given element's start time and returns the first music element in the gathered list with the same attributes.
This method is usually called when voices have "shared" music elements (barlines, clefs etc.). However, in LilyPond syntax the music element can/should be present in all the voices. This function finds this shared music element, if it already exists.
If the music element with the same properties exists, user should delete its own instance and add an already existing instance of the returned shared music element to the voice.
References CAVoice::contains(), curVoice(), CAStaff::getEltByType(), CAMusElement::musElementType(), CAVoice::staff(), and CAMusElement::timeStart().

| int CAMidiImport::getByte | ( | QByteArray * | x | ) | [private] |
References _dataIndex, and _parseError.
Referenced by getWord24(), and importSheetImpl().

| QByteArray CAMidiImport::getHead | ( | QByteArray * | x | ) | [private] |
References _dataIndex, and _parseError.
Referenced by importSheetImpl().

| QByteArray CAMidiImport::getString | ( | QByteArray * | x, |
| int | len | ||
| ) | [private] |
References _dataIndex, and _parseError.
Referenced by importSheetImpl().

| int CAMidiImport::getVariableLength | ( | QByteArray * | x | ) | [private] |
References _dataIndex, _parseError, and next.
Referenced by importSheetImpl().

| int CAMidiImport::getWord16 | ( | QByteArray * | x | ) | [private] |
References _dataIndex, and _parseError.
Referenced by getWord24(), getWord32(), and importSheetImpl().

| int CAMidiImport::getWord24 | ( | QByteArray * | x | ) | [private] |
References getByte(), and getWord16().
Referenced by importSheetImpl().


| int CAMidiImport::getWord32 | ( | QByteArray * | x | ) | [private] |
References getWord16().
Referenced by importSheetImpl().


| CADocument * CAMidiImport::importDocumentImpl | ( | ) | [virtual] |
Reimplemented from CAImport.
References _document, CADocument::addSheet(), and importSheetImpl().

| CASheet * CAMidiImport::importSheetImpl | ( | ) | [virtual] |
Reimplemented from CAImport.
References _dataIndex, _document, _microSecondsPerMidiQuarternote, _nextTrackIndex, _parseError, _smtpOffset, combineMidiFileEvents(), exportNonChordsToOtherVoices(), getByte(), getHead(), getString(), getVariableLength(), getWord16(), getWord24(), getWord32(), CAMidiDevice::Meta_InstrName, CAMidiDevice::Meta_Keysig, CAMidiDevice::Meta_SeqTrkName, CAMidiDevice::Meta_SMPTEOffs, CAMidiDevice::Meta_Tempo, CAMidiDevice::Meta_Text, CAMidiDevice::Meta_Timesig, CAMidiDevice::Meta_Track_End, CAMidiDevice::Midi_Control_Chg, CAMidiDevice::Midi_Ctl_Event, CAMidiDevice::Midi_Ctl_Sustain, CAMidiDevice::Midi_Note_Off, CAMidiDevice::Midi_Note_On, CAMidiDevice::Midi_Prog_Change, next, noteOn(), printQByteArray(), quantizeMidiFileEvents(), CAFile::stream(), and writeMidiFileEventsToScore().
Referenced by importDocumentImpl().


| QString& CAMidiImport::in | ( | ) | [inline, private] |
Reimplemented from CAImport.
References CAFile::stream().
Referenced by parseNextElement(), and peekNextElement().


| void CAMidiImport::initMidiImport | ( | ) | [private] |
References _curChar, _curLine, _curPhrasingSlur, _curSlur, _document, and _microSecondsPerMidiQuarternote.
Referenced by CAMidiImport().

| bool CAMidiImport::isNote | ( | const QString | elt | ) | [private] |
Returns true, if the given LilyPond element is a note.
| bool CAMidiImport::isRest | ( | const QString | elt | ) | [private] |
Returns true, if the given LilyPond element is a rest.
| void CAMidiImport::noteOn | ( | bool | on, |
| int | channel, | ||
| int | pitch, | ||
| int | velocity, | ||
| int | time | ||
| ) | [private] |
References _allChannelsEvents.
Referenced by importSheetImpl().

| const QString CAMidiImport::parseNextElement | ( | ) | [private] |
Returns the first element in input stream ended with one of the delimiters and shorten input stream for the element.
References DELIMITERS, and in().

| const QString CAMidiImport::peekNextElement | ( | ) | [private] |
Returns the first element in input stream ended with one of the delimiters but don't shorten the stream.
References DELIMITERS, and in().

| CAPlayableLength CAMidiImport::playableLengthFromLilyPond | ( | QString & | elt, |
| bool | parse = false |
||
| ) | [private] |
Generates playable lentgth and number of dots from the note/rest string in LilyPond syntax. If the playable element doesn't include length, { CAPlayable::CAPlayableLength::Undefined, 0 } is returned. This function also shortens the given string for the playable length, if parse is True.
References CAPlayableLength::dotted(), CAPlayableLength::setDotted(), and CAPlayableLength::setMusicLength().

| CALilyPondDepth CAMidiImport::popDepth | ( | ) | [inline, private] |
References _depth.
| CAClef::CAPredefinedClefType CAMidiImport::predefinedClefTypeFromLilyPond | ( | const QString | constClef | ) | [private] |
Genarates clef type from the LilyPond syntax for the given clef from format "clefType".
References CAClef::Alto, CAClef::Baritone, CAClef::Bass, CAClef::French, CAClef::Mezzosoprano, CAClef::Percussion, CAClef::Soprano, CAClef::Subbass, CAClef::Tablature, CAClef::Tenor, CAClef::Treble, and CAClef::Varbaritone.
| void CAMidiImport::printQByteArray | ( | QByteArray | x | ) | [private] |
| void CAMidiImport::pushDepth | ( | CALilyPondDepth | depth | ) | [inline, private] |
References _depth.
| void CAMidiImport::quantizeMidiFileEvents | ( | ) | [private] |
Quantisize the notes and rests, don't affect the duration of the music.
References _allChannelsEvents.
Referenced by importSheetImpl().

| const QString CAMidiImport::readableStatus | ( | ) | [virtual] |
Reimplemented from CAImport.
References curChar(), curLine(), and CAFile::status().

| CADiatonicPitch CAMidiImport::relativePitchFromLilyPond | ( | QString & | constNName, |
| CADiatonicPitch | prevPitch, | ||
| bool | parse = false |
||
| ) | [private] |
Generates the note pitch and number of accidentals from the note written in LilyPond syntax.
References CADiatonicPitch::noteName().

| CARest::CARestType CAMidiImport::restTypeFromLilyPond | ( | QString & | elt, |
| bool | parse = false |
||
| ) | [private] |
Genarates rest type from the LilyPond syntax for the given rest. This function also shortens the given string for the rest type, if parse is True.
References CARest::Hidden, and CARest::Normal.
| void CAMidiImport::setCurVoice | ( | CAVoice * | voice | ) | [inline, private] |
References _curVoice.
Referenced by writeMidiFileEventsToScore().

| CAMidiImport::CATime CAMidiImport::timeSigFromLilyPond | ( | QString | timeSig | ) | [private] |
Returns the time signature beat and beats in beats/beat format.
| void CAMidiImport::writeMidiChannelEventsToVoice | ( | int | channel, |
| CAStaff * | staff, | ||
| CAVoice * | voice | ||
| ) | [private] |
References _allChannelsEvents, CAVoice::append(), CAMidiDevice::midiPitchToDiatonicPitch(), CARest::Normal, CANote::setTieEnd(), CANote::setTieStart(), CASlur::SlurPreferred, CASlur::TieType, and CAPlayableLength::timeLengthToPlayableLengthList().
Referenced by writeMidiFileEventsToScore().


| void CAMidiImport::writeMidiFileEventsToScore | ( | CASheet * | sheet | ) | [private] |
References _allChannelsEvents, CASheet::addContext(), CAStaff::addVoice(), setCurVoice(), CASheet::staffList(), CANote::StemNeutral, CAStaff::voiceList(), and writeMidiChannelEventsToVoice().
Referenced by importSheetImpl().


QVector<QList<QList<CAMidiImportEvent*>*>*> CAMidiImport::_allChannelsEvents [private] |
int CAMidiImport::_curChar [private] |
Referenced by addError(), curChar(), and initMidiImport().
int CAMidiImport::_curLine [private] |
Referenced by addError(), curLine(), and initMidiImport().
CASlur* CAMidiImport::_curPhrasingSlur [private] |
Referenced by initMidiImport().
CASlur* CAMidiImport::_curSlur [private] |
Referenced by initMidiImport().
CAVoice* CAMidiImport::_curVoice [private] |
Referenced by curVoice(), and setCurVoice().
int CAMidiImport::_dataIndex [private] |
Referenced by getByte(), getHead(), getString(), getVariableLength(), getWord16(), and importSheetImpl().
QStack<CALilyPondDepth> CAMidiImport::_depth [private] |
Referenced by curDepth(), popDepth(), and pushDepth().
CADocument* CAMidiImport::_document [private] |
Referenced by importDocumentImpl(), importSheetImpl(), and initMidiImport().
QList<QString> CAMidiImport::_errors [private] |
Referenced by addError().
QList<CAMidiImportEvent*> CAMidiImport::_eventsX [private] |
int CAMidiImport::_microSecondsPerMidiQuarternote [private] |
Referenced by importSheetImpl(), and initMidiImport().
int CAMidiImport::_nextTrackIndex [private] |
Referenced by importSheetImpl().
bool CAMidiImport::_parseError [private] |
Referenced by getByte(), getHead(), getString(), getVariableLength(), getWord16(), and importSheetImpl().
int CAMidiImport::_smtpOffset[next] [private] |
Referenced by importSheetImpl().
QList<QString> CAMidiImport::_warnings [private] |
const QRegExp CAMidiImport::DELIMITERS [static, private] |
QRegExp(
CAMidiImport::WHITESPACE_DELIMITERS.pattern().left(CAMidiImport::WHITESPACE_DELIMITERS.pattern().size()-1) +
CAMidiImport::SYNTAX_DELIMITERS.pattern().mid(1)
)
Combined WHITESPACE_DELIMITERS and SYNTAX_DELIMITERS.
Referenced by parseNextElement(), and peekNextElement().
const QRegExp CAMidiImport::SYNTAX_DELIMITERS = QRegExp("[<>{}]") [static, private] |
Delimiters which separate various music elements in LilyPond syntax, but are specific for LilyPond syntax. They are reported as its own element when parsing the next element.
const QRegExp CAMidiImport::WHITESPACE_DELIMITERS = QRegExp("[\\s]") [static, private] |
Delimiters which separate various music elements in LilyPond syntax. These are new lines, tabs, blanks etc.
1.8.0