Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
576ffba
New API for NotePad
203Null Sep 25, 2025
3e04888
Control bar progress
203Null Sep 26, 2025
361f16d
Add const to midi packet functions
203Null Sep 26, 2025
b1a6af4
Note Latch
203Null Sep 26, 2025
2496900
Note Latch Feature complete + some rework
203Null Sep 26, 2025
ff822a5
Key selector in Note app
203Null Sep 26, 2025
aadc9eb
Notepad improve
203Null Sep 26, 2025
a8b8064
KeyLatch updates
203Null Sep 26, 2025
fd84fd6
Chord effect
203Null Sep 26, 2025
21cad02
Chord Inversion + Arp
203Null Sep 27, 2025
a71da63
ChordEffect bug fixes
203Null Sep 27, 2025
ace91c4
Enabled arp
203Null Sep 27, 2025
2d6f2a9
Working Arp
203Null Sep 27, 2025
d56c128
NoteApp NVS check size mismatch
203Null Sep 27, 2025
42cc103
arp config save to nvs
203Null Sep 27, 2025
7d05be4
NoteLayoutConfig to NotePadConfig
203Null Sep 27, 2025
5cc8c2b
move control bar toggle
203Null Sep 27, 2025
74c3415
Arp config menu
203Null Sep 27, 2025
c7acfc1
Updated UINumModifier
203Null Sep 27, 2025
1eb08cb
Arp visualizer
203Null Sep 27, 2025
8fce9d2
Timed Display
203Null Sep 27, 2025
9be9075
Updated UIcomponent.h
203Null Sep 27, 2025
d2c63bc
Disable arp control if control bar is disabled
203Null Sep 27, 2025
619adeb
Inf display
203Null Sep 27, 2025
d26f1d3
Repeat control
203Null Sep 27, 2025
f4862f6
Control bar Shift configs
203Null Sep 27, 2025
95f06d9
fix led for REP
203Null Sep 27, 2025
44619e8
Fixed arp step offset
203Null Sep 27, 2025
135c460
Make timedDisplay close faster
203Null Sep 27, 2025
61e77ae
note wip
203Null Sep 28, 2025
6dc19c9
Fix F in inf
203Null Sep 28, 2025
e4ab2c9
Remove active notes
203Null Sep 28, 2025
78c78ce
Arp control fix
203Null Sep 28, 2025
5fd41d5
Fix keymap not updating from control bar
203Null Sep 28, 2025
3cc5547
Octave button color and new range
203Null Sep 28, 2025
b0e1559
More octave range
203Null Sep 28, 2025
58103e8
UI button don't show text if text is empty
203Null Sep 28, 2025
7ae22c3
Note App V2 UI
203Null Sep 28, 2025
0e5ffc3
Note app send midi on all ports
203Null Sep 28, 2025
02e59ce
Fix note app dimming
203Null Sep 28, 2025
bc7ded8
Channel selector text UI
203Null Sep 28, 2025
252d91f
Better layout UI
203Null Sep 28, 2025
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
186 changes: 186 additions & 0 deletions Applications/Note/ArpDirVisualizer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
#pragma once
#include "MatrixOS.h"
#include "ui/UI.h"
#include "Arpeggiator.h"

struct ArpDirVisual {
uint8_t step[8]; // 8 steps to visualize the pattern, 0=no show, 1-4=first cycle, 5-8=second cycle
};

const ArpDirVisual arpDirVisuals[16] = {
// 0 as no show, 1~4 means first repeat, 5~8 means second repeat
/*ARP_UP*/ {{1, 2, 3, 4, 5, 6, 7, 8}},
/*ARP_DOWN*/ {{4, 3, 2, 1, 8, 7, 6, 5}},
/*ARP_UP_DOWN*/ {{1, 2, 3, 4, 3, 2, 5, 0}},
/*ARP_DOWN_UP*/ {{4, 3, 2, 1, 2, 3, 8, 7}},
/*ARP_UP_N_DOWN*/ {{1, 2, 3, 4, 4, 3, 2, 5}},
/*ARP_DOWN_N_UP*/ {{4, 3, 2, 1, 1, 2, 3, 8}},
/*ARP_RANDOM*/ {{0, 0, 0, 0, 0, 0, 0, 0}},
/*ARP_PLAY_ORDER*/ {{0, 0, 0, 0, 0, 0, 0, 0}},
/*ARP_CONVERGE*/ {{1, 4, 2, 3, 5, 8, 6, 7}},
/*ARP_DIVERGE*/ {{2, 3, 1, 4, 6, 7, 5, 8}},
/*ARP_CON_DIVERGE*/ {{1, 4, 2, 3, 2, 3, 1, 4}},
/*ARP_DIV_CONVERGE*/ {{2, 3, 1, 4, 1, 4, 2, 3}},
/*ARP_PINKY_UP*/ {{1, 4, 2, 4, 3, 4, 5, 8}},
/*ARP_PINKY_UP_DOWN*/ {{1, 4, 2, 4, 3, 4, 2, 4}},
/*ARP_THUMB_UP*/ {{1, 2, 1, 3, 1, 4, 5, 6}},
/*ARP_THUMB_UP_DOWN*/ {{1, 2, 1, 3, 1, 4, 1, 3}},
};

class ArpDirVisualizer : public UIComponent {
public:
Color color;
ArpDirection* direction;
ArpDirection lastDirection;
uint64_t lastUpdateTime = 0;
uint8_t currentStep = 0;

ArpDirVisualizer(ArpDirection* direction, Color color) {
this->direction = direction;
this->lastDirection = *direction;
this->color = color;
}

virtual Color GetColor() { return color; }
virtual Dimension GetSize() { return Dimension(8, 4); }

bool IsEnabled() {
if (enableFunc) {
enabled = (*enableFunc)();
}
if(!enabled)
{
currentStep = 0;
lastUpdateTime = 0;
}
return enabled;
}

virtual bool Render(Point origin) {
// For other modes, use the animated pattern from arpDirVisuals
uint64_t currentTime = MatrixOS::SYS::Millis();

// Reset animation if direction changed or not inited
if (*direction != lastDirection || lastUpdateTime == 0) {
currentStep = 0;
lastUpdateTime = currentTime;
lastDirection = *direction;
}

if(*direction == ARP_RANDOM)
{
// R
MatrixOS::LED::SetColor(origin + Point(0, 0), color);
MatrixOS::LED::SetColor(origin + Point(0, 1), color);
MatrixOS::LED::SetColor(origin + Point(0, 2), color);
MatrixOS::LED::SetColor(origin + Point(0, 3), color);
MatrixOS::LED::SetColor(origin + Point(1, 0), color);
MatrixOS::LED::SetColor(origin + Point(1, 2), color);
MatrixOS::LED::SetColor(origin + Point(2, 0), color);
MatrixOS::LED::SetColor(origin + Point(2, 1), color);
MatrixOS::LED::SetColor(origin + Point(2, 3), color);

// n
MatrixOS::LED::SetColor(origin + Point(3, 1), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(3, 2), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(3, 3), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(4, 1), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(5, 2), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(5, 3), Color(0xFFFFFF));

// d
MatrixOS::LED::SetColor(origin + Point(6, 2), color);
MatrixOS::LED::SetColor(origin + Point(6, 3), color);
MatrixOS::LED::SetColor(origin + Point(7, 0), color);
MatrixOS::LED::SetColor(origin + Point(7, 1), color);
MatrixOS::LED::SetColor(origin + Point(7, 2), color);
MatrixOS::LED::SetColor(origin + Point(7, 3), color);
}
else if(*direction == ARP_PLAY_ORDER)
{
// O
MatrixOS::LED::SetColor(origin + Point(0, 0), color);
MatrixOS::LED::SetColor(origin + Point(0, 1), color);
MatrixOS::LED::SetColor(origin + Point(0, 2), color);
MatrixOS::LED::SetColor(origin + Point(0, 3), color);
MatrixOS::LED::SetColor(origin + Point(1, 0), color);
MatrixOS::LED::SetColor(origin + Point(1, 3), color);
MatrixOS::LED::SetColor(origin + Point(2, 0), color);
MatrixOS::LED::SetColor(origin + Point(2, 1), color);
MatrixOS::LED::SetColor(origin + Point(2, 2), color);
MatrixOS::LED::SetColor(origin + Point(2, 3), color);

// R
MatrixOS::LED::SetColor(origin + Point(3, 0), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(3, 1), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(3, 2), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(3, 3), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(4, 0), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(4, 2), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(5, 0), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(5, 1), Color(0xFFFFFF));
MatrixOS::LED::SetColor(origin + Point(5, 3), Color(0xFFFFFF));

// d
MatrixOS::LED::SetColor(origin + Point(6, 2), color);
MatrixOS::LED::SetColor(origin + Point(6, 3), color);
MatrixOS::LED::SetColor(origin + Point(7, 0), color);
MatrixOS::LED::SetColor(origin + Point(7, 1), color);
MatrixOS::LED::SetColor(origin + Point(7, 2), color);
MatrixOS::LED::SetColor(origin + Point(7, 3), color);
}
else
{
// Update animation step every 300ms
if (currentTime - lastUpdateTime > 300) {
currentStep = (currentStep + 1) % 9;
lastUpdateTime = currentTime;
}

const ArpDirVisual& visual = arpDirVisuals[*direction];

for (uint8_t i = 0; i < 8; i++) {
uint8_t stepValue = visual.step[i];

if (stepValue == 0) {
// No show - skip
continue;
}

uint8_t y = stepValue; // 1-based y coordinate
Point xy;
Color ledColor;

if (y <= 4) {
// Normal range: render at Point(i, 4-y)
xy = origin + Point(i, 4 - y);
if (i < currentStep) {
ledColor = color; // Current step - bright
} else {
ledColor = color.Dim(); // Dim
}
} else {
// y > 4: render at Point(i, 8-y) with white color
xy = origin + Point(i, 8 - y);
if (i < currentStep) {
ledColor = Color(0xFFFFFF); // Current step - bright white
} else {
ledColor = Color(0xFFFFFF).Dim(); // Dim white
}
}

MatrixOS::LED::SetColor(xy, ledColor);
}
}
return true;
}

virtual bool KeyEvent(Point xy, KeyInfo* keyInfo) {
// No key interaction for visualizer
if(keyInfo->State() == HOLD)
{
MatrixOS::UIUtility::TextScroll(arpDirectionNames[*direction], color);
}
return false;
}
};
Loading
Loading