|
Canorus
0.7
|
#include <midiimport.h>

Classes | |
| struct | CATime |
Public Member Functions | |
| CAMidiImport (QTextStream *in=0) | |
| virtual | ~CAMidiImport () |
| void | closeFile () |
| CADocument * | importDocumentImpl () |
| CASheet * | importSheetImpl () |
| const QString | readableStatus () |
Public Member Functions inherited from CAImport | |
| CAImport (QTextStream *stream=0) | |
| CAImport (const QString stream) | |
| virtual | ~CAImport () |
| void | importDocument () |
| void | importSheet () |
| void | importStaff () |
| void | importVoice () |
| void | importLyricsContext () |
| void | importFunctionMarkContext () |
| CADocument * | importedDocument () |
| CASheet * | importedSheet () |
| CAStaff * | importedStaff () |
| CAVoice * | importedVoice () |
| CALyricsContext * | importedLyricsContext () |
| CAFunctionMarkContext * | importedFunctionMarkContext () |
Public Member Functions inherited from CAFile | |
| CAFile () | |
| virtual | ~CAFile () |
| const int | status () |
| const int | progress () |
| void | setStreamFromFile (const QString filename) |
| void | setStreamToFile (const QString filename) |
| void | setStreamFromDevice (QIODevice *device) |
| void | setStreamToDevice (QIODevice *device) |
Private Types | |
| enum | CALilyPondDepth { Score, Layout, Voice, Chord } |
| enum | smtpOffsComponents { hr, min, se, fr, ff, next } |
Private Attributes | |
| CAVoice * | _curVoice |
| CASlur * | _curSlur |
| CASlur * | _curPhrasingSlur |
| QStack< CALilyPondDepth > | _depth |
| int | _curLine |
| int | _curChar |
| QList< QString > | _errors |
| QList< QString > | _warnings |
| int | _dataIndex |
| int | _nextTrackIndex |
| bool | _parseError |
| int | _smtpOffset [next] |
| int | _microSecondsPerMidiQuarternote |
| CADocument * | _document |
| QVector< QList< QList < CAMidiImportEvent * > * > * > | _allChannelsEvents |
| QList< CAMidiImportEvent * > | _eventsX |
Static Private Attributes | |
| static const QRegExp | WHITESPACE_DELIMITERS = QRegExp("[\\s]") |
| static const QRegExp | SYNTAX_DELIMITERS = QRegExp("[<>{}]") |
| static const QRegExp | DELIMITERS |
Additional Inherited Members | |
Signals inherited from CAImport | |
| void | documentImported (CADocument *) |
| void | sheetImported (CASheet *) |
| void | staffImported (CAStaff *) |
| void | voiceImported (CAVoice *) |
| void | lyricsContextImported (CALyricsContext *) |
| void | functionMarkContextImported (CAFunctionMarkContext *) |
| void | importDone (int status) |
Protected Member Functions inherited from CAImport | |
| virtual CAStaff * | importStaffImpl () |
| virtual CAVoice * | importVoiceImpl () |
| virtual CALyricsContext * | importLyricsContextImpl () |
| virtual CAFunctionMarkContext * | importFunctionMarkContextImpl () |
| QTextStream & | in () |
|
private |
|
private |
| CAMidiImport::CAMidiImport | ( | QTextStream * | in = 0 | ) |
|
virtual |
|
private |
|
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 CABarline::Undefined.
|
private |
Returns the Canorus octava or whichever interval above or below the clef.
| void CAMidiImport::closeFile | ( | ) |
|
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().

|
inlineprivate |
|
inlineprivate |
References _depth.
|
inlineprivate |
|
inlineprivate |
References _curVoice.
Referenced by findSharedElement().

|
private |
Returns the key signature gender from format \genderType.
References CADiatonicKey::Major, and CADiatonicKey::Minor.
|
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().

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

|
private |
References _dataIndex, and _parseError.
Referenced by getWord24(), and importSheetImpl().

|
private |
References _dataIndex, and _parseError.
Referenced by importSheetImpl().

|
private |
References _dataIndex, and _parseError.
Referenced by importSheetImpl().

|
private |
References _dataIndex, _parseError, and next.
Referenced by importSheetImpl().

|
private |
References _dataIndex, and _parseError.
Referenced by getWord24(), getWord32(), and importSheetImpl().

|
private |
References getByte(), and getWord16().
Referenced by importSheetImpl().


|
private |
References getWord16().
Referenced by importSheetImpl().


|
virtual |
Reimplemented from CAImport.
References _document, CADocument::addSheet(), and 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().


|
inlineprivate |
References CAFile::stream().
Referenced by parseNextElement(), and peekNextElement().


|
private |
References _curChar, _curLine, _curPhrasingSlur, _curSlur, _document, and _microSecondsPerMidiQuarternote.
Referenced by CAMidiImport().

|
private |
Returns true, if the given LilyPond element is a note.
|
private |
Returns true, if the given LilyPond element is a rest.
|
private |
References _allChannelsEvents.
Referenced by importSheetImpl().

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

|
private |
Returns the first element in input stream ended with one of the delimiters but don't shorten the stream.
References DELIMITERS, and in().

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

|
inlineprivate |
References _depth.
|
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.
|
private |
|
inlineprivate |
References _depth.
|
private |
Quantisize the notes and rests, don't affect the duration of the music.
References _allChannelsEvents.
Referenced by importSheetImpl().

|
virtual |
Reimplemented from CAImport.
References curChar(), curLine(), and CAFile::status().

|
private |
Generates the note pitch and number of accidentals from the note written in LilyPond syntax.
References CADiatonicPitch::noteName().

|
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.
|
inlineprivate |
References _curVoice.
Referenced by writeMidiFileEventsToScore().

|
private |
Returns the time signature beat and beats in beats/beat format.
|
private |
References _allChannelsEvents, CAVoice::append(), CAMidiDevice::midiPitchToDiatonicPitch(), CARest::Normal, CANote::setTieEnd(), CANote::setTieStart(), CASlur::SlurPreferred, CASlur::TieType, and CAPlayableLength::timeLengthToPlayableLengthList().
Referenced by writeMidiFileEventsToScore().


|
private |
References _allChannelsEvents, CASheet::addContext(), CAStaff::addVoice(), setCurVoice(), CASheet::staffList(), CANote::StemNeutral, CAStaff::voiceList(), and writeMidiChannelEventsToVoice().
Referenced by importSheetImpl().


|
private |
|
private |
Referenced by addError(), curChar(), and initMidiImport().
|
private |
Referenced by addError(), curLine(), and initMidiImport().
|
private |
Referenced by initMidiImport().
|
private |
Referenced by initMidiImport().
|
private |
Referenced by curVoice(), and setCurVoice().
|
private |
Referenced by getByte(), getHead(), getString(), getVariableLength(), getWord16(), and importSheetImpl().
|
private |
Referenced by curDepth(), popDepth(), and pushDepth().
|
private |
Referenced by importDocumentImpl(), importSheetImpl(), and initMidiImport().
|
private |
Referenced by addError().
|
private |
|
private |
Referenced by importSheetImpl(), and initMidiImport().
|
private |
Referenced by importSheetImpl().
|
private |
Referenced by getByte(), getHead(), getString(), getVariableLength(), getWord16(), and importSheetImpl().
|
private |
Referenced by importSheetImpl().
|
private |
|
staticprivate |
Combined WHITESPACE_DELIMITERS and SYNTAX_DELIMITERS.
Referenced by parseNextElement(), and peekNextElement().
|
staticprivate |
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.
|
staticprivate |
Delimiters which separate various music elements in LilyPond syntax. These are new lines, tabs, blanks etc.
1.8.3