Code and notebooks
Every number on this site is computed by the code below. 5 notebooks show the computation step by step, and 10 source files define the functions.
The path of a number
- Package The functions are defined in the tonnetz package.
- Tests Every number in the brief is checked by a test.
- Notebooks The computation is run step by step and produces tables and figures.
- Data and site The results are written to data files and the site reads its numbers from there.
The code does not run here. The outputs you see were saved when the notebooks were last run.
Code, comments and printed output are in Turkish. The explanations are translated.
Notebooks
- Setup and torus Brief 3 6 code cells, 2 figures
- The AEU chain and T1 Brief 4.1 6 code cells, 2 figures
- Cycles and T2 Brief 4.2 5 code cells, 1 figures
- The diameter of the Tonnetz graph Brief 4.3 3 code cells, 1 figures
- Makam scales Brief 4.4 5 code cells, 1 figures
Source files
| File | What it does | Definitions | Lines |
|---|---|---|---|
| core.py Package | N-TET Tonnetz: nodes, edges, triangles. | 20 | 156 |
| plr.py Package | The P, L, R transformations and their compositions. | 8 | 76 |
| chain.py Package | The chain-of-fifths coordinate and chains of consecutive fifths. | 6 | 77 |
| graph.py Package | Distances and diameter in the Tonnetz graph. | 2 | 27 |
| scales.py Package | Makam scales: the pitch set, the chords it contains and its shape on the network. | 5 | 92 |
| lattice.py Package | Planar lattice coordinates and the fundamental parallelogram of the torus. | 5 | 65 |
| plot.py Package | Matplotlib drawings for the report figures (optional dependency: matplotlib). | 1 | 81 |
| __init__.py Package | The N-TET Tonnetz computation core. This file gathers the public functions of the package and lists the equal divisions used in the brief's table. | 0 | 42 |
| export.py Script | Produces the JSON for the web site and the report: ../data/*.json. | 8 | 185 |
| test_brief.py Test | One test for each ([DOĞRULANDI], verified) number in the brief. Section numbers follow docs/PROJE-BRIFI.md. | 25 | 310 |