vizcore 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +170 -0
  4. data/docs/GETTING_STARTED.md +105 -0
  5. data/examples/assets/complex_demo_loop.wav +0 -0
  6. data/examples/basic.rb +9 -0
  7. data/examples/complex_audio_showcase.rb +261 -0
  8. data/examples/custom_shader.rb +21 -0
  9. data/examples/file_audio_demo.rb +74 -0
  10. data/examples/intro_drop.rb +38 -0
  11. data/examples/midi_scene_switch.rb +32 -0
  12. data/examples/shaders/custom_wave.frag +30 -0
  13. data/exe/vizcore +6 -0
  14. data/frontend/index.html +148 -0
  15. data/frontend/src/main.js +304 -0
  16. data/frontend/src/renderer/engine.js +135 -0
  17. data/frontend/src/renderer/layer-manager.js +456 -0
  18. data/frontend/src/renderer/shader-manager.js +69 -0
  19. data/frontend/src/shaders/builtins.js +244 -0
  20. data/frontend/src/shaders/post-effects.js +85 -0
  21. data/frontend/src/visuals/geometry.js +66 -0
  22. data/frontend/src/visuals/particle-system.js +148 -0
  23. data/frontend/src/visuals/text-renderer.js +143 -0
  24. data/frontend/src/visuals/vj-effects.js +56 -0
  25. data/frontend/src/websocket-client.js +131 -0
  26. data/lib/vizcore/analysis/band_splitter.rb +63 -0
  27. data/lib/vizcore/analysis/beat_detector.rb +70 -0
  28. data/lib/vizcore/analysis/bpm_estimator.rb +86 -0
  29. data/lib/vizcore/analysis/fft_processor.rb +224 -0
  30. data/lib/vizcore/analysis/fftw_ffi.rb +50 -0
  31. data/lib/vizcore/analysis/pipeline.rb +72 -0
  32. data/lib/vizcore/analysis/smoother.rb +74 -0
  33. data/lib/vizcore/analysis.rb +14 -0
  34. data/lib/vizcore/audio/base_input.rb +39 -0
  35. data/lib/vizcore/audio/dummy_sine_input.rb +40 -0
  36. data/lib/vizcore/audio/file_input.rb +163 -0
  37. data/lib/vizcore/audio/input_manager.rb +133 -0
  38. data/lib/vizcore/audio/mic_input.rb +121 -0
  39. data/lib/vizcore/audio/midi_input.rb +246 -0
  40. data/lib/vizcore/audio/portaudio_ffi.rb +243 -0
  41. data/lib/vizcore/audio/ring_buffer.rb +92 -0
  42. data/lib/vizcore/audio.rb +16 -0
  43. data/lib/vizcore/cli.rb +115 -0
  44. data/lib/vizcore/config.rb +46 -0
  45. data/lib/vizcore/dsl/engine.rb +229 -0
  46. data/lib/vizcore/dsl/file_watcher.rb +108 -0
  47. data/lib/vizcore/dsl/layer_builder.rb +182 -0
  48. data/lib/vizcore/dsl/mapping_resolver.rb +81 -0
  49. data/lib/vizcore/dsl/midi_map_executor.rb +188 -0
  50. data/lib/vizcore/dsl/scene_builder.rb +44 -0
  51. data/lib/vizcore/dsl/shader_source_resolver.rb +71 -0
  52. data/lib/vizcore/dsl/transition_controller.rb +166 -0
  53. data/lib/vizcore/dsl.rb +16 -0
  54. data/lib/vizcore/errors.rb +27 -0
  55. data/lib/vizcore/renderer/frame_scheduler.rb +75 -0
  56. data/lib/vizcore/renderer/scene_serializer.rb +73 -0
  57. data/lib/vizcore/renderer.rb +10 -0
  58. data/lib/vizcore/server/frame_broadcaster.rb +351 -0
  59. data/lib/vizcore/server/rack_app.rb +183 -0
  60. data/lib/vizcore/server/runner.rb +357 -0
  61. data/lib/vizcore/server/websocket_handler.rb +163 -0
  62. data/lib/vizcore/server.rb +12 -0
  63. data/lib/vizcore/templates/basic_scene.rb +10 -0
  64. data/lib/vizcore/templates/custom_shader_scene.rb +22 -0
  65. data/lib/vizcore/templates/custom_wave.frag +31 -0
  66. data/lib/vizcore/templates/intro_drop_scene.rb +40 -0
  67. data/lib/vizcore/templates/midi_control_scene.rb +33 -0
  68. data/lib/vizcore/templates/project_readme.md +35 -0
  69. data/lib/vizcore/version.rb +6 -0
  70. data/lib/vizcore.rb +37 -0
  71. metadata +186 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 824691790c88752d418cb0e2ca49a39a15e76926cc8025ac51403b3ba2797f1c
4
+ data.tar.gz: bc3ed3cd8282e51dbc21e175b6f8aa76ea7d9c7a7d1ccdfb6e2fc5dfa5b42374
5
+ SHA512:
6
+ metadata.gz: 4786e0f33292f0598c19c106d544f25775a721e76173bee09fd45f8917a8c148f10a30756c948753165937917f4e5e44c97295e12882243aba6605c07cd3746b
7
+ data.tar.gz: 99cbff89caa54d6bbfedfd116754827eb3d09267d931839a4fae2dff65b3ae65ca5efeb8b43f5652c3f35e591aa4a50c37967f1942af66594ea5a3528167bb42
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Yudai Takada
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,170 @@
1
+ # Vizcore [![Gem Version](https://badge.fury.io/rb/vizcore.svg)](https://badge.fury.io/rb/vizcore) [![CI](https://github.com/ydah/vizcore/actions/workflows/main.yml/badge.svg)](https://github.com/ydah/vizcore/actions/workflows/main.yml)
2
+
3
+ Vizcore is a Ruby gem for building audio-reactive visuals with a Ruby DSL. Define scenes in pure Ruby, stream frames to the browser over WebSocket, and react to audio, beat, and MIDI in real time.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ gem install vizcore
9
+ ```
10
+
11
+ Or add to your Gemfile:
12
+
13
+ ```bash
14
+ bundle add vizcore
15
+ ```
16
+
17
+ **System dependencies:**
18
+
19
+ macOS:
20
+ ```bash
21
+ brew install portaudio ffmpeg # ffmpeg only needed for MP3/FLAC input
22
+ brew install fftw # optional: faster FFT
23
+ ```
24
+
25
+ Ubuntu/Debian:
26
+ ```bash
27
+ sudo apt install -y libportaudio2 libportaudio-dev ffmpeg
28
+ sudo apt install -y libfftw3-dev # optional: faster FFT
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```bash
34
+ vizcore start examples/basic.rb
35
+ ```
36
+
37
+ Then open `http://127.0.0.1:4567`.
38
+
39
+ For full setup, device listing, and troubleshooting, see [GETTING_STARTED.md](docs/GETTING_STARTED.md).
40
+
41
+ ## Scene DSL
42
+
43
+ Scenes are written in plain Ruby. Layers map audio analysis values to visual parameters:
44
+
45
+ ```ruby
46
+ Vizcore.define do
47
+ scene :intro do
48
+ layer :wireframe do
49
+ type :wireframe_cube
50
+ map amplitude => :rotation_speed
51
+ map fft_spectrum => :deform
52
+ map frequency_band(:high) => :color_shift
53
+ end
54
+ end
55
+
56
+ scene :drop do
57
+ layer :particles do
58
+ type :particle_field
59
+ count 3600
60
+ map amplitude => :speed
61
+ map frequency_band(:low) => :size
62
+ end
63
+
64
+ layer :title do
65
+ type :text
66
+ content "DROP"
67
+ font_size 96
68
+ map beat? => :flash
69
+ end
70
+ end
71
+
72
+ transition from: :intro, to: :drop do
73
+ trigger { beat_count >= 64 }
74
+ effect :crossfade, duration: 1.4
75
+ end
76
+ end
77
+ ```
78
+
79
+ ### Custom GLSL Shaders
80
+
81
+ ```ruby
82
+ layer :wave_shader do
83
+ type :shader
84
+ glsl "shaders/custom_wave.frag"
85
+ map amplitude => :param_intensity
86
+ map frequency_band(:low) => :param_bass
87
+ map beat? => :param_flash
88
+ end
89
+ ```
90
+
91
+ ### MIDI Scene Switching
92
+
93
+ ```ruby
94
+ Vizcore.define do
95
+ midi :controller, device: :default
96
+
97
+ scene :warmup do
98
+ layer :grid do
99
+ shader :neon_grid
100
+ map frequency_band(:mid) => :intensity
101
+ end
102
+ end
103
+
104
+ midi_map note: 36 do
105
+ switch_scene :impact
106
+ end
107
+
108
+ midi_map cc: 1 do |value|
109
+ set :global_intensity, value / 127.0
110
+ end
111
+ end
112
+ ```
113
+
114
+ ## CLI
115
+
116
+ ```bash
117
+ vizcore start SCENE_FILE [--host 127.0.0.1] [--port 4567] [--audio-source mic|file|dummy] [--audio-file PATH]
118
+ vizcore new PROJECT_NAME
119
+ vizcore devices [audio|midi]
120
+ ```
121
+
122
+ ### Audio Sources
123
+
124
+ | Source | Description |
125
+ |--------|-------------|
126
+ | `mic` | Live microphone input (default) |
127
+ | `file` | File playback — `.wav` directly, `.mp3`/`.flac` via `ffmpeg` |
128
+ | `dummy` | Silent source for layout testing |
129
+
130
+ ```bash
131
+ # Microphone
132
+ vizcore start scene.rb --audio-source mic
133
+
134
+ # WAV file
135
+ vizcore start scene.rb --audio-source file --audio-file track.wav
136
+
137
+ # MP3/FLAC (requires ffmpeg)
138
+ vizcore start scene.rb --audio-source file --audio-file set.mp3
139
+ ```
140
+
141
+ When using file source, the HUD exposes **Play Audio** / **Pause Audio** controls and shows BPM, Beat, and Beat Count.
142
+
143
+ ## Requirements
144
+
145
+ - Ruby `>= 3.2`
146
+ - `portaudio` for microphone input
147
+ - `ffmpeg` on `PATH` when using `.mp3` or `.flac` file input
148
+ - `fftw3` (optional) — Vizcore falls back to pure-Ruby FFT automatically when unavailable
149
+
150
+ ## Examples
151
+
152
+ | File | Description |
153
+ |------|-------------|
154
+ | `examples/basic.rb` | Single wireframe cube layer |
155
+ | `examples/intro_drop.rb` | Beat-triggered scene transition |
156
+ | `examples/file_audio_demo.rb` | File audio source walkthrough |
157
+ | `examples/complex_audio_showcase.rb` | Dense multi-layer showcase |
158
+ | `examples/midi_scene_switch.rb` | MIDI-driven scene switching |
159
+ | `examples/custom_shader.rb` | Custom GLSL shader with audio mapping |
160
+
161
+ ## Development
162
+
163
+ ```bash
164
+ bundle exec rspec
165
+ ```
166
+
167
+
168
+ ## License
169
+
170
+ MIT
@@ -0,0 +1,105 @@
1
+ # Getting Started
2
+
3
+ This guide covers local setup and first-run commands for `vizcore`.
4
+
5
+ ## 1. Prerequisites
6
+
7
+ ### macOS (Homebrew)
8
+
9
+ ```bash
10
+ brew install portaudio ffmpeg
11
+ # optional (recommended for faster FFT): brew install fftw
12
+ ```
13
+
14
+ ### Ubuntu/Debian
15
+
16
+ ```bash
17
+ sudo apt update
18
+ sudo apt install -y libportaudio2 libportaudio-dev ffmpeg
19
+ # optional (recommended for faster FFT): sudo apt install -y libfftw3-dev
20
+ ```
21
+
22
+ ### Ruby
23
+
24
+ - Ruby `3.2+`
25
+ - Bundler
26
+
27
+ ## 2. Install and Boot
28
+
29
+ ### Run from this repository
30
+
31
+ ```bash
32
+ bundle install
33
+ bundle exec ruby -Ilib exe/vizcore start examples/basic.rb
34
+ ```
35
+
36
+ Open `http://127.0.0.1:4567`.
37
+
38
+ ### Project scaffold
39
+
40
+ ```bash
41
+ bundle exec ruby -Ilib exe/vizcore new my_show
42
+ cd my_show
43
+ vizcore start scenes/basic.rb
44
+ ```
45
+
46
+ ## 3. Audio Source Selection
47
+
48
+ ### Microphone input
49
+
50
+ ```bash
51
+ vizcore start examples/basic.rb --audio-source mic
52
+ ```
53
+
54
+ ### File input (WAV)
55
+
56
+ ```bash
57
+ vizcore start examples/basic.rb --audio-source file --audio-file spec/fixtures/audio/kick_120bpm.wav
58
+ ```
59
+
60
+ ### File input (MP3/FLAC via ffmpeg)
61
+
62
+ ```bash
63
+ vizcore start examples/basic.rb --audio-source file --audio-file path/to/set.mp3
64
+ ```
65
+
66
+ ### Dummy source fallback
67
+
68
+ ```bash
69
+ vizcore start examples/basic.rb --audio-source dummy
70
+ ```
71
+
72
+ ## 4. Device Discovery
73
+
74
+ ```bash
75
+ vizcore devices audio
76
+ vizcore devices midi
77
+ ```
78
+
79
+ ## 5. Useful Example Scenes
80
+
81
+ ```bash
82
+ vizcore start examples/complex_audio_showcase.rb --audio-source file --audio-file examples/assets/complex_demo_loop.wav
83
+ vizcore start examples/file_audio_demo.rb --audio-source file --audio-file spec/fixtures/audio/kick_120bpm.wav
84
+ vizcore start examples/intro_drop.rb --audio-source dummy
85
+ vizcore start examples/midi_scene_switch.rb --audio-source dummy
86
+ vizcore start examples/custom_shader.rb --audio-source dummy
87
+ ```
88
+
89
+ `intro_drop` falls back to a time-based transition after about 6 seconds when beats are not detected. For beat-synced scene changes, use rhythmic file input:
90
+
91
+ ```bash
92
+ vizcore start examples/intro_drop.rb --audio-source file --audio-file spec/fixtures/audio/kick_120bpm.wav
93
+ ```
94
+
95
+ File source mode exposes `Play Audio` / `Pause Audio` in the HUD and streams the same file to the browser (`/audio-file`). If autoplay is blocked, click `Play Audio` once.
96
+ `examples/complex_audio_showcase.rb` uses the bundled `examples/assets/complex_demo_loop.wav` loop for a denser audio-reactive demo.
97
+
98
+ The HUD displays `BPM`, `Beat`, and `Beat Count`, which helps confirm synchronization while pausing or seeking playback.
99
+
100
+ ## 6. Troubleshooting
101
+
102
+ - `Audio file not found`: check `--audio-file` path.
103
+ - `.mp3` / `.flac` fails: confirm `ffmpeg -version` works.
104
+ - No mic signal on macOS: allow microphone permission for the Ruby process/terminal app.
105
+ - Web page does not update: check terminal logs and browser devtools console.
data/examples/basic.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ Vizcore.define do
4
+ scene :basic do
5
+ layer :wireframe_cube do
6
+ type :wireframe_cube
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,261 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Recommended audio file for this scene:
4
+ # examples/assets/complex_demo_loop.wav
5
+ Vizcore.define do
6
+ scene :build do
7
+ layer :rings do
8
+ shader :spectrum_rings
9
+ opacity 0.88
10
+ effect :feedback
11
+ effect_intensity 0.08
12
+ map frequency_band(:low) => :rotation_speed
13
+ end
14
+
15
+ layer :grid do
16
+ shader :neon_grid
17
+ opacity 0.28
18
+ blend :add
19
+ vj_effect :mirror
20
+ effect_intensity 0.18
21
+ map frequency_band(:high) => :effect_intensity
22
+ end
23
+
24
+ layer :particles do
25
+ type :particle_field
26
+ count 3800
27
+ blend :add
28
+ opacity 0.74
29
+ size 2.2
30
+ map amplitude => :speed
31
+ map frequency_band(:low) => :size
32
+ end
33
+
34
+ layer :wireframe do
35
+ type :wireframe_cube
36
+ blend :add
37
+ opacity 0.9
38
+ map fft_spectrum => :deform
39
+ map frequency_band(:high) => :color_shift
40
+ map frequency_band(:mid) => :rotation_speed
41
+ end
42
+
43
+ layer :title do
44
+ type :text
45
+ content "SYNCED SHOWCASE"
46
+ font_size 56
47
+ color "#e8f8ff"
48
+ glow_strength 0.12
49
+ map beat? => :glow_strength
50
+ end
51
+ end
52
+
53
+ scene :lift do
54
+ layer :background do
55
+ shader :bass_tunnel
56
+ opacity 0.94
57
+ effect :feedback
58
+ effect_intensity 0.16
59
+ map frequency_band(:low) => :rotation_speed
60
+ map frequency_band(:mid) => :effect_intensity
61
+ end
62
+
63
+ layer :grid do
64
+ shader :neon_grid
65
+ opacity 0.34
66
+ blend :add
67
+ vj_effect :color_shift
68
+ effect_intensity 0.22
69
+ map frequency_band(:high) => :effect_intensity
70
+ end
71
+
72
+ layer :particles do
73
+ type :particle_field
74
+ count 6800
75
+ blend :add
76
+ size 3.6
77
+ effect :chromatic
78
+ effect_intensity 0.18
79
+ map amplitude => :speed
80
+ map frequency_band(:low) => :size
81
+ map frequency_band(:high) => :effect_intensity
82
+ end
83
+
84
+ layer :wireframe do
85
+ type :wireframe_cube
86
+ blend :add
87
+ opacity 0.78
88
+ map fft_spectrum => :deform
89
+ map frequency_band(:high) => :color_shift
90
+ map frequency_band(:low) => :rotation_speed
91
+ end
92
+
93
+ layer :title do
94
+ type :text
95
+ content "LIFT"
96
+ font_size 72
97
+ color "#eefbff"
98
+ glow_strength 0.16
99
+ map beat? => :glow_strength
100
+ end
101
+ end
102
+
103
+ scene :drop do
104
+ layer :bg do
105
+ shader :kaleidoscope
106
+ opacity 0.98
107
+ effect :glitch
108
+ effect_intensity 0.65
109
+ map frequency_band(:low) => :rotation_speed
110
+ map frequency_band(:high) => :effect_intensity
111
+ end
112
+
113
+ layer :flash do
114
+ shader :glitch_flash
115
+ opacity 0.8
116
+ blend :add
117
+ map amplitude => :param_intensity
118
+ map frequency_band(:high) => :param_flash
119
+ end
120
+
121
+ layer :storm do
122
+ type :particle_field
123
+ count 9000
124
+ blend :add
125
+ size 4.8
126
+ vj_effect :pixelate
127
+ effect_intensity 0.55
128
+ map amplitude => :speed
129
+ map frequency_band(:low) => :size
130
+ map frequency_band(:mid) => :effect_intensity
131
+ end
132
+
133
+ layer :wireframe do
134
+ type :wireframe_cube
135
+ blend :add
136
+ map fft_spectrum => :deform
137
+ map frequency_band(:high) => :color_shift
138
+ map frequency_band(:low) => :rotation_speed
139
+ end
140
+
141
+ layer :title do
142
+ type :text
143
+ content "DROP"
144
+ font_size 94
145
+ color "#f2fdff"
146
+ glow_strength 0.25
147
+ map beat? => :glow_strength
148
+ end
149
+ end
150
+
151
+ scene :afterglow do
152
+ layer :bars do
153
+ shader :audio_bars
154
+ opacity 1.0
155
+ effect :feedback
156
+ effect_intensity 0.05
157
+ bar_count 28
158
+ floor_glow 0.12
159
+ map frequency_band(:low) => :effect_intensity
160
+ end
161
+
162
+ layer :dust do
163
+ type :particle_field
164
+ count 2200
165
+ blend :add
166
+ opacity 0.38
167
+ size 1.9
168
+ map amplitude => :speed
169
+ map frequency_band(:high) => :size
170
+ end
171
+
172
+ layer :wireframe do
173
+ type :wireframe_cube
174
+ blend :add
175
+ opacity 0.24
176
+ map fft_spectrum => :deform
177
+ map frequency_band(:mid) => :color_shift
178
+ map amplitude => :rotation_speed
179
+ end
180
+
181
+ layer :title do
182
+ type :text
183
+ content "AFTERGLOW"
184
+ font_size 52
185
+ color "#edf5ff"
186
+ glow_strength 0.08
187
+ map beat? => :glow_strength
188
+ end
189
+ end
190
+
191
+ scene :breakdown do
192
+ layer :background do
193
+ shader :neon_grid
194
+ opacity 0.3
195
+ effect :feedback
196
+ effect_intensity 0.05
197
+ rotation_speed 0.18
198
+ map frequency_band(:mid) => :effect_intensity
199
+ end
200
+
201
+ layer :rings do
202
+ shader :spectrum_rings
203
+ opacity 0.26
204
+ effect :feedback
205
+ effect_intensity 0.06
206
+ map frequency_band(:low) => :rotation_speed
207
+ end
208
+
209
+ layer :dust do
210
+ type :particle_field
211
+ count 1800
212
+ blend :add
213
+ opacity 0.46
214
+ size 1.8
215
+ map amplitude => :speed
216
+ map frequency_band(:high) => :size
217
+ end
218
+
219
+ layer :wireframe do
220
+ type :wireframe_cube
221
+ opacity 0.22
222
+ map fft_spectrum => :deform
223
+ map frequency_band(:mid) => :color_shift
224
+ map amplitude => :rotation_speed
225
+ end
226
+
227
+ layer :title do
228
+ type :text
229
+ content "BREAKDOWN"
230
+ font_size 46
231
+ color "#e6f0ff"
232
+ glow_strength 0.06
233
+ map beat? => :glow_strength
234
+ end
235
+ end
236
+
237
+ transition from: :build, to: :lift do
238
+ trigger { beat_count >= 24 || frame_count >= 900 }
239
+ effect :crossfade, duration: 0.9
240
+ end
241
+
242
+ transition from: :lift, to: :drop do
243
+ trigger { beat_count >= 16 || frame_count >= 540 }
244
+ effect :crossfade, duration: 1.0
245
+ end
246
+
247
+ transition from: :drop, to: :afterglow do
248
+ trigger { beat_count >= 24 || frame_count >= 900 }
249
+ effect :crossfade, duration: 1.1
250
+ end
251
+
252
+ transition from: :afterglow, to: :breakdown do
253
+ trigger { beat_count >= 12 || frame_count >= 420 }
254
+ effect :crossfade, duration: 1.0
255
+ end
256
+
257
+ transition from: :breakdown, to: :build do
258
+ trigger { beat_count >= 16 || frame_count >= 720 }
259
+ effect :crossfade, duration: 1.2
260
+ end
261
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ Vizcore.define do
4
+ scene :shader_art do
5
+ layer :wave_shader do
6
+ type :shader
7
+ glsl "shaders/custom_wave.frag"
8
+ map amplitude => :param_intensity
9
+ map frequency_band(:low) => :param_bass
10
+ map beat? => :param_flash
11
+ end
12
+
13
+ layer :title do
14
+ type :text
15
+ content "VIZCORE"
16
+ font_size 72
17
+ glow_strength 0.0
18
+ color "#f8fbff"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ Vizcore.define do
4
+ scene :groove do
5
+ layer :background do
6
+ shader :bass_tunnel
7
+ opacity 1.0
8
+ effect :feedback
9
+ effect_intensity 0.72
10
+ rotation_speed 1.4
11
+ end
12
+
13
+ layer :wireframe do
14
+ type :wireframe_cube
15
+ blend :add
16
+ map fft_spectrum => :deform
17
+ map frequency_band(:mid) => :color_shift
18
+ map frequency_band(:low) => :rotation_speed
19
+ end
20
+
21
+ layer :particles do
22
+ type :particle_field
23
+ count 4200
24
+ blend :add
25
+ size 3.8
26
+ effect :chromatic
27
+ effect_intensity 0.7
28
+ map amplitude => :speed
29
+ map frequency_band(:low) => :size
30
+ map frequency_band(:high) => :effect_intensity
31
+ end
32
+
33
+ layer :title do
34
+ type :text
35
+ content "FILE AUDIO DEMO"
36
+ font_size 64
37
+ color "#f2f7ff"
38
+ glow_strength 0.18
39
+ map beat? => :glow_strength
40
+ end
41
+ end
42
+
43
+ scene :drop do
44
+ layer :background do
45
+ shader :kaleidoscope
46
+ opacity 0.95
47
+ effect :glitch
48
+ effect_intensity 0.86
49
+ rotation_speed 2.4
50
+ end
51
+
52
+ layer :wireframe do
53
+ type :wireframe_cube
54
+ blend :add
55
+ map fft_spectrum => :deform
56
+ map frequency_band(:high) => :color_shift
57
+ map frequency_band(:mid) => :rotation_speed
58
+ end
59
+
60
+ layer :title do
61
+ type :text
62
+ content "DROP"
63
+ font_size 92
64
+ color "#eaffff"
65
+ glow_strength 0.32
66
+ map beat? => :glow_strength
67
+ end
68
+ end
69
+
70
+ transition from: :groove, to: :drop do
71
+ trigger { beat_count >= 32 || frame_count >= 720 }
72
+ effect :crossfade, duration: 1.0
73
+ end
74
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ Vizcore.define do
4
+ scene :intro do
5
+ layer :background do
6
+ shader :neon_grid
7
+ opacity 0.82
8
+ end
9
+
10
+ layer :wireframe do
11
+ type :wireframe_cube
12
+ map amplitude => :rotation_speed
13
+ map fft_spectrum => :deform
14
+ map frequency_band(:high) => :color_shift
15
+ end
16
+ end
17
+
18
+ scene :drop do
19
+ layer :particles do
20
+ type :particle_field
21
+ count 3600
22
+ map amplitude => :speed
23
+ map frequency_band(:low) => :size
24
+ end
25
+
26
+ layer :title do
27
+ type :text
28
+ content "DROP"
29
+ font_size 96
30
+ map beat? => :flash
31
+ end
32
+ end
33
+
34
+ transition from: :intro, to: :drop do
35
+ trigger { beat_count >= 64 || frame_count >= 360 }
36
+ effect :crossfade, duration: 1.4
37
+ end
38
+ end