|
Canorus
0.0
|
Music input per midi non realtime This class adds score input capability through a connected midi keyboard in non realtime. It allows to use simultaniously the computer mouse and the computer keyboard as usual. More...
#include <keybdinput.h>
Public Member Functions | |
| CAKeybdInput (CAMainWin *m) | |
| ~CAKeybdInput () | |
| void | onMidiInEvent (QVector< unsigned char > m) |
Private Member Functions | |
| void | midiInEventToScore (CAScoreView *v, QVector< unsigned char > m) |
| CADiatonicPitch | matchPitchToKey (CAVoice *voice, CADiatonicPitch p) |
Private Attributes | |
| CAMainWin * | _mw |
| QTimer | _midiInChordTimer |
| CASheet * | _lastMidiInSheet |
| CAStaff * | _lastMidiInStaff |
| CAVoice * | _lastMidiInVoice |
| CADiatonicPitch | _actualKeySignature |
| signed char | _actualKeySignatureAccs [7] |
| int | _actualKeyAccidentalsSum |
| CAPlayable * | _tupPla |
| CATuplet * | _tup |
| QList< CAMusElement * > | _noteLayout |
Music input per midi non realtime This class adds score input capability through a connected midi keyboard in non realtime. It allows to use simultaniously the computer mouse and the computer keyboard as usual.
To activate midi keyboard input you have to select in canorus settings, readable devices, the alsa midi port of your midi keyboard. When in input mode, when a voice and a duration is selected, notes can be entered with the midi keyboard too.
Key strockes within 100 ms will be combined into a chord.
Accents are set according the current key pitch. Automatic tracking of the scene is done too.
todo: User selectable (to be implemented) midi pitches can be set to be interpreted as rest input, punctuation and so on. Inserting at the currently selected note.
| CAKeybdInput::CAKeybdInput | ( | CAMainWin * | m | ) |
References _lastMidiInVoice, _midiInChordTimer, _mw, _noteLayout, _tup, and _tupPla.
| CAKeybdInput::~CAKeybdInput | ( | ) |
Destructor deletes the created arrays.
|
private |
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, CAKeySignature::accidentals(), CADiatonicPitch::accs(), CADiatonicPitch::C, CAKeySignature::diatonicKey(), CADiatonicKey::diatonicPitch(), CAInterval::Diminished, CAVoice::getPreviousByType(), CAMusElement::KeySignature, CAVoice::lastTimeEnd(), CADiatonicPitch::noteName(), and CAInterval::Second.
Referenced by midiInEventToScore().


|
private |
This is the entry point the midi input device. All note on events are passed over here.
References _midiInChordTimer, _mw, _noteLayout, _tup, _tupPla, CAScoreView::addToSelection(), CAVoice::append(), CAMusElement::Barline, CAScoreView::clearSelection(), CAMusElementFactory::configureRest(), CAMusElementFactory::configureSlur(), CADrawableContext::context(), CAUndo::createUndoCommand(), CAScoreView::currentContext(), CAMainWin::currentScoreView(), CAMainWin::currentSheet(), CAMainWin::currentVoice(), CADiatonicPitch::diatonicPitchFromMidiPitch(), CAMainWin::document(), CATuplet::firstNote(), CAVoice::getChord(), CAVoice::insert(), CAVoice::insertInTupletAndVoiceAt(), CAPlayable::isFirstInTuplet(), CAVoice::lastMusElement(), CAVoice::lastPlayableElt(), CAVoice::lastTimeEnd(), CAVoice::lastTimeStart(), matchPitchToKey(), CAPlayableLength::matchToBars(), CAMusElementFactory::musElement(), CAMainWin::musElementFactory(), CAVoice::musElementList(), CATuplet::nextTimed(), CARest::Normal, CAStaff::placeAutoBar(), CAMusElementFactory::playableLength(), CAVoice::previousByType(), CAUndo::pushUndoCommand(), CACanorus::rebuildUI(), CACanorus::settings(), CAScoreView::setWorldCoords(), CAVoice::synchronizeMusElements(), CAMusElement::TimeSignature, CAMusElement::timeStart(), CAScoreView::timeToCoordsSimpleVersion(), CAPlayable::tuplet(), CAMainWin::uiTupletActualNumber, CAMainWin::uiTupletNumber, CAMainWin::uiTupletType, CACanorus::undo(), CAScoreView::updateHelpers(), and CAScoreView::worldCoords().
Referenced by onMidiInEvent().


| void CAKeybdInput::onMidiInEvent | ( | QVector< unsigned char > | m | ) |
References _mw, CAMainWin::currentScoreView(), CAMidiDevice::Midi_Note_On, and midiInEventToScore().
Referenced by CAMainWin::onMidiInEvent().


|
private |
Referenced by matchPitchToKey().
|
private |
Referenced by matchPitchToKey().
|
private |
Referenced by matchPitchToKey().
|
private |
|
private |
|
private |
Referenced by CAKeybdInput().
|
private |
Referenced by CAKeybdInput(), and midiInEventToScore().
|
private |
Referenced by CAKeybdInput(), midiInEventToScore(), and onMidiInEvent().
|
private |
Referenced by CAKeybdInput(), and midiInEventToScore().
|
private |
Referenced by CAKeybdInput(), and midiInEventToScore().
|
private |
Referenced by CAKeybdInput(), and midiInEventToScore().