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.
- checksums.yaml +4 -4
- data/README.md +544 -9
- data/docs/.nojekyll +0 -0
- data/docs/assets/site.css +744 -0
- data/docs/assets/vizcore-demo.gif +0 -0
- data/docs/assets/vizcore-poster.png +0 -0
- data/docs/assets/vj-tunnel.js +159 -0
- data/docs/index.html +224 -0
- data/examples/README.md +59 -0
- data/examples/assets/README.md +19 -0
- data/examples/audio_inspector.rb +34 -0
- data/examples/club_intro_drop.rb +78 -0
- data/examples/kansai_rubykaigi_visual.rb +70 -0
- data/examples/live_coding_minimal.rb +22 -0
- data/examples/midi_controller_show.rb +78 -0
- data/examples/midi_scene_switch.rb +3 -1
- data/examples/parser_visualizer.rb +48 -0
- data/examples/readme_demo.rb +17 -0
- data/examples/rhythm_geometry.rb +34 -0
- data/examples/ruby_crystal_show.rb +35 -0
- data/examples/shader_playground.rb +18 -0
- data/examples/unyo_liquid.rb +59 -0
- data/examples/vj_ambient_chill_room.rb +124 -0
- data/examples/vj_dnb_jungle.rb +170 -0
- data/examples/vj_festival_mainstage.rb +245 -0
- data/examples/vj_festival_mainstage.yml +17 -0
- data/examples/vj_glitch_industrial.rb +164 -0
- data/examples/vj_hiphop_cipher.rb +167 -0
- data/examples/vj_jpop_idol_live.rb +210 -0
- data/examples/vj_synthwave_retro.rb +173 -0
- data/examples/vj_techno_warehouse.rb +195 -0
- data/frontend/index.html +468 -2
- data/frontend/src/audio-inspector.js +40 -0
- data/frontend/src/live-controls.js +131 -0
- data/frontend/src/main.js +792 -16
- data/frontend/src/midi-learn.js +194 -0
- data/frontend/src/performance-monitor.js +183 -0
- data/frontend/src/plugin-runtime.js +130 -0
- data/frontend/src/projector-mode.js +56 -0
- data/frontend/src/renderer/engine.js +148 -3
- data/frontend/src/renderer/layer-manager.js +428 -30
- data/frontend/src/renderer/shader-manager.js +26 -0
- data/frontend/src/runtime-control-preset.js +11 -0
- data/frontend/src/shader-error-overlay.js +29 -0
- data/frontend/src/shader-param-controls.js +93 -0
- data/frontend/src/shaders/builtins.js +380 -2
- data/frontend/src/shaders/post-effects.js +52 -0
- data/frontend/src/visual-regression.js +67 -0
- data/frontend/src/visual-settings-preset.js +103 -0
- data/frontend/src/visuals/geometry.js +268 -0
- data/frontend/src/visuals/image-renderer.js +291 -0
- data/frontend/src/visuals/particle-system.js +56 -10
- data/frontend/src/visuals/spectrogram-renderer.js +226 -0
- data/frontend/src/visuals/text-renderer.js +112 -11
- data/frontend/src/websocket-client.js +12 -1
- data/lib/vizcore/analysis/adaptive_normalizer.rb +70 -0
- data/lib/vizcore/analysis/beat_detector.rb +4 -2
- data/lib/vizcore/analysis/bpm_estimator.rb +8 -0
- data/lib/vizcore/analysis/feature_recorder.rb +159 -0
- data/lib/vizcore/analysis/feature_replay.rb +84 -0
- data/lib/vizcore/analysis/pipeline.rb +235 -11
- data/lib/vizcore/analysis/tap_tempo.rb +74 -0
- data/lib/vizcore/analysis.rb +4 -0
- data/lib/vizcore/audio/dummy_sine_input.rb +1 -1
- data/lib/vizcore/audio/fixture_input.rb +65 -0
- data/lib/vizcore/audio/input_manager.rb +4 -2
- data/lib/vizcore/audio/mic_input.rb +24 -8
- data/lib/vizcore/audio/portaudio_ffi.rb +106 -1
- data/lib/vizcore/audio.rb +1 -0
- data/lib/vizcore/cli/doctor.rb +159 -0
- data/lib/vizcore/cli/dsl_reference.rb +99 -0
- data/lib/vizcore/cli/layer_docs.rb +46 -0
- data/lib/vizcore/cli/scene_diagnostics.rb +23 -0
- data/lib/vizcore/cli/scene_inspector.rb +136 -0
- data/lib/vizcore/cli/scene_validator.rb +245 -0
- data/lib/vizcore/cli/shader_template.rb +68 -0
- data/lib/vizcore/cli/shader_uniform_docs.rb +54 -0
- data/lib/vizcore/cli.rb +689 -18
- data/lib/vizcore/config.rb +103 -2
- data/lib/vizcore/control_preset.rb +68 -0
- data/lib/vizcore/dsl/engine.rb +277 -5
- data/lib/vizcore/dsl/layer_builder.rb +491 -22
- data/lib/vizcore/dsl/layer_group_builder.rb +112 -0
- data/lib/vizcore/dsl/mapping_resolver.rb +132 -3
- data/lib/vizcore/dsl/mapping_transform_builder.rb +71 -0
- data/lib/vizcore/dsl/reaction_builder.rb +44 -0
- data/lib/vizcore/dsl/scene_builder.rb +61 -5
- data/lib/vizcore/dsl/shader_source_resolver.rb +67 -6
- data/lib/vizcore/dsl/style_builder.rb +68 -0
- data/lib/vizcore/dsl/timeline_builder.rb +138 -0
- data/lib/vizcore/dsl/transition_controller.rb +77 -0
- data/lib/vizcore/dsl.rb +5 -1
- data/lib/vizcore/layer_catalog.rb +273 -0
- data/lib/vizcore/project_manifest.rb +152 -0
- data/lib/vizcore/renderer/png_writer.rb +57 -0
- data/lib/vizcore/renderer/render_sequence.rb +153 -0
- data/lib/vizcore/renderer/scene_frame_source.rb +119 -0
- data/lib/vizcore/renderer/scene_serializer.rb +36 -3
- data/lib/vizcore/renderer/snapshot.rb +38 -0
- data/lib/vizcore/renderer/snapshot_renderer.rb +446 -0
- data/lib/vizcore/renderer.rb +5 -0
- data/lib/vizcore/server/frame_broadcaster.rb +91 -5
- data/lib/vizcore/server/gallery_app.rb +155 -0
- data/lib/vizcore/server/gallery_page.rb +100 -0
- data/lib/vizcore/server/gallery_runner.rb +48 -0
- data/lib/vizcore/server/rack_app.rb +203 -4
- data/lib/vizcore/server/runner.rb +370 -22
- data/lib/vizcore/server/scene_dependency_watcher.rb +79 -0
- data/lib/vizcore/server/websocket_handler.rb +60 -10
- data/lib/vizcore/server.rb +4 -0
- data/lib/vizcore/sync/osc_message.rb +103 -0
- data/lib/vizcore/sync/osc_receiver.rb +68 -0
- data/lib/vizcore/sync.rb +4 -0
- data/lib/vizcore/templates/midi_control_scene.rb +3 -1
- data/lib/vizcore/templates/plugin_layer.rb +20 -0
- data/lib/vizcore/templates/plugin_readme.md +23 -0
- data/lib/vizcore/templates/plugin_renderer.js +43 -0
- data/lib/vizcore/templates/plugin_scene.rb +14 -0
- data/lib/vizcore/templates/project_readme.md +7 -23
- data/lib/vizcore/templates/rubykaigi_scene.rb +30 -0
- data/lib/vizcore/version.rb +1 -1
- data/lib/vizcore.rb +27 -0
- data/scripts/browser_capture.mjs +75 -0
- data/sig/vizcore.rbs +362 -0
- metadata +83 -3
- 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:
|
|
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
|
|
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.
|
|
247
|
+
documentation_uri: https://ydah.github.io/vizcore/
|
|
168
248
|
rubygems_mfa_required: 'true'
|
|
169
249
|
rdoc_options: []
|
|
170
250
|
require_paths:
|
data/docs/GETTING_STARTED.md
DELETED
|
@@ -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.
|