From ded39c7757c6257557aa7c126cc3589e37c2e492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zkan=20Afacan?= Date: Fri, 8 Jan 2016 03:19:11 +0200 Subject: [PATCH 1/2] PianoKeyboard Remapping #2505 --- include/PianoKeyboard.h | 68 ++++++++++++ include/PianoRoll.h | 6 + src/gui/CMakeLists.txt | 1 + src/gui/PianoKeyboard.cpp | 202 ++++++++++++++++++++++++++++++++++ src/gui/PianoView.cpp | 19 ++++ src/gui/editors/PianoRoll.cpp | 73 ++++++++++++ 6 files changed, 369 insertions(+) create mode 100644 include/PianoKeyboard.h create mode 100644 src/gui/PianoKeyboard.cpp diff --git a/include/PianoKeyboard.h b/include/PianoKeyboard.h new file mode 100644 index 00000000000..d73fe1cf8a6 --- /dev/null +++ b/include/PianoKeyboard.h @@ -0,0 +1,68 @@ +/* + * PianoKeyboard.h - declaration of PianoKeyboard, + * to change note keymapping according to music theory + * + * Copyright (c) 2015 - 2016 Özkan Afacan + * + * This file is part of LMMS - http://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#ifndef __PIANOKEYBOARD_H__ +#define __PIANOKEYBOARD_H__ + +#include + +class PianoKeyboard +{ +public: + + static int getLinuxKey( int key ); + static int getWindowsKey( int key ); + static int getAppleKey( int key ); + + static int getScaledNoteByIndex( int index ); + + static QString getNoteByNumber( int index ) { return m_notes[index]; } + + static int getOctaveNumber() { return m_octave; } + static void setOctaveNumber( int octave ) { m_octave = octave - 3; } + + static QString getScaleNote() { return m_notes[m_scaleNoteIndex]; } + static int getScaleNoteIndex() { return m_scaleNoteIndex; } + static void setScaleNote( QString note ); + + static QString getScaleType() { return m_scaleType; } + static void setScaleType( QString scale ) { m_scaleType = scale; } + + static bool isThereScale() { return (m_scaleType == "No scale") ? false : true; } + +private: + static int m_octave; + static int m_scaleNoteIndex; + static QString m_scaleType; + + static const int majorNotes[]; // W W H W W W H + static const int minorNotes[]; // W H W W H W W + static const int lydianNotes[]; // W W W H W W H + + static QString m_notes[]; + +}; + +#endif diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 92b614076f1..815e4937def 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -157,6 +157,8 @@ protected slots: void updatePosition(const MidiTime & t ); void updatePositionAccompany(const MidiTime & t ); + void octaveChanged(); + void scaleNoteChanged(); void zoomingChanged(); void quantizeChanged(); @@ -267,6 +269,8 @@ protected slots: ComboBoxModel m_quantizeModel; ComboBoxModel m_noteLenModel; ComboBoxModel m_scaleModel; + ComboBoxModel m_noteModel; + ComboBoxModel m_octaveModel; ComboBoxModel m_chordModel; @@ -402,6 +406,8 @@ class PianoRollWindow : public Editor, SerializingObject ComboBox * m_quantizeComboBox; ComboBox * m_noteLenComboBox; ComboBox * m_scaleComboBox; + ComboBox * m_noteComboBox; + ComboBox * m_octaveComboBox; ComboBox * m_chordComboBox; }; diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 16df0b77b8a..47ac50bc027 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -24,6 +24,7 @@ SET(LMMS_SRCS gui/ModelView.cpp gui/PeakControllerDialog.cpp gui/PianoView.cpp + gui/PianoKeyboard.cpp gui/PluginBrowser.cpp gui/SetupDialog.cpp gui/StringPairDrag.cpp diff --git a/src/gui/PianoKeyboard.cpp b/src/gui/PianoKeyboard.cpp new file mode 100644 index 00000000000..4ab6b570c93 --- /dev/null +++ b/src/gui/PianoKeyboard.cpp @@ -0,0 +1,202 @@ +/* + * PianoKeyboard.cpp - Implementation of PianoKeyboard, used + * to change keymapping of PC Keyboard for PianoRoll + * + * Copyright (c) 2015 - 2016 Özkan Afacan + * + * This file is part of LMMS - http://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#include "PianoKeyboard.h" + +int PianoKeyboard::m_octave = 2; +int PianoKeyboard::m_scaleNoteIndex = 0; +QString PianoKeyboard::m_scaleType = "No scale"; + +const int PianoKeyboard::majorNotes[] = {0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19}; +const int PianoKeyboard::minorNotes[] = {0, 2, 3, 5, 7, 8, 10, 12, 14, 15, 17, 19}; +const int PianoKeyboard::lydianNotes[] = {0, 2, 4, 6, 7, 9, 11, 12, 14, 16, 18, 19}; + +QString PianoKeyboard::m_notes[] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"}; + +int PianoKeyboard::getLinuxKey( int key ) +{ + if ( key < 38 && key >= 24 ) + { + return getScaledNoteByIndex( key % 24 ) + 12 * m_octave + m_scaleNoteIndex; + } + else if ( key < 52 && key >= 38 ) + { + return getScaledNoteByIndex( key % 38 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + } + else if ( key < 66 && key >= 52 ) + { + return getScaledNoteByIndex( key % 52 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + } + else if ( key < 24 && key >= 10 ) + { + return getScaledNoteByIndex( key - 10 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + } + else + { + return -100; + } +} + +int PianoKeyboard::getWindowsKey( int key ) +{ + if ( key < 30 && key >= 16 ) + { + return getScaledNoteByIndex( key % 16 ) + 12 * m_octave + m_scaleNoteIndex; + } + else if ( key < 44 && key >= 30 ) + { + return getScaledNoteByIndex( key % 30 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + } + else if ( key < 58 && key >= 44 ) + { + return getScaledNoteByIndex( key % 44 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + } + else if ( key < 16 && key >= 2 ) + { + return getScaledNoteByIndex( key - 2 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + } + else + { + return -100; + } +} + +int PianoKeyboard::getAppleKey( int key ) +{ + switch( key ) + { + // Q Row + case 12: // Q + case 13: // W + case 14: // E + case 15: // R + return getScaledNoteByIndex( key - 12 ) + 12 * m_octave + m_scaleNoteIndex; + case 17: // T + return getScaledNoteByIndex( 4 ) + 12 * m_octave + m_scaleNoteIndex; + case 16: // Y + return getScaledNoteByIndex( 5 ) + 12 * m_octave + m_scaleNoteIndex; + case 32: // U + return getScaledNoteByIndex( 6 ) + 12 * m_octave + m_scaleNoteIndex; + case 34: // I + return getScaledNoteByIndex( 7 ) + 12 * m_octave + m_scaleNoteIndex; + case 31: // O + return getScaledNoteByIndex( 8 ) + 12 * m_octave + m_scaleNoteIndex; + case 35: // P + return getScaledNoteByIndex( 9 ) + 12 * m_octave + m_scaleNoteIndex; + case 33: // [ + return getScaledNoteByIndex( 10 ) + 12 * m_octave + m_scaleNoteIndex; + case 30: // ] + return getScaledNoteByIndex( 11 ) + 12 * m_octave + m_scaleNoteIndex; + + // A Row + case 0: // A + case 1: // S + case 2: // D + case 3: // F + return getScaledNoteByIndex( key ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + case 5: // G + return getScaledNoteByIndex( 4 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + case 4: // H + return getScaledNoteByIndex( 5 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + case 38: // J + return getScaledNoteByIndex( 6 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + case 40: // K + return getScaledNoteByIndex( 7 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + case 37: // L + return getScaledNoteByIndex( 8 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + case 41: // ; + return getScaledNoteByIndex( 9 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + case 39: // ' + return getScaledNoteByIndex( 10 ) + 12 * (m_octave - 1) + m_scaleNoteIndex; + + // Z Row + case 6: // Z + case 7: // X + case 8: // C + case 9: // V + return getScaledNoteByIndex( key - 6 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + case 11: // B + return getScaledNoteByIndex( 4 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + case 45: // N + return getScaledNoteByIndex( 5 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + case 46: // M + return getScaledNoteByIndex( 6 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + case 43: // , + return getScaledNoteByIndex( 7 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + case 47: // . + return getScaledNoteByIndex( 8 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + case 44: // / + return getScaledNoteByIndex( 9 ) + 12 * (m_octave - 2) + m_scaleNoteIndex; + + // Numbers Row + case 18: // 1 + case 19: // 2 + case 20: // 3 + case 21: // 4 + return getScaledNoteByIndex( key - 18 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + case 23: // 5 + return getScaledNoteByIndex( 4 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + case 22: // 6 + return getScaledNoteByIndex( 5 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + case 26: // 7 + return getScaledNoteByIndex( 6 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + case 28: // 8 + return getScaledNoteByIndex( 7 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + case 25: // 9 + return getScaledNoteByIndex( 8 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + case 29: // 0 + return getScaledNoteByIndex( 9 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + case 27: // - + return getScaledNoteByIndex( 10 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + case 24: // = + return getScaledNoteByIndex( 11 ) + 12 * (m_octave + 1) + m_scaleNoteIndex; + + default: return -100; + } +} + +int PianoKeyboard::getScaledNoteByIndex( int index ) +{ + if ( m_scaleType == "Major" ) { return majorNotes[index]; } + else if ( m_scaleType == "Minor" ) { return minorNotes[index]; } + else if ( m_scaleType == "Lydian" ) { return lydianNotes[index]; } + return 0; +} + +void PianoKeyboard::setScaleNote( QString note ) +{ + if ( note == "C" ) { m_scaleNoteIndex = 0; } + else if ( note == "C#" ) { m_scaleNoteIndex = 1; } + else if ( note == "D" ) { m_scaleNoteIndex = 2; } + else if ( note == "D#" ) { m_scaleNoteIndex = 3; } + else if ( note == "E" ) { m_scaleNoteIndex = 4; } + else if ( note == "F" ) { m_scaleNoteIndex = 5; } + else if ( note == "F#" ) { m_scaleNoteIndex = 6; } + else if ( note == "G" ) { m_scaleNoteIndex = 7; } + else if ( note == "G#" ) { m_scaleNoteIndex = 8; } + else if ( note == "A" ) { m_scaleNoteIndex = 9; } + else if ( note == "A#" ) { m_scaleNoteIndex = 10; } + else if ( note == "B" ) { m_scaleNoteIndex = 11; } +} diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index 0f82fd70222..91ccff35bb1 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -45,6 +45,7 @@ #include "PianoView.h" +#include "PianoKeyboard.h" #include "CaptionMenu.h" #include "embed.h" #include "Engine.h" @@ -175,6 +176,12 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) #endif #ifdef LMMS_BUILD_WIN32 + + if ( PianoKeyboard::isThereScale() ) + { + return PianoKeyboard::getWindowsKey( k ); + } + switch( k ) { case 44: return 0; // Z = C @@ -218,6 +225,12 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) } #endif #ifdef LMMS_BUILD_LINUX + + if ( PianoKeyboard::isThereScale() ) + { + return PianoKeyboard::getLinuxKey( k ); + } + switch( k ) { case 52: return 0; // Z = C @@ -260,6 +273,12 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) } #endif #ifdef LMMS_BUILD_APPLE + + if ( PianoKeyboard::isThereScale() ) + { + return PianoKeyboard::getAppleKey( k ); + } + switch( k ) { case 6: return 0; // Z = C diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index a1e25b60d20..2270a4c201a 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -49,6 +49,7 @@ #include "ActionGroup.h" #include "ConfigManager.h" #include "PianoRoll.h" +#include "PianoKeyboard.h" #include "BBTrackContainer.h" #include "Clipboard.h" #include "ComboBox.h" @@ -429,6 +430,31 @@ PianoRoll::PianoRoll() : connect( &m_scaleModel, SIGNAL( dataChanged() ), this, SLOT( updateSemiToneMarkerMenu() ) ); + // Set up scale note model + m_noteModel.addItem( tr("C") ); + + for( int i = 0; i < 12; ++i ) + { + m_noteModel.addItem( PianoKeyboard::getNoteByNumber(i) ); + } + + m_noteModel.setValue( 0 ); + + connect( &m_noteModel, SIGNAL( dataChanged() ), + this, SLOT( scaleNoteChanged() ) ); + + // Set up octave model + m_octaveModel.addItem( tr("5") ); + for( int i = 3; i <= 8; ++i ) + { + m_octaveModel.addItem( QString::number(i) ); + } + + m_octaveModel.setValue( 0 ); + connect( &m_octaveModel, SIGNAL( dataChanged() ), + this, SLOT( octaveChanged() ) ); + + // Set up chord model m_chordModel.addItem( tr("No chord") ); for( const InstrumentFunctionNoteStacking::Chord& chord : chord_table ) @@ -3819,6 +3845,16 @@ void PianoRoll::updatePositionAccompany( const MidiTime & t ) +void PianoRoll::scaleNoteChanged() +{ + PianoKeyboard::setScaleNote( m_noteModel.currentText() ); + update(); +} +void PianoRoll::octaveChanged() +{ + PianoKeyboard::setOctaveNumber( m_octaveModel.currentText().toInt() ); + update(); +} void PianoRoll::zoomingChanged() { @@ -3872,6 +3908,8 @@ void PianoRoll::updateSemiToneMarkerMenu() emit semiToneMarkerMenuScaleSetEnabled( ! scale.isEmpty() ); emit semiToneMarkerMenuChordSetEnabled( ! chord.isEmpty() ); + + PianoKeyboard::setScaleType( m_scaleModel.currentText() ); } @@ -4090,6 +4128,16 @@ PianoRollWindow::PianoRollWindow() : m_scaleComboBox->setModel( &m_editor->m_scaleModel ); m_scaleComboBox->setFixedSize( 105, 22 ); + // setup scale-note-stuff + m_noteComboBox = new ComboBox( m_toolBar ); + m_noteComboBox->setModel( &m_editor->m_noteModel ); + m_noteComboBox->setFixedSize( 42, 22 ); + + // setup octave-stuff + m_octaveComboBox = new ComboBox( m_toolBar ); + m_octaveComboBox->setModel( &m_editor->m_octaveModel ); + m_octaveComboBox->setFixedSize( 36, 22 ); + // setup chord-stuff QLabel * chord_lbl = new QLabel( m_toolBar ); chord_lbl->setPixmap( embed::getIconPixmap( "chord" ) ); @@ -4114,6 +4162,12 @@ PianoRollWindow::PianoRollWindow() : zoomAndNotesToolBar->addWidget( scale_lbl ); zoomAndNotesToolBar->addWidget( m_scaleComboBox ); + zoomAndNotesToolBar->addSeparator(); + zoomAndNotesToolBar->addWidget( m_noteComboBox ); + + zoomAndNotesToolBar->addSeparator(); + zoomAndNotesToolBar->addWidget( m_octaveComboBox ); + zoomAndNotesToolBar->addSeparator(); zoomAndNotesToolBar->addWidget( chord_lbl ); zoomAndNotesToolBar->addWidget( m_chordComboBox ); @@ -4155,6 +4209,25 @@ PianoRollWindow::PianoRollWindow() : "and in the key you have selected!" ) ); + m_noteComboBox->setWhatsThis( + tr( + "Let you select a note for scale." + "After you have chosen the scale type you want " + "in scale drop-down menu, " + "you can select a note for scale, " + "that will remap pc keyboard according to selected note." + "Q key will map to selected note and octave." + ) ); + + m_octaveComboBox->setWhatsThis( + tr( + "Let you select a octave for scale." + "After you have chosen the scale type you want " + "in scale drop-down menu, " + "you can select a octave for scale, " + "that will remap pc keyboard according to selected octave." + "Q key will map to selected note and octave." + ) ); m_chordComboBox->setWhatsThis( tr( From f534df50fd0c1679befa57648d2c5ed64b173208 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Feb 2016 04:21:12 +0200 Subject: [PATCH 2/2] Keyboard Remapping Fixes #2505 --- include/PianoKeyboard.h | 11 ++++++----- src/gui/PianoKeyboard.cpp | 17 +++++++++++++---- src/gui/editors/PianoRoll.cpp | 7 ++----- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/include/PianoKeyboard.h b/include/PianoKeyboard.h index d73fe1cf8a6..b9811a3a850 100644 --- a/include/PianoKeyboard.h +++ b/include/PianoKeyboard.h @@ -47,22 +47,23 @@ class PianoKeyboard static int getScaleNoteIndex() { return m_scaleNoteIndex; } static void setScaleNote( QString note ); - static QString getScaleType() { return m_scaleType; } - static void setScaleType( QString scale ) { m_scaleType = scale; } + static QString getScaleName() { return scaleTypes[m_scaleType]; } + static void setScaleType( int scale ) { m_scaleType = scale; } - static bool isThereScale() { return (m_scaleType == "No scale") ? false : true; } + static bool isThereScale() { return (m_scaleType == 0) ? false : true; } private: static int m_octave; static int m_scaleNoteIndex; - static QString m_scaleType; + static int m_scaleType; + + static const QString scaleTypes[]; static const int majorNotes[]; // W W H W W W H static const int minorNotes[]; // W H W W H W W static const int lydianNotes[]; // W W W H W W H static QString m_notes[]; - }; #endif diff --git a/src/gui/PianoKeyboard.cpp b/src/gui/PianoKeyboard.cpp index 4ab6b570c93..c7ac8b7fac4 100644 --- a/src/gui/PianoKeyboard.cpp +++ b/src/gui/PianoKeyboard.cpp @@ -27,7 +27,16 @@ int PianoKeyboard::m_octave = 2; int PianoKeyboard::m_scaleNoteIndex = 0; -QString PianoKeyboard::m_scaleType = "No scale"; +int PianoKeyboard::m_scaleType = 0; + +const QString PianoKeyboard::scaleTypes[] = +{ + "No scale", "Major", "Harmonic minor", "Melodic minor", + "Diminished", "Major bebop", "Dominant bebop", "Arabic", + "Enigmatic", "Neopolitan", "Neopolitan minor", "Hungarian minor", + "Dorian", "Phrygolydian", "Lydian", "Mixolydian", "Aeolian", + "Locrian", "Minor", "Chromatic", "Half-Whole Diminished" +}; const int PianoKeyboard::majorNotes[] = {0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19}; const int PianoKeyboard::minorNotes[] = {0, 2, 3, 5, 7, 8, 10, 12, 14, 15, 17, 19}; @@ -179,9 +188,9 @@ int PianoKeyboard::getAppleKey( int key ) int PianoKeyboard::getScaledNoteByIndex( int index ) { - if ( m_scaleType == "Major" ) { return majorNotes[index]; } - else if ( m_scaleType == "Minor" ) { return minorNotes[index]; } - else if ( m_scaleType == "Lydian" ) { return lydianNotes[index]; } + if ( getScaleName() == "Major" ) { return majorNotes[index]; } + else if ( getScaleName() == "Minor" ) { return minorNotes[index]; } + else if ( getScaleName() == "Lydian" ) { return lydianNotes[index]; } return 0; } diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 2270a4c201a..a6addf5ffb1 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -431,8 +431,6 @@ PianoRoll::PianoRoll() : this, SLOT( updateSemiToneMarkerMenu() ) ); // Set up scale note model - m_noteModel.addItem( tr("C") ); - for( int i = 0; i < 12; ++i ) { m_noteModel.addItem( PianoKeyboard::getNoteByNumber(i) ); @@ -444,13 +442,12 @@ PianoRoll::PianoRoll() : this, SLOT( scaleNoteChanged() ) ); // Set up octave model - m_octaveModel.addItem( tr("5") ); for( int i = 3; i <= 8; ++i ) { m_octaveModel.addItem( QString::number(i) ); } - m_octaveModel.setValue( 0 ); + m_octaveModel.setValue( 2 ); connect( &m_octaveModel, SIGNAL( dataChanged() ), this, SLOT( octaveChanged() ) ); @@ -3909,7 +3906,7 @@ void PianoRoll::updateSemiToneMarkerMenu() emit semiToneMarkerMenuScaleSetEnabled( ! scale.isEmpty() ); emit semiToneMarkerMenuChordSetEnabled( ! chord.isEmpty() ); - PianoKeyboard::setScaleType( m_scaleModel.currentText() ); + PianoKeyboard::setScaleType( m_scaleModel.value() ); }