# arduino-guay/chordifyer architecture

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

- Interactive diagram: https://gitdiagram.com/arduino-guay/chordifyer
- Repository: https://github.com/arduino-guay/chordifyer

## Overview

Chordifyer is an Arduino-based MIDI chord accompaniment instrument. Its runtime can turn chord/progression and rhythm choices into scheduled note events, with scale and base-note controls; MIDI messages also control tempo, mode, and playback. The PianoRoll coordinates chord/scale data, MIDI output, and display state, while the metronome schedules its playback callbacks. The sketch and README were not sampled (the README is empty), so startup wiring and MIDI input registration are not shown; the external controller’s initiating relationship is therefore unverified.

Main entry points: [`MidiControl.h`](https://github.com/arduino-guay/chordifyer/blob/main/MidiControl.h) (MIDI Control), [`PianoRoll.h`](https://github.com/arduino-guay/chordifyer/blob/main/PianoRoll.h) (Piano Roll), [`Chmidi.h`](https://github.com/arduino-guay/chordifyer/blob/main/Chmidi.h) (MIDI and LEDs), [`Pantalla.h`](https://github.com/arduino-guay/chordifyer/blob/main/Pantalla.h) (OLED Display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_music_model["Chord and Scale Model"]
  node_chord_data["Chords and Rhythms<br/>[Acorde.h]"]
  node_scale_model["Scale Model<br/>[Escala.h]"]
end

subgraph group_playback["Playback Engine"]
  node_piano_roll["Piano Roll<br/>[PianoRoll.h]"]
  node_metronome["Metronome<br/>[Metronomo.h]"]
end

subgraph group_controls["MIDI Controls"]
  node_midi_control["MIDI Control<br/>[MidiControl.h]"]
end

subgraph group_hardware["Device Interfaces"]
  node_midi_io["MIDI and LEDs<br/>[Chmidi.h]"]
  node_display["OLED Display<br/>[Pantalla.h]"]
end

node_controller(("MIDI Controller"))
node_usb_midi(("USB MIDI"))
node_led_strip(("LED Strip"))
node_oled_hardware(("OLED Hardware"))

node_controller -.->|"sends messages"| node_midi_control
node_midi_control -->|"sets playback"| node_piano_roll
node_midi_control -->|"sets tempo"| node_metronome
node_midi_control -->|"maps notes"| node_scale_model
node_midi_control -->|"selects rhythms"| node_chord_data
node_midi_control -->|"forwards MIDI"| node_midi_io
node_piano_roll -->|"reads chord data"| node_chord_data
node_piano_roll -->|"calculates notes"| node_scale_model
node_piano_roll -->|"sends note events"| node_midi_io
node_piano_roll -->|"updates display state"| node_display
node_metronome -->|"schedules callbacks"| node_piano_roll
node_metronome -->|"sets displayed tempo"| node_display
node_display -->|"formats note name"| node_scale_model
node_midi_io -->|"sends MIDI"| node_usb_midi
node_midi_io -->|"updates pixels"| node_led_strip
node_display -->|"draws status"| node_oled_hardware

click node_midi_control "https://github.com/arduino-guay/chordifyer/blob/main/MidiControl.h"
click node_piano_roll "https://github.com/arduino-guay/chordifyer/blob/main/PianoRoll.h"
click node_metronome "https://github.com/arduino-guay/chordifyer/blob/main/Metronomo.h"
click node_chord_data "https://github.com/arduino-guay/chordifyer/blob/main/Acorde.h"
click node_scale_model "https://github.com/arduino-guay/chordifyer/blob/main/Escala.h"
click node_midi_io "https://github.com/arduino-guay/chordifyer/blob/main/Chmidi.h"
click node_display "https://github.com/arduino-guay/chordifyer/blob/main/Pantalla.h"

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_chord_data,node_scale_model toneBlue
class node_piano_roll,node_metronome toneAmber
class node_midi_control toneMint
class node_midi_io,node_display toneRose
class node_controller,node_usb_midi,node_led_strip,node_oled_hardware toneIndigo
```

## Components

### Chord and Scale Model

- [Chords and Rhythms](https://github.com/arduino-guay/chordifyer/blob/main/Acorde.h): `Acorde.h`
- [Scale Model](https://github.com/arduino-guay/chordifyer/blob/main/Escala.h): `Escala.h`

### Playback Engine

- [Piano Roll](https://github.com/arduino-guay/chordifyer/blob/main/PianoRoll.h): `PianoRoll.h`
- [Metronome](https://github.com/arduino-guay/chordifyer/blob/main/Metronomo.h): `Metronomo.h`

### MIDI Controls

- [MIDI Control](https://github.com/arduino-guay/chordifyer/blob/main/MidiControl.h): `MidiControl.h`

### Device Interfaces

- [MIDI and LEDs](https://github.com/arduino-guay/chordifyer/blob/main/Chmidi.h): `Chmidi.h`
- [OLED Display](https://github.com/arduino-guay/chordifyer/blob/main/Pantalla.h): `Pantalla.h`

### Other components

- **MIDI Controller**
- **USB MIDI**
- **LED Strip**
- **OLED Hardware**

## Connections

- MIDI Controller → MIDI Control: sends messages
- MIDI Control → Piano Roll: sets playback (evidence: `MidiControl.h`)
- MIDI Control → Metronome: sets tempo (evidence: `MidiControl.h`)
- MIDI Control → Scale Model: maps notes (evidence: `MidiControl.h`)
- MIDI Control → Chords and Rhythms: selects rhythms (evidence: `MidiControl.h`)
- MIDI Control → MIDI and LEDs: forwards MIDI (evidence: `MidiControl.h`)
- Piano Roll → Chords and Rhythms: reads chord data (evidence: `PianoRoll.h`)
- Piano Roll → Scale Model: calculates notes (evidence: `PianoRoll.h`)
- Piano Roll → MIDI and LEDs: sends note events (evidence: `PianoRoll.h`)
- Piano Roll → OLED Display: updates display state (evidence: `PianoRoll.h`)
- Metronome → Piano Roll: schedules callbacks (evidence: `Metronomo.h`)
- Metronome → OLED Display: sets displayed tempo (evidence: `Metronomo.h`)
- OLED Display → Scale Model: formats note name (evidence: `Pantalla.h`)
- MIDI and LEDs → USB MIDI: sends MIDI (evidence: `Chmidi.h`)
- MIDI and LEDs → LED Strip: updates pixels (evidence: `Chmidi.h`)
- OLED Display → OLED Hardware: draws status (evidence: `Pantalla.h`)
