Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
CAKeybdInput Class Reference

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>

List of all members.

Public Member Functions

 CAKeybdInput (CAMainWin *m)
 ~CAKeybdInput ()
void onMidiInEvent (QVector< unsigned char > m)

Private Member Functions

void midiInEventToScore (CAScoreViewPort *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

Detailed Description

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.


Constructor & Destructor Documentation

Destructor deletes the created arrays.


Member Function Documentation

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

Here is the call graph for this function:

Here is the caller graph for this function:

void CAKeybdInput::midiInEventToScore ( CAScoreViewPort v,
QVector< unsigned char >  m 
) [private]

This is the entry point the midi input device. All note on events are passed over here.

References _midiInChordTimer, _mw, _noteLayout, _tup, _tupPla, CAScoreViewPort::addToSelection(), CAVoice::append(), CAMusElement::Barline, CAScoreViewPort::clearSelection(), CAMusElementFactory::configureRest(), CAMusElementFactory::configureSlur(), CAVoice::contains(), CADrawableContext::context(), CAUndo::createUndoCommand(), CAScoreViewPort::currentContext(), CAMainWin::currentScoreViewPort(), CAMainWin::currentSheet(), CAMainWin::currentVoice(), CAMainWin::document(), CATuplet::firstNote(), CAVoice::getChord(), CAVoice::insert(), CAVoice::insertInTupletAndVoiceAt(), CAPlayable::isFirstInTuplet(), CAVoice::lastMusElement(), CAVoice::lastPlayableElt(), CAVoice::lastTimeEnd(), CAVoice::lastTimeStart(), matchPitchToKey(), CAPlayableLength::matchToBars(), CAMidiDevice::midiPitchToDiatonicPitch(), CAMusElementFactory::musElement(), CAMainWin::musElementFactory(), CATuplet::nextTimed(), CARest::Normal, CAMusElementFactory::placeAutoBar(), CAMusElementFactory::playableLength(), CAVoice::previousByType(), CAUndo::pushUndoCommand(), CACanorus::rebuildUI(), CACanorus::settings(), CAScoreViewPort::setWorldCoords(), CAVoice::synchronizeMusElements(), CAMusElement::TimeSignature, CAMusElement::timeStart(), CAScoreViewPort::timeToCoordsSimpleVersion(), CAPlayable::tuplet(), CAMainWin::uiTupletActualNumber, CAMainWin::uiTupletNumber, CAMainWin::uiTupletType, CACanorus::undo(), CAScoreViewPort::updateHelpers(), and CAScoreViewPort::worldCoords().

Referenced by onMidiInEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAKeybdInput::onMidiInEvent ( QVector< unsigned char >  m)

References _mw, CAMainWin::currentScoreViewPort(), CAMidiDevice::Midi_Note_On, midiInEventToScore(), and CAMidiDevice::midiPitchToDiatonicPitch().

Referenced by CAMainWin::onMidiInEvent().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Referenced by matchPitchToKey().

Referenced by matchPitchToKey().

signed char CAKeybdInput::_actualKeySignatureAccs[7] [private]

Referenced by matchPitchToKey().

Referenced by CAKeybdInput().

Referenced by CAKeybdInput(), and midiInEventToScore().

Referenced by CAKeybdInput(), and midiInEventToScore().

Referenced by CAKeybdInput(), and midiInEventToScore().

Referenced by CAKeybdInput(), and midiInEventToScore().


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