# xella37/nbs-tunes-cc architecture

> Architecture diagram of the GitHub repository xella37/nbs-tunes-cc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xella37/nbs-tunes-cc
- Repository: https://github.com/xella37/nbs-tunes-cc

## Overview

NBS Tunes is a small ComputerCraft Lua library for parsing Note Block Studio files and loading them as playable music. The documented example runs `play.lua`, which loads the sample song and plays it; the library also documents playback controls, format versions 0–5, custom Minecraft sounds, and looping. No source excerpts were provided, so relationships below rely only on the README; internal implementation details are not inferred.

Main entry points: [`play.lua`](https://github.com/xella37/nbs-tunes-cc/blob/main/play.lua) (Example player), [`nbsTunes.lua`](https://github.com/xella37/nbs-tunes-cc/blob/main/nbsTunes.lua) (NBS Tunes library), [`100_gecs_Doritos_Fritos.nbs`](https://github.com/xella37/nbs-tunes-cc/blob/main/100_gecs_Doritos_Fritos.nbs) (Sample NBS songs), [`custom_instruments.nbs`](https://github.com/xella37/nbs-tunes-cc/blob/main/custom_instruments.nbs) (Custom instrument example)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("ComputerCraft user"))
node_example["Example player<br/>[play.lua]"]
node_library["NBS Tunes library<br/>[nbsTunes.lua]"]
node_song["Sample NBS songs"]
node_custom_song["Custom instrument example"]
node_minecraft["Minecraft sounds"]

node_user -->|"runs"| node_example
node_example -->|"loads and plays"| node_library
node_example -->|"loads"| node_song
node_library -->|"plays sounds"| node_minecraft
node_library -.->|"supports custom sounds"| node_custom_song

click node_example "https://github.com/xella37/nbs-tunes-cc/blob/main/play.lua"
click node_library "https://github.com/xella37/nbs-tunes-cc/blob/main/nbsTunes.lua"
click node_song "https://github.com/xella37/nbs-tunes-cc/blob/main/100_gecs_Doritos_Fritos.nbs"
click node_custom_song "https://github.com/xella37/nbs-tunes-cc/blob/main/custom_instruments.nbs"

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_user toneBlue
class node_example,node_library,node_song,node_custom_song toneTeal
class node_minecraft toneIndigo
```

## Components

### Other components

- **ComputerCraft user**
- [Example player](https://github.com/xella37/nbs-tunes-cc/blob/main/play.lua): `play.lua`
- [NBS Tunes library](https://github.com/xella37/nbs-tunes-cc/blob/main/nbsTunes.lua): `nbsTunes.lua`
- [Sample NBS songs](https://github.com/xella37/nbs-tunes-cc/blob/main/100_gecs_Doritos_Fritos.nbs): `100_gecs_Doritos_Fritos.nbs`
- [Custom instrument example](https://github.com/xella37/nbs-tunes-cc/blob/main/custom_instruments.nbs): `custom_instruments.nbs`
- **Minecraft sounds**

## Connections

- ComputerCraft user → Example player: runs (evidence: `README.md`)
- Example player → NBS Tunes library: loads and plays (evidence: `README.md`)
- Example player → Sample NBS songs: loads (evidence: `README.md`)
- NBS Tunes library → Minecraft sounds: plays sounds (evidence: `README.md`)
- NBS Tunes library → Custom instrument example: supports custom sounds (evidence: `README.md`)
