LMMS
Loading...
Searching...
No Matches
lmms::Keymap Class Reference

#include <Keymap.h>

Inheritance diagram for lmms::Keymap:
lmms::SerializingObject

Public Member Functions

 Keymap ()
 Keymap (QString description, std::vector< int > newMap, int newFirst, int newLast, int newMiddle, int newBaseKey, float newBaseFreq)
QString getDescription () const
void setDescription (QString description)
int getMiddleKey () const
int getFirstKey () const
int getLastKey () const
int getBaseKey () const
float getBaseFreq () const
std::size_t getSize () const
int getDegree (int key) const
 Return scale degree for a given key, based on current map and first/middle/last notes.
int getOctave (int key) const
 Return octave offset for a given key, based on current map and the middle note.
const std::vector< int > & getMap () const
void saveSettings (QDomDocument &doc, QDomElement &element) override
void loadSettings (const QDomElement &element) override
QString nodeName () const override
Public Member Functions inherited from lmms::SerializingObject
 SerializingObject ()
virtual ~SerializingObject ()
virtual QDomElement saveState (QDomDocument &_doc, QDomElement &_parent)
virtual void restoreState (const QDomElement &_this)
void setHook (SerializingObjectHook *_hook)
SerializingObjectHookhook ()

Private Attributes

QString m_description
 name or description of the keymap
std::vector< intm_map
 key to scale degree mapping
int m_firstKey
 first key that will be mapped
int m_lastKey
 last key that will be mapped
int m_middleKey
 first line of the map refers to this key
int m_baseKey
 key which is assigned the reference "base note"
float m_baseFreq
 frequency of the base note (usually A4 @440 Hz)

Constructor & Destructor Documentation

◆ Keymap() [1/2]

lmms::Keymap::Keymap ( )

◆ Keymap() [2/2]

lmms::Keymap::Keymap ( QString description,
std::vector< int > newMap,
int newFirst,
int newLast,
int newMiddle,
int newBaseKey,
float newBaseFreq )

Member Function Documentation

◆ getBaseFreq()

float lmms::Keymap::getBaseFreq ( ) const
inline

◆ getBaseKey()

int lmms::Keymap::getBaseKey ( ) const
inline

◆ getDegree()

int lmms::Keymap::getDegree ( int key) const

Return scale degree for a given key, based on current map and first/middle/last notes.

Parameters
MIDIkey to be mapped
Returns
Scale degree defined by the mapping on success, -1 if key isn't mapped

◆ getDescription()

QString lmms::Keymap::getDescription ( ) const

◆ getFirstKey()

int lmms::Keymap::getFirstKey ( ) const
inline

◆ getLastKey()

int lmms::Keymap::getLastKey ( ) const
inline

◆ getMap()

const std::vector< int > & lmms::Keymap::getMap ( ) const
inline

◆ getMiddleKey()

int lmms::Keymap::getMiddleKey ( ) const
inline

◆ getOctave()

int lmms::Keymap::getOctave ( int key) const

Return octave offset for a given key, based on current map and the middle note.

Parameters
MIDIkey to be mapped
Returns
Octave offset defined by the mapping on success, 0 if key isn't mapped

◆ getSize()

std::size_t lmms::Keymap::getSize ( ) const
inline

◆ loadSettings()

void lmms::Keymap::loadSettings ( const QDomElement & element)
overridevirtual

◆ nodeName()

QString lmms::Keymap::nodeName ( void ) const
inlineoverridevirtual

◆ saveSettings()

void lmms::Keymap::saveSettings ( QDomDocument & doc,
QDomElement & element )
overridevirtual

◆ setDescription()

void lmms::Keymap::setDescription ( QString description)

Member Data Documentation

◆ m_baseFreq

float lmms::Keymap::m_baseFreq
private

frequency of the base note (usually A4 @440 Hz)

◆ m_baseKey

int lmms::Keymap::m_baseKey
private

key which is assigned the reference "base note"

◆ m_description

QString lmms::Keymap::m_description
private

name or description of the keymap

◆ m_firstKey

int lmms::Keymap::m_firstKey
private

first key that will be mapped

◆ m_lastKey

int lmms::Keymap::m_lastKey
private

last key that will be mapped

◆ m_map

std::vector<int> lmms::Keymap::m_map
private

key to scale degree mapping

◆ m_middleKey

int lmms::Keymap::m_middleKey
private

first line of the map refers to this key


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