@@ -119,7 +119,7 @@ bool PatternPad::KeyEvent(Point xy, KeyInfo* keyInfo)
119119 uint16_t startTime = step * pulsesPerStep;
120120 uint16_t endTime = startTime + pulsesPerStep - 1 ;
121121 uint8_t channel = sequencer->sequence .GetChannel (track);
122-
122+
123123 // Remove notes from noteActive and send noteOff
124124 auto it = pattern->events .lower_bound (startTime);
125125 while (it != pattern->events .end () && it->first <= endTime)
@@ -137,8 +137,10 @@ bool PatternPad::KeyEvent(Point xy, KeyInfo* keyInfo)
137137 ++it;
138138 }
139139
140- sequencer->sequence .PatternClearStepEvents (pattern, step, pulsesPerStep);
141- sequencer->SetMessage (SequencerMessage::CLEARED);
140+ if (sequencer->sequence .PatternClearStepEvents (pattern, step, pulsesPerStep))
141+ {
142+ sequencer->SetMessage (SequencerMessage::CLEARED);
143+ }
142144 }
143145 else if (!sequencer->noteSelected .empty ())
144146 {
@@ -275,13 +277,10 @@ bool PatternPad::Render(Point origin)
275277 if ((sequencer->CopyActive () && sequencer->sequence .Playing (track) == false ) || sequencer->ClearActive ())
276278 {
277279 // Render Base
278- if (sequencer-> copySourceStep > = 0 )
280+ for ( uint8_t step = 0 ; step < pattern-> steps ; step++ )
279281 {
280- for (uint8_t step = 0 ; step < pattern->steps ; step++)
281- {
282- Point point = Point (step % width, step / width);
283- MatrixOS::LED::SetColor (patternOrigin + point, trackColor.Dim ());
284- }
282+ Point point = Point (step % width, step / width);
283+ MatrixOS::LED::SetColor (patternOrigin + point, sequencer->copySourceStep >= 0 ? trackColor.Dim () : Color::White.Dim (32 ));
285284 }
286285
287286 // Render Step
0 commit comments