# sunset-sejong-university/tolqyn architecture

> Architecture diagram of the GitHub repository sunset-sejong-university/tolqyn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sunset-sejong-university/tolqyn
- Repository: https://github.com/sunset-sejong-university/tolqyn

## Overview

Tolkyn is a Processing-based generative-art sketch: audio and motion inputs influence a 3D particle-and-edge scene, with procedural melody and optional gyroscope support. Its principal workflow is sensing, analyzing input, updating the scene, and rendering it with sound. The README describes most sketch internals, but the only sampled source is the BLE-to-UDP bridge; therefore sketch-stage relationships are documented in the README, and the bridge-to-sketch connection is left unverified.

Main entry points: [`Tolqyn.pde`](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde) (3D Node Universe), [`ble_to_processing.py`](https://github.com/sunset-sejong-university/tolqyn/blob/main/ble_to_processing.py) (BLE UDP Bridge), [`Tolqyn/Tolqyn.ino`](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn/Tolqyn.ino) (Arduino Gyroscope Firmware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Input and Motion"]
  node_camera_motion["Camera Motion Tracking<br/>[Tolqyn.pde]"]
  node_gyro_fusion["Gyro Camera Fusion<br/>[Tolqyn.pde]"]
end

subgraph group_artwork["Generative Artwork"]
  node_node_universe["3D Node Universe<br/>[Tolqyn.pde]"]
  node_node_lifecycle["Node Respawn and Reveal<br/>[Tolqyn.pde]"]
  node_focus_selection["Focus Node Selection<br/>[Tolqyn.pde]"]
  node_distance_sorting["Farthest Node Sorting<br/>[Tolqyn.pde]"]
  node_edge_bursts["Edge Burst Rendering<br/>[Tolqyn.pde]"]
  node_scene_rotation["Scene Rotation<br/>[Tolqyn.pde]"]
  node_scene_output["P3D Scene Output<br/>[Tolqyn.pde]"]
end

subgraph group_sound["Audio and Melody"]
  node_audio_analysis["FFT and Beat Analysis<br/>[Tolqyn.pde]"]
  node_melody["Procedural Melody<br/>[Tolqyn.pde]"]
  node_tone_output["Tone Synthesis<br/>[Tolqyn.pde]"]
end

subgraph group_transport["Gyroscope Transport"]
  node_gyro_transport["BLE UDP Bridge"]
  node_arduino_firmware["Arduino Gyroscope Firmware<br/>[Tolqyn.ino]"]
end

node_microphone(("Microphone"))
node_webcam(("Webcam"))
node_gyro_device(("Gyroscope Device"))

node_webcam -->|"provides frames"| node_camera_motion
node_camera_motion -->|"supplies motion"| node_gyro_fusion
node_gyro_device -->|"sends gyro data"| node_arduino_firmware
node_arduino_firmware -.->|"BLE notifications"| node_gyro_transport
node_gyro_transport -.->|"forwards gyro data"| node_gyro_fusion
node_gyro_fusion -->|"sets orientation"| node_scene_rotation
node_microphone -->|"provides audio"| node_audio_analysis
node_audio_analysis -->|"drives burst density"| node_edge_bursts
node_audio_analysis -->|"triggers beat response"| node_node_universe
node_node_lifecycle -->|"regenerates nodes"| node_node_universe
node_node_universe -->|"supplies nodes"| node_focus_selection
node_focus_selection -->|"selects focus nodes"| node_distance_sorting
node_distance_sorting -->|"identifies distant nodes"| node_edge_bursts
node_focus_selection -->|"advances phrase"| node_melody
node_melody -->|"plays notes"| node_tone_output
node_edge_bursts -->|"draws connections"| node_scene_output
node_node_universe -->|"renders nodes"| node_scene_output
node_scene_rotation -->|"rotates scene"| node_scene_output

click node_camera_motion "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_gyro_transport "https://github.com/sunset-sejong-university/tolqyn/blob/main/ble_to_processing.py"
click node_gyro_fusion "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_audio_analysis "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_node_universe "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_node_lifecycle "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_focus_selection "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_distance_sorting "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_edge_bursts "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_scene_rotation "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_scene_output "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_melody "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_tone_output "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde"
click node_arduino_firmware "https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn/Tolqyn.ino"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_camera_motion,node_gyro_fusion toneBlue
class node_node_universe,node_node_lifecycle,node_focus_selection,node_distance_sorting,node_edge_bursts,node_scene_rotation,node_scene_output toneAmber
class node_audio_analysis,node_melody,node_tone_output toneMint
class node_gyro_transport,node_arduino_firmware toneRose
class node_microphone,node_webcam,node_gyro_device toneIndigo
```

## Components

### Input and Motion

- [Camera Motion Tracking](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [Gyro Camera Fusion](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`

### Generative Artwork

- [3D Node Universe](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [Node Respawn and Reveal](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [Focus Node Selection](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [Farthest Node Sorting](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [Edge Burst Rendering](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [Scene Rotation](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [P3D Scene Output](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`

### Audio and Melody

- [FFT and Beat Analysis](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [Procedural Melody](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`
- [Tone Synthesis](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn.pde): `Tolqyn.pde`

### Gyroscope Transport

- [BLE UDP Bridge](https://github.com/sunset-sejong-university/tolqyn/blob/main/ble_to_processing.py): `ble_to_processing.py`
- [Arduino Gyroscope Firmware](https://github.com/sunset-sejong-university/tolqyn/blob/main/Tolqyn/Tolqyn.ino): `Tolqyn/Tolqyn.ino`

### Other components

- **Microphone**
- **Webcam**
- **Gyroscope Device**

## Connections

- Webcam → Camera Motion Tracking: provides frames (evidence: `README.md`)
- Camera Motion Tracking → Gyro Camera Fusion: supplies motion (evidence: `README.md`)
- Gyroscope Device → Arduino Gyroscope Firmware: sends gyro data (evidence: `README.md`)
- Arduino Gyroscope Firmware → BLE UDP Bridge: BLE notifications (evidence: `ble_to_processing.py`)
- BLE UDP Bridge → Gyro Camera Fusion: forwards gyro data
- Gyro Camera Fusion → Scene Rotation: sets orientation (evidence: `README.md`)
- Microphone → FFT and Beat Analysis: provides audio (evidence: `README.md`)
- FFT and Beat Analysis → Edge Burst Rendering: drives burst density (evidence: `README.md`)
- FFT and Beat Analysis → 3D Node Universe: triggers beat response (evidence: `README.md`)
- Node Respawn and Reveal → 3D Node Universe: regenerates nodes (evidence: `README.md`)
- 3D Node Universe → Focus Node Selection: supplies nodes (evidence: `README.md`)
- Focus Node Selection → Farthest Node Sorting: selects focus nodes (evidence: `README.md`)
- Farthest Node Sorting → Edge Burst Rendering: identifies distant nodes (evidence: `README.md`)
- Focus Node Selection → Procedural Melody: advances phrase (evidence: `README.md`)
- Procedural Melody → Tone Synthesis: plays notes (evidence: `README.md`)
- Edge Burst Rendering → P3D Scene Output: draws connections (evidence: `README.md`)
- 3D Node Universe → P3D Scene Output: renders nodes (evidence: `README.md`)
- Scene Rotation → P3D Scene Output: rotates scene (evidence: `README.md`)
