Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio #80

Merged
merged 49 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
dd1b6db
[Audio] Audio branch started to work on audio features. Had to recrea…
Audiophil15 Aug 11, 2023
757151a
[Audio] Added as submodules the libs needed for the audio work
Audiophil15 Aug 11, 2023
4a9d6c2
[Audio] Updated RtAudioWrapper
Audiophil15 Aug 11, 2023
979fe04
[Audio] CMake now copies the /tests folder in the build/bin folder, i…
Audiophil15 Aug 11, 2023
a2a37f9
[Audio] Modifying the sound_generator(), I almost have the right musi…
Audiophil15 Aug 11, 2023
6210d0a
[Audio] /src/Audio/tests.cpp is able to play an audio file and to see…
Audiophil15 Aug 12, 2023
1e0caae
Updated submodules
Audiophil15 Aug 20, 2023
b979504
Updated tests to use the last version of RtAudioWrapper
Audiophil15 Aug 23, 2023
0a756ff
⬆️ [RtAudioWrapper]
JulesFouchy Aug 31, 2023
36533f3
⬆️ [RtAudioWrapper]
JulesFouchy Aug 31, 2023
4112c1e
🚨 [Audio] Fix tests compilation
JulesFouchy Aug 31, 2023
9ae5ec9
Merge remote-tracking branch 'origin/main' into Audio
JulesFouchy Oct 16, 2023
561dc15
🎉 [Audio] Start playing back audio
JulesFouchy Oct 17, 2023
bfb48f4
⬆️ [Audio]
JulesFouchy Oct 18, 2023
bfadaab
⬆️ [Cool]
JulesFouchy Oct 19, 2023
4ef9f7d
✨ [Audio] Make window closable
JulesFouchy Oct 20, 2023
716f8b5
🔨 [CI] Install Audio dependencies
JulesFouchy Oct 20, 2023
39e7d16
🤏 [Audio] Check for devices once in AppManager instead of doing it pe…
JulesFouchy Oct 20, 2023
678ac1f
✨ [Audio] Serialize the properties of the player
JulesFouchy Oct 20, 2023
b0dd2cd
⬆️ [Cool]
JulesFouchy Oct 20, 2023
4abc135
✨ [Audio] Button on Audio-related nodes to open the Audio config window
JulesFouchy Oct 23, 2023
af8fe51
✨ [Audio] Can now get the volume of the current audio
JulesFouchy Oct 23, 2023
806fdde
⬆️ [Cool]
JulesFouchy Oct 27, 2023
2c7f8af
✨ [Audio] Trigger rerender when audio changes
JulesFouchy Nov 3, 2023
95655fc
🐛 [Audio] Fix: use audio while exporting
JulesFouchy Nov 3, 2023
ddced0c
✨ [Audio] Force mute and force sync when exporting
JulesFouchy Nov 3, 2023
828bc02
🚧 [Audio] Pass waveform and spectrum to the shader
JulesFouchy Nov 4, 2023
c7b34ff
🤏 [Audio] Use 1D textures containing floats
JulesFouchy Nov 4, 2023
9a750d3
✨ [Audio] Only compute audio features if the shader actualy uses them
JulesFouchy Nov 5, 2023
4585942
✨ [Audio] Only rerender when audio/time changes if we depend on audio…
JulesFouchy Nov 5, 2023
19b5994
⬆️ [Cool]
JulesFouchy Nov 7, 2023
82d7052
🔀 Merge remote-tracking branch 'origin/main' into Audio
JulesFouchy Nov 7, 2023
61b078a
🔀 Merge remote-tracking branch 'origin/main' into Audio
JulesFouchy Nov 7, 2023
86d4d9c
🔀 Merge remote-tracking branch 'origin/main' into Audio
JulesFouchy Nov 8, 2023
ad4f933
🔀 Merge remote-tracking branch 'origin/main' into Audio
JulesFouchy Nov 29, 2023
aa74533
⬆️ [Cool]
JulesFouchy Nov 29, 2023
3193a86
⬆️ [Cool]
JulesFouchy Nov 29, 2023
cbd659e
🟦 [Nodes] Add some Audio visualizers
JulesFouchy Dec 1, 2023
32c2050
✨ [Nodes] Added a default float->float function
JulesFouchy Dec 2, 2023
ae61629
🤏 [Audio] Renaming + Remove TODOs
JulesFouchy Dec 2, 2023
d7f24f4
🌐 [website] Update Audio Nodes tutorial
JulesFouchy Dec 2, 2023
5bdcabd
🔨 [CI] Install audio libraries on Linux
JulesFouchy Dec 2, 2023
2adf153
⬆️ [Cool]
JulesFouchy Dec 2, 2023
ddc8514
🔀 Merge remote-tracking branch 'origin/main' into Audio
JulesFouchy Dec 2, 2023
bad938a
🧼 Cleanup
JulesFouchy Dec 2, 2023
6ac1088
🧼 Cleanup
JulesFouchy Dec 2, 2023
d7bb6aa
🧼 Cleanup
JulesFouchy Dec 2, 2023
1ffdff7
🧼 Cleanup
JulesFouchy Dec 2, 2023
189c5ba
📝 [changelog]
JulesFouchy Dec 3, 2023
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
12 changes: 12 additions & 0 deletions .github/workflows/build_and_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ jobs:
- name: Install OpenSSL
run: sudo apt-get install libssl-dev

- name: Install audio libraries
run: sudo apt install libpulse-dev libasound2-dev

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DWARNINGS_AS_ERRORS_FOR_COOLLAB=ON -D CMAKE_BUILD_TYPE=Debug -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D COOLLAB_REQUIRE_ALL_FEATURES=ON

Expand Down Expand Up @@ -144,6 +147,9 @@ jobs:
- name: Install OpenSSL
run: sudo apt-get install libssl-dev

- name: Install audio libraries
run: sudo apt install libpulse-dev libasound2-dev

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DWARNINGS_AS_ERRORS_FOR_COOLLAB=ON -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D COOLLAB_REQUIRE_ALL_FEATURES=ON

Expand Down Expand Up @@ -171,6 +177,9 @@ jobs:
- name: Install glfw dependencies
run: sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev build-essential libgtk-3-dev

- name: Install audio libraries
run: sudo apt install libpulse-dev libasound2-dev

- name: Install OpenSSL
run: sudo apt-get install libssl-dev

Expand Down Expand Up @@ -201,6 +210,9 @@ jobs:
- name: Install glfw dependencies
run: sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev build-essential libgtk-3-dev

- name: Install audio libraries
run: sudo apt install libpulse-dev libasound2-dev

- name: Install OpenSSL
run: sudo apt-get install libssl-dev

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/create_release_executables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
- name: Install MIDI dependencies
run: sudo apt install libasound2-dev

- name: Install Audio dependencies
run: sudo apt install libpulse-dev libasound2-dev

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D COOLLAB_REQUIRE_ALL_FEATURES=ON -D CPACK_GENERATOR=STGZ

Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
url = https://github.com/CoolLibs/tooling/
[submodule "lib/cpp-httplib"]
path = lib/cpp-httplib
url = https://github.com/yhirose/cpp-httplib
url = https://github.com/yhirose/cpp-httplib
2 changes: 1 addition & 1 deletion Cool
12 changes: 12 additions & 0 deletions Nodes/20 Greyscale/Fill Function.clbnode
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

INPUT float->float 'Function';

float main(UV uv)
{
float val = 'Function'(uv.x);
if ((val > 0 && uv.y < val && uv.y > 0)
|| (val < 0 && uv.y > val && uv.y < 0))
return 1.;
return 0.;
}
5 changes: 3 additions & 2 deletions Nodes/30 Shape/Function to Shape.clbnode
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

INPUT float->float 'Function';
INPUT float 'Thickness';

// https://iquilezles.org/articles/distfunctions2d/
float sdSegment(vec2 p, vec2 a, vec2 b)
{
vec2 pa = p - a, ba = b - a;
Expand All @@ -15,7 +16,7 @@ SignedDistance main(UV uv)
int vicinity = 1;
vec2 previous_point = vec2(uv.x - vicinity, 'Function'(-vicinity));

for (float i = -vicinity; i < vicinity; i += 0.1)
for (float i = -vicinity; i < vicinity; i += 0.01)
{
float current_iteration = uv.x + i;
vec2 current_point = vec2(current_iteration, 'Function'(current_iteration));
Expand Down
42 changes: 42 additions & 0 deletions Nodes/30 Shape/Function to Shape.clbnode.presets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"Presets": {
"Underlying container": [
{
"first": "fe6e8ff1-9103-4fdf-9bea-3bedf319ab9e",
"second": {
"Name": "Default",
"Values": [
{
"index": 2,
"data": {
"Name": "Thickness",
"Value": 0.006000000052154064,
"Metadata": {
"Bounds": {
"Has min bound": true,
"Min": 0.000009999999747378752,
"Has max bound": false,
"Max": 1.0,
"Drag speed": 0.0010000000474974514,
"Use slider": false
}
},
"Default Value": 0.006000000052154064,
"Default Metadata": {
"Bounds": {
"Has min bound": false,
"Min": 0.0,
"Has max bound": false,
"Max": 1.0,
"Drag speed": 0.009999999776482582,
"Use slider": false
}
}
}
}
]
}
}
]
}
}
18 changes: 18 additions & 0 deletions Nodes/41 Curve Modifier/Add Displacement.clbnode
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

INPUT float->UV 'Curve';

INPUT float->float 'Displacement Function';
INPUT float 'Amplitude';

UV main(float t)
{
const float delta = 0.001;

vec2 curve_pos = 'Curve'(t);
vec2 curve_next_pos = 'Curve'(t + delta);
vec2 gradient = curve_next_pos - curve_pos;
vec2 normal = normalize(vec2(gradient.y, -gradient.x));

return curve_pos + normal * 'Displacement Function'(t) * 'Amplitude';
}
42 changes: 42 additions & 0 deletions Nodes/41 Curve Modifier/Add Displacement.clbnode.presets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"Presets": {
"Underlying container": [
{
"first": "7d9a663d-3005-43e8-a126-42070427b306",
"second": {
"Name": "Default",
"Values": [
{
"index": 2,
"data": {
"Name": "Amplitude",
"Value": 0.20000000298023225,
"Metadata": {
"Bounds": {
"Has min bound": true,
"Min": 0.0,
"Has max bound": false,
"Max": 1.0,
"Drag speed": 0.0010000000474974514,
"Use slider": false
}
},
"Default Value": 0.20000000298023225,
"Default Metadata": {
"Bounds": {
"Has min bound": false,
"Min": 0.0,
"Has max bound": false,
"Max": 1.0,
"Drag speed": 0.009999999776482582,
"Use slider": false
}
}
}
}
]
}
}
]
}
}
14 changes: 14 additions & 0 deletions Nodes/50 2D Modifier/Mirror.clbnode
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

INPUT Direction2D 'Angle';
INPUT Point2D 'Center';

UV main(UV uv)
{
vec2 p = uv - 'Center';
vec2 normal = vec2('Angle'.y, -'Angle'.x);
float proj = dot(p, normal);
if (proj < 0)
uv -= 2 * normal * proj;
return uv;
}
68 changes: 68 additions & 0 deletions Nodes/50 2D Modifier/Mirror.clbnode.presets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"Presets": {
"Underlying container": [
{
"first": "0acc6e2c-1b71-47c9-95de-bfd4b3320f44",
"second": {
"Name": "Default",
"Values": [
{
"index": 12,
"data": {
"Name": "Angle",
"Value": {
"Angle": {
"Radians": {
"Radians": 1.5707963705062867
}
}
},
"Metadata": {
"Number of snaps": 24,
"Snaps offset (in radians)": 0.0,
"Always snap": false
},
"Default Value": {
"Angle": {
"Radians": {
"Radians": 1.5707963705062867
}
}
},
"Default Metadata": {
"Number of snaps": 24,
"Snaps offset (in radians)": 0.0,
"Always snap": false
}
}
},
{
"index": 3,
"data": {
"Name": "Center",
"Value": {
"Point2D": {
"x": 0.0,
"y": 0.0
}
},
"Metadata": {
"Drag speed": 0.00009999999747378752
},
"Default Value": {
"Point2D": {
"x": 0.0,
"y": 0.0
}
},
"Default Metadata": {
"Drag speed": 0.00009999999747378752
}
}
}
]
}
}
]
}
}
8 changes: 8 additions & 0 deletions Nodes/70 Input/Spectrum (Audio).clbnode
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

INPUT float 'Stretch';

float main(float Frequency)
{
return texture(_audio_spectrum, Frequency / 'Stretch').r;
}
42 changes: 42 additions & 0 deletions Nodes/70 Input/Spectrum (Audio).clbnode.presets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"Presets": {
"Underlying container": [
{
"first": "733ea146-edee-4350-9eb6-d152775c9430",
"second": {
"Name": "Default",
"Values": [
{
"index": 2,
"data": {
"Name": "Stretch",
"Value": 1.0,
"Metadata": {
"Bounds": {
"Has min bound": true,
"Min": 0.0,
"Has max bound": false,
"Max": 1.0,
"Drag speed": 0.0010000000474974514,
"Use slider": false
}
},
"Default Value": 1.0,
"Default Metadata": {
"Bounds": {
"Has min bound": false,
"Min": 0.0,
"Has max bound": false,
"Max": 1.0,
"Drag speed": 0.009999999776482582,
"Use slider": false
}
}
}
}
]
}
}
]
}
}
6 changes: 6 additions & 0 deletions Nodes/70 Input/Volume (Audio).clbnode
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

float main()
{
return _audio_volume;
}
8 changes: 8 additions & 0 deletions Nodes/70 Input/Waveform (Audio).clbnode
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

INPUT float 'Stretch';

float main(float t)
{
return texture(_audio_waveform, t / 'Stretch').r;
}
Loading
Loading