-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🟦 [Nodes] Added "MIDI Multi-Select with Transition"
- Loading branch information
1 parent
54c7b96
commit 8bc9e2b
Showing
15 changed files
with
1,545 additions
and
4 deletions.
There are no files selected for viewing
Submodule Cool
updated
2 files
+26 −3 | src/Cool/Midi/MidiManager.cpp | |
+11 −4 | src/Cool/Midi/MidiManager.h |
63 changes: 63 additions & 0 deletions
63
Nodes/12 Image Blend/MIDI Multi-Select with Transition.clbnode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro | ||
|
||
INPUT float 'Transition Duration'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 1'; | ||
INPUT int 'ID 1'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 2'; | ||
INPUT int 'ID 2'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 3'; | ||
INPUT int 'ID 3'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 4'; | ||
INPUT int 'ID 4'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 5'; | ||
INPUT int 'ID 5'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 6'; | ||
INPUT int 'ID 6'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 7'; | ||
INPUT int 'ID 7'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 8'; | ||
INPUT int 'ID 8'; | ||
|
||
INPUT UV->Oklab_PremultipliedA 'Image 9'; | ||
INPUT int 'ID 9'; | ||
|
||
vec4 get_image(int id, vec2 uv) | ||
{ | ||
return id == 'ID 1' | ||
? 'Image 1'(uv) | ||
: id == 'ID 2' | ||
? 'Image 2'(uv) | ||
: id == 'ID 3' | ||
? 'Image 3'(uv) | ||
: id == 'ID 4' | ||
? 'Image 4'(uv) | ||
: id == 'ID 5' | ||
? 'Image 5'(uv) | ||
: id == 'ID 6' | ||
? 'Image 6'(uv) | ||
: id == 'ID 7' | ||
? 'Image 7'(uv) | ||
: id == 'ID 8' | ||
? 'Image 8'(uv) | ||
: id == 'ID 9' | ||
? 'Image 9'(uv) | ||
: vec4(0., 0., 0., 1.); | ||
} | ||
|
||
Oklab_PremultipliedA main(UV uv) | ||
{ | ||
float mix_factor = _time_since_last_midi_button_pressed / 'Transition Duration'; | ||
if (mix_factor < 0.) | ||
return get_image(_last_last_midi_button_pressed, uv); | ||
if (mix_factor > 1.) | ||
return get_image(_last_midi_button_pressed, uv); | ||
return mix(get_image(_last_last_midi_button_pressed, uv), get_image(_last_midi_button_pressed, uv), mix_factor); | ||
} |
Oops, something went wrong.