vizcore 0.1.0 → 1.0.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 (126) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +544 -9
  3. data/docs/.nojekyll +0 -0
  4. data/docs/assets/site.css +744 -0
  5. data/docs/assets/vizcore-demo.gif +0 -0
  6. data/docs/assets/vizcore-poster.png +0 -0
  7. data/docs/assets/vj-tunnel.js +159 -0
  8. data/docs/index.html +224 -0
  9. data/examples/README.md +59 -0
  10. data/examples/assets/README.md +19 -0
  11. data/examples/audio_inspector.rb +34 -0
  12. data/examples/club_intro_drop.rb +78 -0
  13. data/examples/kansai_rubykaigi_visual.rb +70 -0
  14. data/examples/live_coding_minimal.rb +22 -0
  15. data/examples/midi_controller_show.rb +78 -0
  16. data/examples/midi_scene_switch.rb +3 -1
  17. data/examples/parser_visualizer.rb +48 -0
  18. data/examples/readme_demo.rb +17 -0
  19. data/examples/rhythm_geometry.rb +34 -0
  20. data/examples/ruby_crystal_show.rb +35 -0
  21. data/examples/shader_playground.rb +18 -0
  22. data/examples/unyo_liquid.rb +59 -0
  23. data/examples/vj_ambient_chill_room.rb +124 -0
  24. data/examples/vj_dnb_jungle.rb +170 -0
  25. data/examples/vj_festival_mainstage.rb +245 -0
  26. data/examples/vj_festival_mainstage.yml +17 -0
  27. data/examples/vj_glitch_industrial.rb +164 -0
  28. data/examples/vj_hiphop_cipher.rb +167 -0
  29. data/examples/vj_jpop_idol_live.rb +210 -0
  30. data/examples/vj_synthwave_retro.rb +173 -0
  31. data/examples/vj_techno_warehouse.rb +195 -0
  32. data/frontend/index.html +468 -2
  33. data/frontend/src/audio-inspector.js +40 -0
  34. data/frontend/src/live-controls.js +131 -0
  35. data/frontend/src/main.js +792 -16
  36. data/frontend/src/midi-learn.js +194 -0
  37. data/frontend/src/performance-monitor.js +183 -0
  38. data/frontend/src/plugin-runtime.js +130 -0
  39. data/frontend/src/projector-mode.js +56 -0
  40. data/frontend/src/renderer/engine.js +148 -3
  41. data/frontend/src/renderer/layer-manager.js +428 -30
  42. data/frontend/src/renderer/shader-manager.js +26 -0
  43. data/frontend/src/runtime-control-preset.js +11 -0
  44. data/frontend/src/shader-error-overlay.js +29 -0
  45. data/frontend/src/shader-param-controls.js +93 -0
  46. data/frontend/src/shaders/builtins.js +380 -2
  47. data/frontend/src/shaders/post-effects.js +52 -0
  48. data/frontend/src/visual-regression.js +67 -0
  49. data/frontend/src/visual-settings-preset.js +103 -0
  50. data/frontend/src/visuals/geometry.js +268 -0
  51. data/frontend/src/visuals/image-renderer.js +291 -0
  52. data/frontend/src/visuals/particle-system.js +56 -10
  53. data/frontend/src/visuals/spectrogram-renderer.js +226 -0
  54. data/frontend/src/visuals/text-renderer.js +112 -11
  55. data/frontend/src/websocket-client.js +12 -1
  56. data/lib/vizcore/analysis/adaptive_normalizer.rb +70 -0
  57. data/lib/vizcore/analysis/beat_detector.rb +4 -2
  58. data/lib/vizcore/analysis/bpm_estimator.rb +8 -0
  59. data/lib/vizcore/analysis/feature_recorder.rb +159 -0
  60. data/lib/vizcore/analysis/feature_replay.rb +84 -0
  61. data/lib/vizcore/analysis/pipeline.rb +235 -11
  62. data/lib/vizcore/analysis/tap_tempo.rb +74 -0
  63. data/lib/vizcore/analysis.rb +4 -0
  64. data/lib/vizcore/audio/dummy_sine_input.rb +1 -1
  65. data/lib/vizcore/audio/fixture_input.rb +65 -0
  66. data/lib/vizcore/audio/input_manager.rb +4 -2
  67. data/lib/vizcore/audio/mic_input.rb +24 -8
  68. data/lib/vizcore/audio/portaudio_ffi.rb +106 -1
  69. data/lib/vizcore/audio.rb +1 -0
  70. data/lib/vizcore/cli/doctor.rb +159 -0
  71. data/lib/vizcore/cli/dsl_reference.rb +99 -0
  72. data/lib/vizcore/cli/layer_docs.rb +46 -0
  73. data/lib/vizcore/cli/scene_diagnostics.rb +23 -0
  74. data/lib/vizcore/cli/scene_inspector.rb +136 -0
  75. data/lib/vizcore/cli/scene_validator.rb +245 -0
  76. data/lib/vizcore/cli/shader_template.rb +68 -0
  77. data/lib/vizcore/cli/shader_uniform_docs.rb +54 -0
  78. data/lib/vizcore/cli.rb +689 -18
  79. data/lib/vizcore/config.rb +103 -2
  80. data/lib/vizcore/control_preset.rb +68 -0
  81. data/lib/vizcore/dsl/engine.rb +277 -5
  82. data/lib/vizcore/dsl/layer_builder.rb +491 -22
  83. data/lib/vizcore/dsl/layer_group_builder.rb +112 -0
  84. data/lib/vizcore/dsl/mapping_resolver.rb +132 -3
  85. data/lib/vizcore/dsl/mapping_transform_builder.rb +71 -0
  86. data/lib/vizcore/dsl/reaction_builder.rb +44 -0
  87. data/lib/vizcore/dsl/scene_builder.rb +61 -5
  88. data/lib/vizcore/dsl/shader_source_resolver.rb +67 -6
  89. data/lib/vizcore/dsl/style_builder.rb +68 -0
  90. data/lib/vizcore/dsl/timeline_builder.rb +138 -0
  91. data/lib/vizcore/dsl/transition_controller.rb +77 -0
  92. data/lib/vizcore/dsl.rb +5 -1
  93. data/lib/vizcore/layer_catalog.rb +273 -0
  94. data/lib/vizcore/project_manifest.rb +152 -0
  95. data/lib/vizcore/renderer/png_writer.rb +57 -0
  96. data/lib/vizcore/renderer/render_sequence.rb +153 -0
  97. data/lib/vizcore/renderer/scene_frame_source.rb +119 -0
  98. data/lib/vizcore/renderer/scene_serializer.rb +36 -3
  99. data/lib/vizcore/renderer/snapshot.rb +38 -0
  100. data/lib/vizcore/renderer/snapshot_renderer.rb +446 -0
  101. data/lib/vizcore/renderer.rb +5 -0
  102. data/lib/vizcore/server/frame_broadcaster.rb +91 -5
  103. data/lib/vizcore/server/gallery_app.rb +155 -0
  104. data/lib/vizcore/server/gallery_page.rb +100 -0
  105. data/lib/vizcore/server/gallery_runner.rb +48 -0
  106. data/lib/vizcore/server/rack_app.rb +203 -4
  107. data/lib/vizcore/server/runner.rb +370 -22
  108. data/lib/vizcore/server/scene_dependency_watcher.rb +79 -0
  109. data/lib/vizcore/server/websocket_handler.rb +60 -10
  110. data/lib/vizcore/server.rb +4 -0
  111. data/lib/vizcore/sync/osc_message.rb +103 -0
  112. data/lib/vizcore/sync/osc_receiver.rb +68 -0
  113. data/lib/vizcore/sync.rb +4 -0
  114. data/lib/vizcore/templates/midi_control_scene.rb +3 -1
  115. data/lib/vizcore/templates/plugin_layer.rb +20 -0
  116. data/lib/vizcore/templates/plugin_readme.md +23 -0
  117. data/lib/vizcore/templates/plugin_renderer.js +43 -0
  118. data/lib/vizcore/templates/plugin_scene.rb +14 -0
  119. data/lib/vizcore/templates/project_readme.md +7 -23
  120. data/lib/vizcore/templates/rubykaigi_scene.rb +30 -0
  121. data/lib/vizcore/version.rb +1 -1
  122. data/lib/vizcore.rb +27 -0
  123. data/scripts/browser_capture.mjs +75 -0
  124. data/sig/vizcore.rbs +362 -0
  125. metadata +83 -3
  126. data/docs/GETTING_STARTED.md +0 -105
data/sig/vizcore.rbs ADDED
@@ -0,0 +1,362 @@
1
+ module Vizcore
2
+ VERSION: String
3
+
4
+ def self.root: () -> Pathname
5
+ def self.frontend_root: () -> Pathname
6
+ def self.templates_root: () -> Pathname
7
+ def self.define: () { () -> void } -> Hash[Symbol, untyped]
8
+ def self.plugin: (String | Symbol name) -> bool
9
+ def self.register_layer_capability: (
10
+ type: Symbol | String,
11
+ ?aliases: Array[Symbol | String] aliases,
12
+ ?params: Hash[Symbol | String, String] params,
13
+ ?mappable_params: Array[Symbol | String] mappable_params,
14
+ ?description: String? description
15
+ ) -> Vizcore::LayerCatalog::Capability
16
+ end
17
+
18
+ module Vizcore::LayerCatalog
19
+ class Capability < Struct[untyped]
20
+ attr_accessor type: Symbol
21
+ attr_accessor aliases: Array[Symbol]
22
+ attr_accessor params: Hash[Symbol, String]
23
+ attr_accessor mappable_params: Array[Symbol]
24
+ attr_accessor description: String
25
+
26
+ def types: () -> Array[Symbol]
27
+ def supports?: (untyped value) -> bool
28
+ end
29
+
30
+ def self.capabilities: () -> Array[Capability]
31
+ def self.capability_for: (untyped type) -> Capability?
32
+ def self.supported_type?: (untyped type) -> bool
33
+ def self.supported_types: () -> Array[Symbol]
34
+ def self.params_for: (untyped type) -> Hash[Symbol, String]
35
+ def self.mappable_params_for: (untyped type) -> Array[Symbol]
36
+ def self.register_layer_capability: (
37
+ type: Symbol | String,
38
+ ?aliases: Array[Symbol | String] aliases,
39
+ ?params: Hash[Symbol | String, String] params,
40
+ ?mappable_params: Array[Symbol | String] mappable_params,
41
+ ?description: String? description
42
+ ) -> Capability
43
+ def self.reset_plugin_capabilities!: () -> Array[Capability]
44
+ def self.plugin_capabilities: () -> Array[Capability]
45
+ end
46
+
47
+ module Vizcore
48
+ class ControlPreset
49
+ def self.load: (String | Pathname path) -> Hash[String, untyped]
50
+ def self.write: (String | Pathname path, Hash[untyped, untyped] payload) -> Hash[String, untyped]
51
+ def initialize: (String | Pathname path) -> void
52
+ def load: () -> Hash[String, untyped]
53
+ def write: (Hash[untyped, untyped] payload) -> Hash[String, untyped]
54
+ end
55
+
56
+ class ProjectManifest
57
+ attr_reader path: Pathname
58
+ attr_reader root: Pathname
59
+
60
+ def self.load: (String | Pathname path) -> ProjectManifest
61
+ def initialize: (String | Pathname path) -> void
62
+ def config_defaults: (?profile: String? profile) -> Hash[Symbol, untyped]
63
+ def plugins: (?profile: String? profile) -> Array[String]
64
+ def plugin_assets: (?profile: String? profile) -> Array[Pathname]
65
+ def profile_names: () -> Array[String]
66
+ end
67
+ end
68
+
69
+ module Vizcore::CLISupport
70
+ class DslReference
71
+ def lines: () -> Array[String]
72
+ end
73
+ end
74
+
75
+ module Vizcore::Sync
76
+ class OscMessage
77
+ attr_reader address: String
78
+ attr_reader arguments: Array[untyped]
79
+
80
+ def self.parse: (String data) -> OscMessage?
81
+ def initialize: (address: String, ?arguments: Array[untyped] arguments) -> void
82
+ end
83
+
84
+ class OscReceiver
85
+ DEFAULT_HOST: String
86
+ MAX_PACKET_SIZE: Integer
87
+
88
+ def initialize: (
89
+ port: Integer port,
90
+ ?host: String host,
91
+ handler: untyped handler,
92
+ ?error_reporter: untyped? error_reporter
93
+ ) -> void
94
+ def start: () -> OscReceiver
95
+ def stop: () -> nil
96
+ end
97
+ end
98
+
99
+ module Vizcore::Analysis
100
+ class FeatureRecorder
101
+ VERSION: String
102
+ DEFAULT_FRAME_COUNT: Integer
103
+ DEFAULT_FRAME_RATE: Float
104
+
105
+ def initialize: (
106
+ audio_file: String | Pathname audio_file,
107
+ ?frames: Integer frames,
108
+ ?fps: Numeric fps,
109
+ ?noise_gate: Numeric noise_gate,
110
+ ?audio_normalize: Hash[Symbol, untyped]? audio_normalize,
111
+ ?bpm: Numeric? bpm,
112
+ ?bpm_lock: bool bpm_lock
113
+ ) -> void
114
+
115
+ def write: (out: String | Pathname) -> Hash[Symbol, untyped]
116
+ end
117
+
118
+ class FeatureReplay
119
+ attr_reader metadata: Hash[Symbol, untyped]
120
+
121
+ def initialize: (path: String | Pathname path) -> void
122
+ def call: (?Array[Float]? samples) -> Hash[Symbol, untyped]
123
+ def frame_count: () -> Integer
124
+ end
125
+ end
126
+
127
+ module Vizcore::DSL
128
+ type source = { kind: Symbol, ?band: Symbol }
129
+ type transform = {
130
+ ?gain: Float,
131
+ ?min: Float,
132
+ ?max: Float,
133
+ ?curve: Symbol,
134
+ ?deadzone: Float,
135
+ ?attack: Float,
136
+ ?release: Float
137
+ }
138
+ type mapping = { source: source, target: Symbol, ?transform: transform }
139
+ type param_schema_entry = {
140
+ name: Symbol,
141
+ ?default: Float,
142
+ ?min: Float,
143
+ ?max: Float,
144
+ ?step: Float
145
+ }
146
+ type layer = {
147
+ name: Symbol,
148
+ type: Symbol,
149
+ params: Hash[Symbol, untyped],
150
+ ?shader: Symbol,
151
+ ?glsl: String,
152
+ ?param_schema: Array[param_schema_entry],
153
+ ?mappings: Array[mapping]
154
+ }
155
+ type scene = { name: Symbol, layers: Array[layer], ?theme: Symbol }
156
+ type style = { name: Symbol, params: Hash[Symbol, untyped] }
157
+ type theme = { name: Symbol, params: Hash[Symbol, untyped] }
158
+ type timeline_entry = { at: Float, unit: Symbol, scene: Symbol }
159
+ type key_action = { type: Symbol, ?scene: String, ?control: Symbol }
160
+ type key_mapping = { key: String, action: key_action }
161
+
162
+ class Engine
163
+ def self.define: () { () -> void } -> Hash[Symbol, untyped]
164
+ def self.load_file: (String | Pathname path) -> Hash[Symbol, untyped]
165
+ def self.watch_file: (String | Pathname path, ?poll_interval: Float poll_interval, ?listener_factory: untyped listener_factory) { (Hash[Symbol, untyped], Pathname) -> void } -> FileWatcher
166
+
167
+ def audio: (Symbol | String name, **untyped options) -> Array[Hash[Symbol, untyped]]
168
+ def style: (Symbol | String name) { () -> void } -> void
169
+ def theme: (Symbol | String name) { () -> void } -> void
170
+ def midi: (Symbol | String name, **untyped options) -> Array[Hash[Symbol, untyped]]
171
+ def audio_normalize: (?mode: Symbol | String mode, **untyped options) -> Hash[Symbol, untyped]
172
+ def bpm: (Numeric value) -> Float
173
+ def bpm_lock: () -> bool
174
+ | (bool value) -> bool
175
+ def tap_tempo: (?key: Symbol | String key) -> Hash[Symbol, untyped]
176
+ def key: (Symbol | String value) { () -> void } -> void
177
+ def scene: (Symbol | String name, ?extends: Symbol | String? extends) { () -> void } -> void
178
+ def section: (Symbol | String name, bars: Integer bars, ?beats_per_bar: Integer beats_per_bar) { () -> void } -> void
179
+ def timeline: (?beats_per_bar: Integer beats_per_bar) { () -> void } -> void
180
+ def transition: (from: Symbol | String, to: Symbol | String) { () -> void } -> void
181
+ def midi_map: (?note: Integer? note, ?cc: Integer? cc, ?pc: Integer? pc) { (*untyped) -> void } -> void
182
+ def set: (Symbol | String key, untyped value) -> untyped
183
+ def to_h: () -> Hash[Symbol, untyped]
184
+ end
185
+
186
+ class TimelineBuilder
187
+ DEFAULT_BEATS_PER_BAR: Integer
188
+
189
+ class Point < Struct[untyped]
190
+ attr_accessor value: Float
191
+ attr_accessor unit: Symbol
192
+ end
193
+
194
+ def initialize: (?beats_per_bar: Integer beats_per_bar) -> void
195
+ def evaluate: () ?{ () -> void } -> TimelineBuilder
196
+ def at: (Numeric | Point position, scene: Symbol | String scene) -> timeline_entry
197
+ def seconds: (Numeric value) -> Point
198
+ def beats: (Numeric value) -> Point
199
+ def bars: (Numeric value, ?beats_per_bar: Integer? beats_per_bar) -> Point
200
+ def to_h: () -> Array[timeline_entry]
201
+ def transitions: () -> Array[Hash[Symbol, untyped]]
202
+ end
203
+
204
+ class Engine::TransitionBuilder
205
+ def initialize: () -> void
206
+ def effect: (Symbol | String name, **untyped options) -> void
207
+ def trigger: () { () -> bool } -> void
208
+ def on_beat: (Integer count) -> void
209
+ def on_bar: (Integer count, ?beats_per_bar: Integer beats_per_bar) -> void
210
+ def to_h: () -> Hash[Symbol, untyped]
211
+ end
212
+
213
+ class Engine::KeyBindingBuilder
214
+ def initialize: () -> void
215
+ def switch_scene: (Symbol | String name) -> void
216
+ def blackout: () -> void
217
+ def freeze: () -> void
218
+ def live_control: (Symbol | String control) -> void
219
+ def to_h: () -> Hash[Symbol, untyped]
220
+ end
221
+
222
+ class SceneBuilder
223
+ def initialize: (
224
+ name: Symbol | String name,
225
+ ?styles: Hash[Symbol, Hash[Symbol, untyped]] styles,
226
+ ?themes: Hash[Symbol, Hash[Symbol, untyped]] themes,
227
+ ?layers: Array[layer] layers
228
+ ) -> void
229
+ def evaluate: () ?{ () -> void } -> SceneBuilder
230
+ def layer: (Symbol | String name) ?{ () -> void } -> void
231
+ def group: (Symbol | String name) { () -> void } -> void
232
+ def use_theme: (Symbol | String name) -> Hash[Symbol, untyped]
233
+ def to_h: () -> scene
234
+ end
235
+
236
+ class LayerGroupBuilder
237
+ def initialize: (
238
+ name: Symbol | String name,
239
+ ?styles: Hash[Symbol, Hash[Symbol, untyped]] styles,
240
+ ?defaults: Hash[Symbol, untyped] defaults
241
+ ) -> void
242
+ def evaluate: () ?{ () -> void } -> LayerGroupBuilder
243
+ def layer: (Symbol | String name) ?{ () -> void } -> void
244
+ def blend: (Symbol | String value) -> Symbol
245
+ def opacity: (Numeric value) -> Float
246
+ def effect: (Symbol | String value) -> Symbol
247
+ def effect_intensity: (Numeric value) -> Float
248
+ def vj_effect: (Symbol | String value) -> Symbol
249
+ def geometry: (Symbol | String value) -> Symbol
250
+ def material: (Symbol | String value) -> Symbol
251
+ def scale: (Numeric value) -> Float
252
+ def deform: (Numeric value) -> Float
253
+ def color_shift: (Numeric value) -> Float
254
+ def palette: (*untyped colors) -> Array[String]
255
+ def use_style: (Symbol | String name) -> Hash[Symbol, untyped]
256
+ def to_a: () -> Array[layer]
257
+ end
258
+
259
+ class StyleBuilder
260
+ def initialize: (name: Symbol | String name, ?kind: String kind) -> void
261
+ def evaluate: () ?{ () -> void } -> StyleBuilder
262
+ def palette: (*untyped colors) -> Array[String]
263
+ def to_h: () -> style
264
+ end
265
+
266
+ class LayerBuilder
267
+ def initialize: (
268
+ name: Symbol | String name,
269
+ ?styles: Hash[Symbol, Hash[Symbol, untyped]] styles,
270
+ ?defaults: Hash[Symbol, untyped] defaults
271
+ ) -> void
272
+ def evaluate: () ?{ () -> void } -> LayerBuilder
273
+ def type: (Symbol | String value) -> Symbol
274
+ def shader: (Symbol | String value, ?reload: bool? reload) -> Symbol
275
+ def glsl: (String | Pathname path) -> String
276
+ def file: (String | Pathname path) -> String
277
+ def circle: (**untyped options) ?{ () -> void } -> Hash[Symbol, untyped]
278
+ def line: (**untyped options) ?{ () -> void } -> Hash[Symbol, untyped]
279
+ def draw: () { () -> void } -> Array[Hash[Symbol, untyped]]
280
+ def source: (Symbol | String value, **untyped options) -> (Symbol | source)
281
+ def count: (Integer value) -> Integer
282
+ def content: (String value) -> String
283
+ def font_size: (Integer value) -> Integer
284
+ def letter_spacing: (Numeric value) -> Float
285
+ def align: (Symbol | String value) -> Symbol
286
+ def font: (String value) -> String
287
+ def fill: (String value) -> String
288
+ def stroke: (?untyped value, ?width: Numeric? width, ?color: String? color) -> Hash[Symbol, untyped]
289
+ def shadow: (?color: String? color, ?blur: Numeric? blur) -> Hash[Symbol, untyped]
290
+ def blend: (Symbol | String value) -> Symbol
291
+ def opacity: (Numeric value) -> Float
292
+ def effect: (Symbol | String value) -> Symbol
293
+ def effect_intensity: (Numeric value) -> Float
294
+ def vj_effect: (Symbol | String value) -> Symbol
295
+ def geometry: (Symbol | String value) -> Symbol
296
+ def material: (Symbol | String value) -> Symbol
297
+ def scale: (Numeric value) -> Float
298
+ def deform: (Numeric value) -> Float
299
+ def color_shift: (Numeric value) -> Float
300
+ def palette: (*untyped colors) -> Array[String]
301
+ def use_style: (Symbol | String name) -> Hash[Symbol, untyped]
302
+ def param: (
303
+ Symbol | String name,
304
+ ?default: Numeric? default,
305
+ ?range: Range[Numeric]? | [Numeric, Numeric]? range,
306
+ ?min: Numeric? min,
307
+ ?max: Numeric? max,
308
+ ?step: Numeric? step
309
+ ) -> Hash[Symbol, untyped]
310
+ def map: (?Hash[untyped, untyped] | Symbol | String definition, **untyped options) ?{ () -> void } -> void
311
+ def react_to: (Hash[Symbol, untyped] | Symbol | String source_value) { () -> void } -> void
312
+ def amplitude: () -> source
313
+ def frequency_band: (Symbol | String name) -> source
314
+ def sub: () -> source
315
+ def low: () -> source
316
+ def bass: () -> source
317
+ def mid: () -> source
318
+ def high: () -> source
319
+ def treble: () -> source
320
+ def fft_spectrum: () -> source
321
+ def onset: () -> source
322
+ | (Symbol | String band) -> source
323
+ def kick: () -> source
324
+ | (untyped value) -> untyped
325
+ def snare: () -> source
326
+ | (untyped value) -> untyped
327
+ def hihat: () -> source
328
+ | (untyped value) -> untyped
329
+ def beat?: () -> source
330
+ def beat: () -> source
331
+ def beat_confidence: () -> source
332
+ def beat_pulse: () -> source
333
+ def beat_count: () -> source
334
+ def bpm: () -> source
335
+ def to_h: () -> layer
336
+ end
337
+
338
+ class ReactionBuilder
339
+ def initialize: (mapping_factory: ^(Symbol | String, Hash[Symbol, untyped]) -> mapping mapping_factory) -> void
340
+ def evaluate: () { () -> void } -> Array[mapping]
341
+ def change: (Symbol | String target, **untyped options) -> mapping
342
+ def trigger: (Symbol | String target, **untyped options) -> mapping
343
+ end
344
+
345
+ class MappingTransformBuilder
346
+ def initialize: (?Hash[untyped, untyped] initial) -> void
347
+ def evaluate: () ?{ () -> void } -> MappingTransformBuilder
348
+ def gain: (Numeric value) -> Numeric
349
+ def range: (Range[Numeric] | [Numeric, Numeric] value) -> (Range[Numeric] | [Numeric, Numeric])
350
+ def min: (Numeric value) -> Numeric
351
+ def max: (Numeric value) -> Numeric
352
+ def curve: (Symbol | String value) -> (Symbol | String)
353
+ def deadzone: (Numeric value) -> Numeric
354
+ def smooth: (?attack: Numeric? attack, ?release: Numeric? release) -> Hash[Symbol, untyped]
355
+ def to_h: () -> Hash[Symbol, untyped]
356
+ end
357
+
358
+ class MappingResolver
359
+ def initialize: () -> void
360
+ def resolve_layers: (scene_layers: Array[Hash[Symbol, untyped]], audio: Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
361
+ end
362
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vizcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada
@@ -90,73 +90,153 @@ extra_rdoc_files: []
90
90
  files:
91
91
  - LICENSE.txt
92
92
  - README.md
93
- - docs/GETTING_STARTED.md
93
+ - docs/.nojekyll
94
+ - docs/assets/site.css
95
+ - docs/assets/vizcore-demo.gif
96
+ - docs/assets/vizcore-poster.png
97
+ - docs/assets/vj-tunnel.js
98
+ - docs/index.html
99
+ - examples/README.md
100
+ - examples/assets/README.md
94
101
  - examples/assets/complex_demo_loop.wav
102
+ - examples/audio_inspector.rb
95
103
  - examples/basic.rb
104
+ - examples/club_intro_drop.rb
96
105
  - examples/complex_audio_showcase.rb
97
106
  - examples/custom_shader.rb
98
107
  - examples/file_audio_demo.rb
99
108
  - examples/intro_drop.rb
109
+ - examples/kansai_rubykaigi_visual.rb
110
+ - examples/live_coding_minimal.rb
111
+ - examples/midi_controller_show.rb
100
112
  - examples/midi_scene_switch.rb
113
+ - examples/parser_visualizer.rb
114
+ - examples/readme_demo.rb
115
+ - examples/rhythm_geometry.rb
116
+ - examples/ruby_crystal_show.rb
117
+ - examples/shader_playground.rb
101
118
  - examples/shaders/custom_wave.frag
119
+ - examples/unyo_liquid.rb
120
+ - examples/vj_ambient_chill_room.rb
121
+ - examples/vj_dnb_jungle.rb
122
+ - examples/vj_festival_mainstage.rb
123
+ - examples/vj_festival_mainstage.yml
124
+ - examples/vj_glitch_industrial.rb
125
+ - examples/vj_hiphop_cipher.rb
126
+ - examples/vj_jpop_idol_live.rb
127
+ - examples/vj_synthwave_retro.rb
128
+ - examples/vj_techno_warehouse.rb
102
129
  - exe/vizcore
103
130
  - frontend/index.html
131
+ - frontend/src/audio-inspector.js
132
+ - frontend/src/live-controls.js
104
133
  - frontend/src/main.js
134
+ - frontend/src/midi-learn.js
135
+ - frontend/src/performance-monitor.js
136
+ - frontend/src/plugin-runtime.js
137
+ - frontend/src/projector-mode.js
105
138
  - frontend/src/renderer/engine.js
106
139
  - frontend/src/renderer/layer-manager.js
107
140
  - frontend/src/renderer/shader-manager.js
141
+ - frontend/src/runtime-control-preset.js
142
+ - frontend/src/shader-error-overlay.js
143
+ - frontend/src/shader-param-controls.js
108
144
  - frontend/src/shaders/builtins.js
109
145
  - frontend/src/shaders/post-effects.js
146
+ - frontend/src/visual-regression.js
147
+ - frontend/src/visual-settings-preset.js
110
148
  - frontend/src/visuals/geometry.js
149
+ - frontend/src/visuals/image-renderer.js
111
150
  - frontend/src/visuals/particle-system.js
151
+ - frontend/src/visuals/spectrogram-renderer.js
112
152
  - frontend/src/visuals/text-renderer.js
113
153
  - frontend/src/visuals/vj-effects.js
114
154
  - frontend/src/websocket-client.js
115
155
  - lib/vizcore.rb
116
156
  - lib/vizcore/analysis.rb
157
+ - lib/vizcore/analysis/adaptive_normalizer.rb
117
158
  - lib/vizcore/analysis/band_splitter.rb
118
159
  - lib/vizcore/analysis/beat_detector.rb
119
160
  - lib/vizcore/analysis/bpm_estimator.rb
161
+ - lib/vizcore/analysis/feature_recorder.rb
162
+ - lib/vizcore/analysis/feature_replay.rb
120
163
  - lib/vizcore/analysis/fft_processor.rb
121
164
  - lib/vizcore/analysis/fftw_ffi.rb
122
165
  - lib/vizcore/analysis/pipeline.rb
123
166
  - lib/vizcore/analysis/smoother.rb
167
+ - lib/vizcore/analysis/tap_tempo.rb
124
168
  - lib/vizcore/audio.rb
125
169
  - lib/vizcore/audio/base_input.rb
126
170
  - lib/vizcore/audio/dummy_sine_input.rb
127
171
  - lib/vizcore/audio/file_input.rb
172
+ - lib/vizcore/audio/fixture_input.rb
128
173
  - lib/vizcore/audio/input_manager.rb
129
174
  - lib/vizcore/audio/mic_input.rb
130
175
  - lib/vizcore/audio/midi_input.rb
131
176
  - lib/vizcore/audio/portaudio_ffi.rb
132
177
  - lib/vizcore/audio/ring_buffer.rb
133
178
  - lib/vizcore/cli.rb
179
+ - lib/vizcore/cli/doctor.rb
180
+ - lib/vizcore/cli/dsl_reference.rb
181
+ - lib/vizcore/cli/layer_docs.rb
182
+ - lib/vizcore/cli/scene_diagnostics.rb
183
+ - lib/vizcore/cli/scene_inspector.rb
184
+ - lib/vizcore/cli/scene_validator.rb
185
+ - lib/vizcore/cli/shader_template.rb
186
+ - lib/vizcore/cli/shader_uniform_docs.rb
134
187
  - lib/vizcore/config.rb
188
+ - lib/vizcore/control_preset.rb
135
189
  - lib/vizcore/dsl.rb
136
190
  - lib/vizcore/dsl/engine.rb
137
191
  - lib/vizcore/dsl/file_watcher.rb
138
192
  - lib/vizcore/dsl/layer_builder.rb
193
+ - lib/vizcore/dsl/layer_group_builder.rb
139
194
  - lib/vizcore/dsl/mapping_resolver.rb
195
+ - lib/vizcore/dsl/mapping_transform_builder.rb
140
196
  - lib/vizcore/dsl/midi_map_executor.rb
197
+ - lib/vizcore/dsl/reaction_builder.rb
141
198
  - lib/vizcore/dsl/scene_builder.rb
142
199
  - lib/vizcore/dsl/shader_source_resolver.rb
200
+ - lib/vizcore/dsl/style_builder.rb
201
+ - lib/vizcore/dsl/timeline_builder.rb
143
202
  - lib/vizcore/dsl/transition_controller.rb
144
203
  - lib/vizcore/errors.rb
204
+ - lib/vizcore/layer_catalog.rb
205
+ - lib/vizcore/project_manifest.rb
145
206
  - lib/vizcore/renderer.rb
146
207
  - lib/vizcore/renderer/frame_scheduler.rb
208
+ - lib/vizcore/renderer/png_writer.rb
209
+ - lib/vizcore/renderer/render_sequence.rb
210
+ - lib/vizcore/renderer/scene_frame_source.rb
147
211
  - lib/vizcore/renderer/scene_serializer.rb
212
+ - lib/vizcore/renderer/snapshot.rb
213
+ - lib/vizcore/renderer/snapshot_renderer.rb
148
214
  - lib/vizcore/server.rb
149
215
  - lib/vizcore/server/frame_broadcaster.rb
216
+ - lib/vizcore/server/gallery_app.rb
217
+ - lib/vizcore/server/gallery_page.rb
218
+ - lib/vizcore/server/gallery_runner.rb
150
219
  - lib/vizcore/server/rack_app.rb
151
220
  - lib/vizcore/server/runner.rb
221
+ - lib/vizcore/server/scene_dependency_watcher.rb
152
222
  - lib/vizcore/server/websocket_handler.rb
223
+ - lib/vizcore/sync.rb
224
+ - lib/vizcore/sync/osc_message.rb
225
+ - lib/vizcore/sync/osc_receiver.rb
153
226
  - lib/vizcore/templates/basic_scene.rb
154
227
  - lib/vizcore/templates/custom_shader_scene.rb
155
228
  - lib/vizcore/templates/custom_wave.frag
156
229
  - lib/vizcore/templates/intro_drop_scene.rb
157
230
  - lib/vizcore/templates/midi_control_scene.rb
231
+ - lib/vizcore/templates/plugin_layer.rb
232
+ - lib/vizcore/templates/plugin_readme.md
233
+ - lib/vizcore/templates/plugin_renderer.js
234
+ - lib/vizcore/templates/plugin_scene.rb
158
235
  - lib/vizcore/templates/project_readme.md
236
+ - lib/vizcore/templates/rubykaigi_scene.rb
159
237
  - lib/vizcore/version.rb
238
+ - scripts/browser_capture.mjs
239
+ - sig/vizcore.rbs
160
240
  homepage: https://github.com/ydah/vizcore
161
241
  licenses:
162
242
  - MIT
@@ -164,7 +244,7 @@ metadata:
164
244
  homepage_uri: https://github.com/ydah/vizcore
165
245
  source_code_uri: https://github.com/ydah/vizcore
166
246
  changelog_uri: https://github.com/ydah/vizcore/blob/main/CHANGELOG.md
167
- documentation_uri: https://github.com/ydah/vizcore/blob/main/docs/GETTING_STARTED.md
247
+ documentation_uri: https://ydah.github.io/vizcore/
168
248
  rubygems_mfa_required: 'true'
169
249
  rdoc_options: []
170
250
  require_paths:
@@ -1,105 +0,0 @@
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.