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
+23 -11
View File
@@ -282,16 +282,28 @@ We will not dig down all the variables here but feel free to read either:
* [sample/forge_project.cfg](./sample/forge_project.cfg) (beginner oriented)
* [default/forge_project.cfg](./default/forge_project.cfg) (more complete)
#### Midi groups
#### Input codes
FORGE allows you to send the midi data in the form of groups.
Each input code can be either a midi event or a key code.
* 1 - 999 -> midi event
* 1001 - 1999 -> key code
* Keyboard modifiers are encoded like this:
* 10000 -> shift
* 100000 -> control
* 1000000 -> alt
* (This means 111082 is control+alt+R)
#### Input groups
FORGE allows you to send the midi/keyboard data in the form of groups.
Each group has the following properties:
* A number of layers with `MIDI_X_ACTIVE_COUNT` (default: `1`)
* Each midi code controlling how to change the active layer with `MIDI_X_ACTIVE_Y`
* A number of codes with `MIDI_X_COUNT`
* Each midi code controlling the active layer with `MIDI_X_Y` (as a `vec3`: `_X` / `_Y` / `_Z`)
* A number of layers with `GROUP_X_ACTIVE_COUNT` (default: `1`)
* Each midi/keyboard code controlling how to change the active layer with `GROUP_X_ACTIVE_Y`
* A number of codes with `GROUP_X_COUNT`
* Each midi/keyboard code controlling the active layer with `GROUP_X_Y` (as a `vec3`: `_X` / `_Y` / `_Z`)
#### States
@@ -299,9 +311,9 @@ FORGE allows to define a "state" to a fragment shader.
This combines several parameters:
* `SELECT_PAGE_COUNT` (default: `1`) + `SELECT_PAGE_X`: define midi codes for pages of item.
* `SELECT_ITEM_COUNT` + `SELECT_ITEM_X`: define midi codes for items per page.
* `SELECT_FRAG_X`: define midi codes to "select" a fragment shader.
* `SELECT_PAGE_COUNT` (default: `1`) + `SELECT_PAGE_X`: define midi/keyboard codes for pages of item.
* `SELECT_ITEM_COUNT` + `SELECT_ITEM_X`: define midi/keyboard codes for items per page.
* `SELECT_FRAG_X`: define midi/keyboard codes to "select" a fragment shader.
The selected fragment shader will have its state updated with either:
@@ -342,8 +354,8 @@ uniform float iTime; // the current time
uniform sampler2D iTex0; // texture 1 (0-based)
uniform sampler2D iTex9; // texture 10
uniform int iSeed1;
uniform vec3 iMidi2_3[7]; // midi group 2, layer 3, size 7
uniform vec3 iMidi3_1[2];
uniform vec3 iGroup2_3[7]; // midi group 2, layer 3, size 7
uniform vec3 iGroup3_1[2];
```
#### Working with `#include`