diff --git a/include/Pattern.h b/include/Pattern.h index 41b76553c17..94eef796c06 100644 --- a/include/Pattern.h +++ b/include/Pattern.h @@ -88,7 +88,7 @@ class EXPORT Pattern : public TrackContentObject { return m_patternType; } - + void checkType(); // next/previous track based on position in the containing track Pattern * previousPattern() const; @@ -132,7 +132,6 @@ protected slots: MidiTime beatPatternLength() const; void setType( PatternTypes _new_pattern_type ); - void checkType(); void resizeToFirstTrack(); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 52cdd585e5c..adbf64f1889 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -2451,6 +2451,11 @@ void PianoRoll::dragNotes( int x, int y, bool alt, bool shift, bool ctrl ) note->setPos( MidiTime( pos_ticks ) ); note->setKey( key_num ); + // If dragging beat notes check if pattern should be MelodyPattern + if( note->length() < 0 ) + { + m_pattern->checkType(); + } } } } diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index c3b0c0670cb..d3e3c1bda51 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -369,7 +369,9 @@ void Pattern::checkType() NoteVector::Iterator it = m_notes.begin(); while( it != m_notes.end() ) { - if( ( *it )->length() > 0 ) + if( ( *it )->length() > 0 || + ( *it )->pos() % ( MidiTime::ticksPerTact() / + MidiTime::stepsPerTact() ) ) { setType( MelodyPattern ); return;