Skip to content

Commit

Permalink
Record chords (LMMS#4938)
Browse files Browse the repository at this point in the history
* Added check for chord to notes recorded from keyboard
  • Loading branch information
alxdttn authored and zonkmachine committed Apr 24, 2019
1 parent cbfe407 commit 10e7103
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 10e7103

Please sign in to comment.