|
Canorus
0.0
|
#include <midiimport.h>

Classes | |
| struct | CATime |
Private Types | |
| enum | CALilyPondDepth { Score, Layout, Voice, Chord } |
Private Member Functions | |
| CASheet * | importSheetImplPmidiParser (CASheet *sheet) |
| void | importMidiEvents () |
| void | initMidiImport () |
| CAVoice * | curVoice () |
| void | setCurVoice (CAVoice *voice) |
| void | addError (QString description, int lineError=0, int charError=0) |
| CADiatonicPitch | matchPitchToKey (CAVoice *voice, int midiPitch) |
| QString & | in () |
| CALilyPondDepth | curDepth () |
| void | pushDepth (CALilyPondDepth depth) |
| CALilyPondDepth | popDepth () |
| int | curLine () |
| int | curChar () |
| void | writeMidiFileEventsToScore_New (CASheet *sheet) |
| void | writeMidiChannelEventsToVoice_New (int channel, int voiceIndex, CAStaff *staff, CAVoice *voice) |
| CAMusElement * | getOrCreateClef (int time, int voiceIndex, CAStaff *staff, CAVoice *voice) |
| int | getNextKeySignatureTime () |
| CAMusElement * | getOrCreateKeySignature (int time, int voiceIndex, CAStaff *staff, CAVoice *voice) |
| CAMusElement * | getOrCreateTimeSignature (int time, int voiceIndex, CAStaff *staff, CAVoice *voice) |
| void | fixAccidentals (CASheet *s) |
Private Attributes | |
| CADiatonicPitch | _actualKeySignature |
| signed char | _actualKeySignatureAccs [7] |
| int | _actualKeyAccidentalsSum |
| CAVoice * | _curVoice |
| CASlur * | _curSlur |
| CASlur * | _curPhrasingSlur |
| QStack< CALilyPondDepth > | _depth |
| int | _curLine |
| int | _curChar |
| QList< QString > | _errors |
| QList< QString > | _warnings |
| QList< int > | _midiProgramList |
| CADocument * | _document |
| QVector< QList< QList< CAMidiImportEvent * > * > * > | _allChannelsEvents |
| QList< CAMidiImportEvent * > | _eventsX |
| QVector< int > | _allChannelsMediumPitch |
| QVector< CAClef * > | _allChannelsClef |
| QVector< CAKeySignature * > | _allChannelsKeySignatures |
| QVector< CAMidiImportEvent * > | _allChannelsTimeSignatures |
| int | _actualClefIndex |
| int | _actualKeySignatureIndex |
| int | _actualTimeSignatureIndex |
| int | _numberOfAllVoices |
Static Private Attributes | |
| static const QRegExp | WHITESPACE_DELIMITERS |
| static const QRegExp | SYNTAX_DELIMITERS |
| 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 () |
Protected Member Functions inherited from CAFile | |
| void | setStatus (const int status) |
| void | setProgress (const int progress) |
| QTextStream * | stream () |
| virtual void | setStream (QTextStream *stream) |
| QFile * | file () |
| void | setFile (QFile *file) |
Protected Attributes inherited from CAImport | |
| QString | _fileName |
|
private |
| CAMidiImport::CAMidiImport | ( | CADocument * | document = 0, |
| QTextStream * | in = 0 |
||
| ) |
References _allChannelsEvents, _allChannelsMediumPitch, _document, _midiProgramList, and initMidiImport().

|
virtual |
|
private |
| void CAMidiImport::closeFile | ( | ) |
|
inlineprivate |
References _curChar.
Referenced by addError(), and readableStatus().

|
inlineprivate |
References _depth.
|
inlineprivate |
References _curLine.
Referenced by addError(), and readableStatus().

|
private |
Tries to assume the correct accidental for the alien notes in the key signature. Currently this function searches for disalterations (eg. cis -> c, where c is the note in the scale). The algorithm solves the toggling notes (eg. e es e -> e dis e) and transition notes (eg. e dis d -> e es d).
References CAFile::setStatus(), and CASheet::voiceList().
Referenced by importSheetImplPmidiParser().


|
private |
This function looks in the keySignatureReferences
References _actualKeySignatureIndex, and _allChannelsKeySignatures.
Referenced by writeMidiChannelEventsToVoice_New().

|
private |
|
private |
This function looks in the keySignatureReferences
References _actualKeySignatureIndex, _allChannelsKeySignatures, and CAStaff::keySignatureRefs().
Referenced by writeMidiChannelEventsToVoice_New().


|
private |
Docu neeeded, definitively! rud
References _actualTimeSignatureIndex, _allChannelsTimeSignatures, and CAStaff::timeSignatureRefs().
Referenced by writeMidiChannelEventsToVoice_New().


|
virtual |
Reimplemented from CAImport.
References _document, CADocument::addSheet(), and importSheetImpl().

|
private |
The midi file is opened by calling the pmidi wrapper function pmidi_open_midi_file(), then, in a polling loop, the wrapper function pmidi_parse_midi_file() brings out the relevant midi events which are stored in the array _allChannelsEvents[]. All time signatures are stored in the array _allChannelsTimeSignatures[]. The work of pmidi and the wrapper is done then.
All time values are scaled here to canorus' own music time scale.
Further processing is referred to function writeMidiFileEventsToScore_New().
References _allChannelsEvents, _allChannelsKeySignatures, _allChannelsTimeSignatures, _midiProgramList, pmidi_outs::bottom, pmidi_outs::chan, CAImport::fileName(), CAPlayableLength::HundredTwentyEighth, pmidi_outs::key, pmidi_outs::length, CADiatonicKey::Major, pmidi_outs::micro_tempo, pmidi_outs::minor, CADiatonicKey::Minor, pmidi_outs::note, CAPlayableLength::playableLengthToTimeLength(), pmidi_open_midi_file(), pmidi_out, pmidi_parse_midi_file(), PMIDI_STATUS_CONTROL, PMIDI_STATUS_DUMMY, PMIDI_STATUS_END, PMIDI_STATUS_KEYSIG, PMIDI_STATUS_KEYTOUCH, PMIDI_STATUS_NOTE, PMIDI_STATUS_PITCH, PMIDI_STATUS_PRESSURE, PMIDI_STATUS_PROGRAM, PMIDI_STATUS_ROOT, PMIDI_STATUS_SMPTEOFFS, PMIDI_STATUS_SYSEX, PMIDI_STATUS_TEMPO, PMIDI_STATUS_TEXT, PMIDI_STATUS_TIMESIG, PMIDI_STATUS_VERSION, pmidi_outs::program, CAPlayableLength::Quarter, CAFile::setStatus(), pmidi_outs::time, pmidi_outs::time_base, pmidi_outs::top, and pmidi_outs::vel.
Referenced by importMidiNotes(), and importSheetImplPmidiParser().


| QList< QList< CAMidiNote * > > CAMidiImport::importMidiNotes | ( | ) |
Imports the given MIDI file and returns a list of CAMidiNote objects sorted by timeStart per channel.
This function is usually called when raw MIDI operations are done and the actual notes etc. aren't needed.
References _allChannelsEvents, and importMidiEvents().

|
virtual |
Reimplemented from CAImport.
References _document, CAImport::fileName(), importSheetImplPmidiParser(), and CASheet::setName().
Referenced by importDocumentImpl().


References fixAccidentals(), importMidiEvents(), CAFile::setStatus(), and writeMidiFileEventsToScore_New().
Referenced by importSheetImpl().


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

|
private |
This function is a duplicat in CAKeybdInput! Should be moved to CADiatonicPitch an be reused.
This function looks up the current key signiture. Then it computes the proper accidentials for the note.
This function should be somewhere else, maybe in CADiatonicPitch ?
References _actualKeyAccidentalsSum, _actualKeySignature, _actualKeySignatureAccs, CADiatonicPitch::C, CAKeySignature::diatonicKey(), CADiatonicPitch::diatonicPitchFromMidiPitch(), CADiatonicPitch::diatonicPitchFromMidiPitchKey(), CAVoice::getPreviousByType(), CAMusElement::KeySignature, and CAVoice::lastTimeEnd().
Referenced by writeMidiChannelEventsToVoice_New().


|
inline |
References _midiProgramList.
|
inlineprivate |
References _depth.
|
inlineprivate |
References _depth.
|
virtual |
Displays a string left of the progress bar
Reimplemented from CAImport.
References curChar(), curLine(), and CAFile::status().

|
inlineprivate |
References _curVoice.
Referenced by writeMidiFileEventsToScore_New().

|
private |
Docu neeeded
Apropo program support at midi import: Now the last effective program assignement per voice will make it through. A separation in voices regarding the midi program is note yet implemented.
References _actualClefIndex, _actualKeySignatureIndex, _actualTimeSignatureIndex, _allChannelsEvents, CAMusElement::addMark(), CAVoice::append(), CAMusElement::Barline, getNextKeySignatureTime(), CAStaff::getOneEltByType(), CAVoice::getOnePreviousByType(), getOrCreateKeySignature(), getOrCreateTimeSignature(), CAVoice::lastMusElement(), CAVoice::lastTimeEnd(), matchPitchToKey(), CAPlayableLength::matchToBars(), CARest::Normal, CAStaff::placeAutoBar(), CAPlayableLength::playableLengthToTimeLength(), CAVoice::previousByType(), CAPlayableLength::Quarter, CAVoice::setMidiProgram(), CASlur::SlurPreferred, CANote::StemPreferred, CASlur::TieType, and CAMusElement::timeEnd().
Referenced by writeMidiFileEventsToScore_New().


|
private |
References _allChannelsEvents, _allChannelsKeySignatures, _allChannelsMediumPitch, _allChannelsTimeSignatures, _numberOfAllVoices, CASheet::addContext(), CAStaff::addVoice(), CAVoice::append(), CAClef::Bass, setCurVoice(), CAVoice::setMidiChannel(), CAFile::setProgress(), CAFile::setStatus(), CASheet::staffList(), CANote::StemNeutral, CAStaff::synchronizeVoices(), CAClef::Treble, CAStaff::voiceList(), and writeMidiChannelEventsToVoice_New().
Referenced by importSheetImplPmidiParser().


|
private |
Referenced by writeMidiChannelEventsToVoice_New().
|
private |
Referenced by matchPitchToKey().
|
private |
Referenced by matchPitchToKey().
|
private |
Referenced by matchPitchToKey().
|
private |
Referenced by getNextKeySignatureTime(), getOrCreateKeySignature(), and writeMidiChannelEventsToVoice_New().
|
private |
Referenced by getOrCreateTimeSignature(), and writeMidiChannelEventsToVoice_New().
|
private |
|
private |
|
private |
Referenced by getNextKeySignatureTime(), getOrCreateKeySignature(), importMidiEvents(), and writeMidiFileEventsToScore_New().
|
private |
Referenced by CAMidiImport(), and writeMidiFileEventsToScore_New().
|
private |
Referenced by getOrCreateTimeSignature(), importMidiEvents(), and writeMidiFileEventsToScore_New().
|
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 curDepth(), popDepth(), and pushDepth().
|
private |
Referenced by CAMidiImport(), importDocumentImpl(), and importSheetImpl().
|
private |
Referenced by addError().
|
private |
|
private |
Referenced by CAMidiImport(), importMidiEvents(), and midiProgramList().
|
private |
Referenced by writeMidiFileEventsToScore_New().
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |