refactor: not overlaping keyboard and midi
Clang Lint CI / lint-no-video (push) Successful in 1m0s
Clang Build CI / run-no-video (push) Successful in 1m0s
Clang Build CI / run-video (push) Successful in 1m1s
Clang Build CI / build-release (push) Successful in 1m56s
Clang Lint CI / lint-video (push) Successful in 1m59s

This commit is contained in:
2026-05-14 22:27:39 +02:00
parent 28b87d316a
commit 6abf050bcc
16 changed files with 499 additions and 420 deletions
+108 -50
View File
@@ -35,17 +35,16 @@ uniform int iState8;
uniform int iActive1;
uniform int iActive2;
uniform vec3 iMidi2_1[7];
uniform vec3 iMidi2_2[7];
uniform vec3 iMidi2_3[7];
uniform vec3 iMidi3_1[2];
uniform vec3 iGroup2_1[7];
uniform vec3 iGroup2_2[7];
uniform vec3 iGroup2_3[7];
uniform vec3 iGroup3_1[2];
vec4 debug(vec2 vUV)
{
// start
vec2 uv0 = vUV.st;
vec2 uv0 = vUV.st;
float ratio = iResolution.x / iResolution.y;
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1);
@@ -92,30 +91,90 @@ vec4 debug(vec2 vUV)
if (random_mfx) {
selected_mfx = int(randTime(iSeed8 + 100) * 14);
}
float fxa_value = magic(iMidi2_1[6].xy, vec3(1, 0, 0), iSeed5);
bool fxa_invert = magic_trigger(vec3(iMidi2_1[6].z, 0, 0), iSeed5);
float fxb_value = magic(iMidi2_2[6].xy, vec3(1, 0, 0), iSeed6);
bool fxb_invert = magic_trigger(vec3(iMidi2_2[6].z, 0, 0), iSeed6);
float mfx_value = magic(iMidi2_3[6].xy, vec3(1, 0, 0), iSeed8);
bool mfx_invert = magic_trigger(vec3(iMidi2_3[6].z, 0, 0), iSeed8);
float mix_value = magic(iMidi3_1[1].xy, vec3(1, 0, 0), iSeed7);
float fxa_value = magic(iGroup2_1[6].xy, vec3(1, 0, 0), iSeed5);
bool fxa_invert = magic_trigger(vec3(iGroup2_1[6].z, 0, 0), iSeed5);
float fxb_value = magic(iGroup2_2[6].xy, vec3(1, 0, 0), iSeed6);
bool fxb_invert = magic_trigger(vec3(iGroup2_2[6].z, 0, 0), iSeed6);
float mfx_value = magic(iGroup2_3[6].xy, vec3(1, 0, 0), iSeed8);
bool mfx_invert = magic_trigger(vec3(iGroup2_3[6].z, 0, 0), iSeed8);
float mix_value = magic(iGroup3_1[1].xy, vec3(1, 0, 0), iSeed7);
mix_value = mix(mix_value, mix_value * 0.9 + 0.05, iDemo);
bool mix_type = magic_trigger(vec3(iMidi3_1[0].x, 0, 0), iSeed7 + 10);
bool mix_type = magic_trigger(vec3(iGroup3_1[0].x, 0, 0), iSeed7 + 10);
// logic
const int texts[10][5] = {
{0x46, 0x50, 0x53, 0x00, 0x00}, // FPS
{0x54, 0x45, 0x4D, 0x50, 0x4F}, // TEMPO
{0x54, 0x49, 0x4D, 0x45, 0x00}, // TIME
{0x44, 0x45, 0x4D, 0x4F, 0x00}, // DEMO
{0x4C, 0x49, 0x56, 0x45, 0x00}, // LIVE
{0x52, 0x41, 0x4E, 0x44, 0x00}, // RAND
{0x53, 0x52, 0x43, 0x00, 0x00}, // SRC
{0x46, 0x58, 0x00, 0x00, 0x00}, // FX
{0x49, 0x4E, 0x00, 0x00, 0x00}, // IN
{0x4D, 0x46, 0x58, 0x00, 0x00}, // MFX
};
{
0x46,
0x50,
0x53,
0x00,
0x00
}, // FPS
{
0x54,
0x45,
0x4D,
0x50,
0x4F
}, // TEMPO
{
0x54,
0x49,
0x4D,
0x45,
0x00
}, // TIME
{
0x44,
0x45,
0x4D,
0x4F,
0x00
}, // DEMO
{
0x4C,
0x49,
0x56,
0x45,
0x00
}, // LIVE
{
0x52,
0x41,
0x4E,
0x44,
0x00
}, // RAND
{
0x53,
0x52,
0x43,
0x00,
0x00
}, // SRC
{
0x46,
0x58,
0x00,
0x00,
0x00
}, // FX
{
0x49,
0x4E,
0x00,
0x00,
0x00
}, // IN
{
0x4D,
0x46,
0x58,
0x00,
0x00
}, // MFX
};
vec2 uv2 = uv1;
@@ -128,21 +187,20 @@ vec4 debug(vec2 vUV)
// base frame
float f =
h_rect(uv2, vec2(-5, -2), vec2(1), 0.1) +
h_rect(uv2, vec2(-2, -2), vec2(1), 0.1) +
rect(uv2, vec2(-3.5, -2), vec2(0.5, 0.1)) +
h_rect(uv2, vec2(-5, 2), vec2(1), 0.1) +
h_rect(uv2, vec2(-2, 2), vec2(1), 0.1) +
rect(uv2, vec2(-3.5, 2), vec2(0.5, 0.1)) +
h_rect(uv2, vec2(2, 0), vec2(1), 0.1) +
h_rect(uv2, vec2(5, 0), vec2(1), 0.1) +
rect(uv2, vec2(3.5, 0), vec2(0.5, 0.1)) +
rect(uv2, vec2(0.55, -2), vec2(1.5, 0.1)) +
rect(uv2, vec2(2, -1.55), vec2(0.1, 0.55)) +
rect(uv2, vec2(0.55, 2), vec2(1.5, 0.1)) +
rect(uv2, vec2(2, 1.55), vec2(0.1, 0.55)) +
rect(uv2, vec2(6.8, 0), vec2(0.75, 0.1)) +
h_circle(uv2, vec2(7.8, 0), 0.3, 0.1)
;
h_rect(uv2, vec2(-2, -2), vec2(1), 0.1) +
rect(uv2, vec2(-3.5, -2), vec2(0.5, 0.1)) +
h_rect(uv2, vec2(-5, 2), vec2(1), 0.1) +
h_rect(uv2, vec2(-2, 2), vec2(1), 0.1) +
rect(uv2, vec2(-3.5, 2), vec2(0.5, 0.1)) +
h_rect(uv2, vec2(2, 0), vec2(1), 0.1) +
h_rect(uv2, vec2(5, 0), vec2(1), 0.1) +
rect(uv2, vec2(3.5, 0), vec2(0.5, 0.1)) +
rect(uv2, vec2(0.55, -2), vec2(1.5, 0.1)) +
rect(uv2, vec2(2, -1.55), vec2(0.1, 0.55)) +
rect(uv2, vec2(0.55, 2), vec2(1.5, 0.1)) +
rect(uv2, vec2(2, 1.55), vec2(0.1, 0.55)) +
rect(uv2, vec2(6.8, 0), vec2(0.75, 0.1)) +
h_circle(uv2, vec2(7.8, 0), 0.3, 0.1);
if (iDemo < 1 && iInputFormat1 == YUYV_FOURCC) {
f += circle(uv2, vec2(-9, 2), 0.3);
@@ -183,14 +241,14 @@ vec4 debug(vec2 vUV)
// show src/fx
f += write_5(uv3 * 0.75, vec2(-11.6,-1.8), texts[6]);
f += write_5(uv3 * 0.75, vec2(-4.2,-1.8), texts[7]);
f += write_5(uv3 * 0.75, vec2(-11.6, -1.8), texts[6]);
f += write_5(uv3 * 0.75, vec2(-4.2, -1.8), texts[7]);
f += char_at(uv3 * 0.5, vec2(-11.5, 3.5), 0x41);
f += char_at(uv3 * 0.5, vec2(-11.5, -6), 0x42);
if (iDemo < 1 && (iInputFormat1 == YUYV_FOURCC || iInputFormat2 == YUYV_FOURCC)) {
f += write_5(uv3 * 0.75, vec2(-19.7,-1.8), texts[8]);
f += write_5(uv3 * 0.75, vec2(-19.7, -1.8), texts[8]);
}
f += write_5(uv3 * 0.75, vec2(10.9,2), texts[9]);
f += write_5(uv3 * 0.75, vec2(10.9, 2), texts[9]);
// show inputs / feedback
float line_a_a = rect(uv2, vec2(-7.5, 2), vec2(1.5, 0.1));
@@ -236,21 +294,21 @@ vec4 debug(vec2 vUV)
float x = 0;
x = -15;
f += write_5(uv3, vec2(x - 4.5,13), texts[1]);
f += write_int(uv3, vec2(x + 1.5,13), int(iTempo), 3);
f += write_5(uv3, vec2(x - 4.5, 13), texts[1]);
f += write_int(uv3, vec2(x + 1.5, 13), int(iTempo), 3);
v = fract(iBeats);
f += h_rect(uv3, vec2(x, 12), vec2(4, 0.5), 0.2);
f += rect(uv3, vec2(x + 4 * v - 4, 12), vec2(4 * v, 0.4));
x = 15;
if (iAutoRand > 0) {
f += write_5(uv3, vec2(x - 4.5,13), texts[5]);
f += write_int(uv3, vec2(x - 0.5,13), int(iAutoRandCycle), 5);
f += write_5(uv3, vec2(x - 4.5, 13), texts[5]);
f += write_int(uv3, vec2(x - 0.5, 13), int(iAutoRandCycle), 5);
v = fract(iBeats / iAutoRandCycle);
} else {
f += write_int(uv3, vec2(x - 0.5,13), int(iTime), 5);
f += write_int(uv3, vec2(x - 0.5, 13), int(iTime), 5);
v = fract(iTime);
f += write_5(uv3, vec2(x - 4.5,13), texts[2]);
f += write_5(uv3, vec2(x - 4.5, 13), texts[2]);
}
f += h_rect(uv3, vec2(x, 12), vec2(4, 0.5), 0.2);
f += rect(uv3, vec2(x + 4 * v - 4, 12), vec2(4 * v, 0.4));