Files
obsidian-vault/personal/projects/orblab.md
T
2026-05-30 10:03:30 +00:00

79 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OrbLab — Animated Voice Orb Visualizer (macOS)
Экспериментальный macOS-проект: анимированный orb-персонаж с аудиореактивностью, 4 стилями и панелью настроек.
## Расположение
`~/Developer/OrbLab/`
## Архитектура
```
OrbLab/
├── project.yml ← XcodeGen (не коммитить .xcodeproj)
├── OrbLab/
│ ├── Audio/AudioAnalyzer.swift ← AVAudioEngine + FFT → 8 bands
│ ├── Models/OrbSettings.swift ← @ObservableObject с настройками
│ ├── Views/
│ │ ├── ContentView.swift ← layout: stage + sidebar
│ │ ├── Components/
│ │ │ ├── OrbSwitcherView ← роутер по OrbStyle
│ │ │ ├── SettingsPanelView ← ручки управления
│ │ │ └── AudioMeterView ← 8-band мини-спектр
│ │ └── Styles/
│ │ ├── SiriOrbView ← blob + орбитали + частицы
│ │ ├── SpotifyOrbView ← equalizer bars + сфера
│ │ ├── ChatGPTOrbView ← ripple waves + shimmer arc
│ │ └── MetaOrbView ← wavy mesh blobs + angular glow
│ └── OrbLabApp.swift
```
## Стили
| Стиль | Описание | Техника |
|-------|----------|---------|
| **Siri** | Blob + glowing orbitals + particles | Canvas wobbly path + AngularGradient rings |
| **Spotify** | Equalizer bars + outer rings | Canvas bars, audio-reactive height |
| **ChatGPT** | Concentric ripple + shimmer arc | Canvas rings + animated arc |
| **Orb Lib** | Wavy mesh blobs + angular overlay | Ellipse layers + blendMode(.plusLighter) |
## AudioAnalyzer
- `AVAudioEngine` → tap на `inputNode` → 2048-sample FFT (vDSP)
- Hamming window → 8 частотных бэндов (20 Hz – 18 kHz)
- Smoothing 0.25 (экспоненциальный фильтр)
- Выдаёт: `level: Float` (RMS, 01) + `bands: [Float]` (8 бэндов)
## Настройки (OrbSettings)
- Colors: primary / secondary / accent
- Size: 80500 pt
- Opacity, Blur radius
- Speed multiplier (0.13.0×)
- Audio sensitivity (0.13.0×)
- Toggle: particles, orbitals, background
- Orbital count, particle count
- Glow intensity
## Пресеты цветов
- 🌊 Siri — cyan/indigo/purple
- 🟢 Spotify — green/teal/white
- ⚫ GPT — gray/white
- 🔥 Fire — red/orange/yellow
## Сборка
```bash
cd ~/Developer/OrbLab
xcodegen generate
# Открыть OrbLab.xcodeproj в Xcode или:
xcodebuild -project OrbLab.xcodeproj -scheme OrbLab -destination "platform=macOS" build
```
## Заметки
- `metasidd/Orb` (SPM) не компилируется на macOS — использует UIKit (UIColor, UIBezierPath). MetaOrb реализован нативно через Canvas + blendMode.
- Entitlements: sandbox OFF + `com.apple.security.device.audio-input` (для микрофона без sandbox)
- Deployment target: macOS 15.0 (для `.windowStyle(.hiddenTitleBar)` + `Window` scene API)