From 160d306f481a90e1ddb37666200934d70902ce5c Mon Sep 17 00:00:00 2001 From: Alexandra Dutton Date: Wed, 24 Apr 2019 13:18:53 -0400 Subject: [PATCH] Record chords (#4938) * Added check for chord to notes recorded from keyboard --- src/gui/editors/PianoRoll.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index fef788885..7d9f95257 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -3522,6 +3522,22 @@ void PianoRoll::finishRecordNote(const Note & n ) it->key(), it->getVolume(), it->getPanning() ); n1.quantizeLength( quantization() ); + + //Get selected chord + const InstrumentFunctionNoteStacking::Chord & chord = InstrumentFunctionNoteStacking::ChordTable::getInstance() + .getChordByName( m_chordModel.currentText() ); + + if( !chord.isEmpty() ) + { + for( int i = 1; i < chord.size(); i++ ) + { + Note new_note( n.length(), it->pos(), it->key() + chord[i] ); + new_note.setPanning( it->getPanning() ); + new_note.setVolume( it->getVolume() ); + m_pattern->addNote( new_note ); + } + } + m_pattern->addNote( n1 ); update(); m_recordingNotes.erase( it );