Record chords (#4938)

* Added check for chord to notes recorded from keyboard
This commit is contained in:
Alexandra Dutton
2019-04-24 13:18:53 -04:00
committed by Oskar Wallgren
parent 461faccaa0
commit 160d306f48

View File

@@ -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 );