Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lib/services/layout/pad_layouts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ enum Layout {
scaleNotesCustom('In Key', custom: true),
sequential('Chromatic - Sequential', chromatic: true),
scaleNotesOnly('In Key - Sequential'),
drumRack('Drum Rack'),

progrChange('Program Changes', chromatic: true),

Expand Down Expand Up @@ -54,6 +55,9 @@ enum Layout {
return GridChromaticByCustomIntervals(settings);
case Layout.sequential:
return GridChromaticByRowInterval(settings, rowInterval: width);

case Layout.drumRack:
return GridChromaticDrumRack(settings);

case Layout.scaleNotesCustom:
return GridInScaleCustom(settings);
Expand Down Expand Up @@ -136,6 +140,25 @@ class GridChromaticByRowInterval extends Grid {
}
}

//// A vertical chromatic drum rack Grid
class GridChromaticDrumRack extends Grid {
GridChromaticDrumRack(super.settings);

@override
List<CustomPad> get list {
final List<CustomPad> grid = [];
for (int row = 0; row < settings.height; row++) {
for (int col = 0; col < settings.width; col++) {
int numVerticalRacks = 1 + (settings.height % 4);
int rackOffset = ((col ~/ 4) * 16 * numVerticalRacks);
int rowOffset = (col % 4) + row * 4;
grid.add(CustomPad(settings.baseNote + rackOffset + rowOffset));
}
}
return grid;
}
}

/// Grid that has custom set semitone intervals on the x and y axis
class GridChromaticByCustomIntervals extends Grid {
GridChromaticByCustomIntervals(super.settings);
Expand Down