Skip to content

Commit

Permalink
fixed sequencer mode for tracks set to drum layout. they now show chr…
Browse files Browse the repository at this point in the history
…omatic notes regardless of the global scale.
  • Loading branch information
jrcurtis committed Mar 28, 2016
1 parent 786e7dc commit 5dc6ed2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/grid.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,22 @@ void grid_update_cache(Sequencer* sr, int8_t translation)
max_y = 1;
}

uint8_t scale_deg = (s->y + min_y) % lp_scale.num_notes;
uint8_t octave = (s->y + min_y) / lp_scale.num_notes;
uint8_t drums = flag_is_set(s->layout.row_offset, LYT_DRUMS);
uint8_t num_notes = drums ? NUM_NOTES : lp_scale.num_notes;
uint8_t scale_deg;
uint8_t octave;

scale_deg = (s->y + min_y) % num_notes;
octave = (s->y + min_y) / num_notes;

for (uint8_t i = min_y; i < max_y; i++)
{
note_numbers[i] = lp_scale.offsets[scale_deg]
note_numbers[i] = (drums ? scale_deg : lp_scale.offsets[scale_deg])
+ s->layout.root_note
+ NUM_NOTES * octave;

scale_deg++;
if (scale_deg >= lp_scale.num_notes)
if (scale_deg >= num_notes)
{
scale_deg = 0;
octave++;
Expand Down

0 comments on commit 5dc6ed2

Please sign in to comment.