musa-dsl 0.43.1 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of musa-dsl might be problematic. Click here for more details.

Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -2
  3. data/README.md +89 -140
  4. data/README.yard.md +37 -0
  5. data/docs/{getting-started/tutorial.md → examples/neuma-notation.md} +6 -3
  6. data/docs/{getting-started/quick-start.md → examples/sequencer-dsl-voices.md} +2 -2
  7. data/docs/idioms.md +332 -0
  8. data/docs/subsystems/core-extensions.md +147 -129
  9. data/docs/subsystems/datasets.md +131 -39
  10. data/docs/subsystems/generative.md +35 -167
  11. data/docs/subsystems/matrix.md +41 -9
  12. data/docs/subsystems/midi.md +67 -4
  13. data/docs/subsystems/music.md +105 -26
  14. data/docs/subsystems/musicxml-builder.md +91 -30
  15. data/docs/subsystems/neumas.md +130 -40
  16. data/docs/subsystems/repl.md +42 -32
  17. data/docs/subsystems/sequencer.md +276 -110
  18. data/docs/subsystems/series.md +115 -23
  19. data/docs/subsystems/transcription.md +25 -3
  20. data/docs/subsystems/transport.md +88 -19
  21. data/lib/musa-dsl/core-ext/arrayfy.rb +5 -1
  22. data/lib/musa-dsl/core-ext/attribute-builder.rb +7 -4
  23. data/lib/musa-dsl/core-ext/deep-copy.rb +81 -24
  24. data/lib/musa-dsl/core-ext/dynamic-proxy.rb +4 -4
  25. data/lib/musa-dsl/core-ext/hashify.rb +9 -2
  26. data/lib/musa-dsl/core-ext/inspect-nice.rb +1 -1
  27. data/lib/musa-dsl/core-ext/smart-proc-binder.rb +26 -10
  28. data/lib/musa-dsl/core-ext/with.rb +25 -12
  29. data/lib/musa-dsl/datasets/dataset.rb +17 -9
  30. data/lib/musa-dsl/datasets/delta-d.rb +11 -11
  31. data/lib/musa-dsl/datasets/e.rb +72 -21
  32. data/lib/musa-dsl/datasets/gdv.rb +119 -87
  33. data/lib/musa-dsl/datasets/gdvd.rb +62 -26
  34. data/lib/musa-dsl/datasets/helper.rb +40 -10
  35. data/lib/musa-dsl/datasets/p.rb +60 -24
  36. data/lib/musa-dsl/datasets/pdv.rb +90 -19
  37. data/lib/musa-dsl/datasets/ps.rb +10 -5
  38. data/lib/musa-dsl/datasets/score/queriable.rb +55 -20
  39. data/lib/musa-dsl/datasets/score/render.rb +22 -5
  40. data/lib/musa-dsl/datasets/score/to-mxml/process-pdv.rb +287 -263
  41. data/lib/musa-dsl/datasets/score/to-mxml/process-ps.rb +139 -128
  42. data/lib/musa-dsl/datasets/score/to-mxml/process-time.rb +342 -324
  43. data/lib/musa-dsl/datasets/score/to-mxml/to-mxml.rb +61 -10
  44. data/lib/musa-dsl/datasets/score.rb +99 -30
  45. data/lib/musa-dsl/generative/darwin.rb +35 -28
  46. data/lib/musa-dsl/generative/generative-grammar.rb +49 -17
  47. data/lib/musa-dsl/generative/markov.rb +49 -9
  48. data/lib/musa-dsl/generative/variatio.rb +26 -6
  49. data/lib/musa-dsl/generative.rb +0 -1
  50. data/lib/musa-dsl/logger/logger.rb +42 -16
  51. data/lib/musa-dsl/matrix/matrix.rb +49 -20
  52. data/lib/musa-dsl/midi/midi-recorder.rb +31 -12
  53. data/lib/musa-dsl/midi/midi-voices.rb +204 -20
  54. data/lib/musa-dsl/music/chord-definition.rb +63 -25
  55. data/lib/musa-dsl/music/chords.rb +107 -30
  56. data/lib/musa-dsl/music/scale_kinds/chromatic_scale_kind.rb +6 -6
  57. data/lib/musa-dsl/music/scale_kinds/major_scale_kind.rb +9 -6
  58. data/lib/musa-dsl/music/scale_kinds/minor_harmonic_scale_kind.rb +10 -5
  59. data/lib/musa-dsl/music/scale_kinds/minor_natural_scale_kind.rb +9 -6
  60. data/lib/musa-dsl/music/scale_systems/equally_tempered_12_tone_scale_system.rb +3 -3
  61. data/lib/musa-dsl/music/scale_systems/twelve_semitones_scale_system.rb +2 -2
  62. data/lib/musa-dsl/music/scales.rb +265 -88
  63. data/lib/musa-dsl/musicxml/builder/attributes.rb +134 -55
  64. data/lib/musa-dsl/musicxml/builder/backup-forward.rb +26 -0
  65. data/lib/musa-dsl/musicxml/builder/direction.rb +41 -21
  66. data/lib/musa-dsl/musicxml/builder/helper.rb +7 -4
  67. data/lib/musa-dsl/musicxml/builder/measure.rb +31 -3
  68. data/lib/musa-dsl/musicxml/builder/note-complexities.rb +14 -7
  69. data/lib/musa-dsl/musicxml/builder/part-group.rb +11 -1
  70. data/lib/musa-dsl/musicxml/builder/part.rb +14 -0
  71. data/lib/musa-dsl/musicxml/builder/pitched-note.rb +11 -3
  72. data/lib/musa-dsl/musicxml/builder/rest.rb +6 -3
  73. data/lib/musa-dsl/musicxml/builder/score-partwise.rb +22 -1
  74. data/lib/musa-dsl/musicxml/builder/typed-text.rb +8 -6
  75. data/lib/musa-dsl/musicxml/builder/unpitched-note.rb +4 -2
  76. data/lib/musa-dsl/neumalang/neumalang.rb +43 -16
  77. data/lib/musa-dsl/neumas/array-to-neumas.rb +36 -18
  78. data/lib/musa-dsl/neumas/neuma-decoder.rb +3 -3
  79. data/lib/musa-dsl/neumas/neuma-gdv-decoder.rb +16 -2
  80. data/lib/musa-dsl/neumas/neuma-gdvd-decoder.rb +19 -14
  81. data/lib/musa-dsl/neumas/neumas.rb +25 -17
  82. data/lib/musa-dsl/neumas/string-to-neumas.rb +89 -18
  83. data/lib/musa-dsl/repl/repl.rb +100 -91
  84. data/lib/musa-dsl/sequencer/base-sequencer-implementation-every.rb +22 -4
  85. data/lib/musa-dsl/sequencer/base-sequencer-implementation-move.rb +4 -0
  86. data/lib/musa-dsl/sequencer/base-sequencer-implementation-play-helper.rb +62 -35
  87. data/lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb +8 -1
  88. data/lib/musa-dsl/sequencer/base-sequencer-implementation-play.rb +95 -18
  89. data/lib/musa-dsl/sequencer/base-sequencer-implementation.rb +39 -7
  90. data/lib/musa-dsl/sequencer/base-sequencer-tick-based.rb +50 -14
  91. data/lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb +84 -24
  92. data/lib/musa-dsl/sequencer/base-sequencer.rb +159 -39
  93. data/lib/musa-dsl/sequencer/sequencer-dsl.rb +39 -7
  94. data/lib/musa-dsl/series/array-to-serie.rb +15 -5
  95. data/lib/musa-dsl/series/base-series.rb +97 -14
  96. data/lib/musa-dsl/series/buffer-serie.rb +6 -0
  97. data/lib/musa-dsl/series/main-serie-constructors.rb +233 -69
  98. data/lib/musa-dsl/series/main-serie-operations.rb +163 -52
  99. data/lib/musa-dsl/series/proxy-serie.rb +157 -13
  100. data/lib/musa-dsl/series/quantizer-serie.rb +44 -4
  101. data/lib/musa-dsl/series/queue-serie.rb +33 -8
  102. data/lib/musa-dsl/series/series-composer.rb +94 -40
  103. data/lib/musa-dsl/series/timed-serie.rb +1 -1
  104. data/lib/musa-dsl/transcription/from-gdv-to-midi.rb +117 -12
  105. data/lib/musa-dsl/transcription/from-gdv-to-musicxml.rb +7 -0
  106. data/lib/musa-dsl/transcription/from-gdv.rb +1 -1
  107. data/lib/musa-dsl/transcription/transcription.rb +23 -11
  108. data/lib/musa-dsl/transport/clock.rb +8 -3
  109. data/lib/musa-dsl/transport/dummy-clock.rb +46 -9
  110. data/lib/musa-dsl/transport/external-tick-clock.rb +30 -23
  111. data/lib/musa-dsl/transport/input-midi-clock.rb +22 -15
  112. data/lib/musa-dsl/transport/timer-clock.rb +40 -6
  113. data/lib/musa-dsl/transport/timer.rb +6 -4
  114. data/lib/musa-dsl/transport/transport.rb +80 -36
  115. data/lib/musa-dsl/version.rb +1 -1
  116. data/lib/musa-dsl.rb +9 -6
  117. data/tools/doc-examples.rb +744 -0
  118. metadata +6 -6
  119. data/docs/README.md +0 -84
  120. data/docs/api-reference.md +0 -86
  121. data/lib/musa-dsl/generative/rules.rb +0 -590
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4255273d1d071bd791ad11b5da8cd3e452442c2ec5bc78aed0f594968589a79
4
- data.tar.gz: 8814fbd0fa803dd30f1aaad76a0b4843f008065db1533bef87872fccf1cf8e9c
3
+ metadata.gz: 489a7b49196f4a1ff58782264f6b1d36da306d6a64671785b4aa904567461b4c
4
+ data.tar.gz: '099acf5b2ed77c18494bcfecc7b73cf375cf37a46c6e2ba940df3a5015934d60'
5
5
  SHA512:
6
- metadata.gz: 61b3eb793d334844822636e2d8597c86dee2f353170d215328bf6dfc1be4aa24fdbe96c830584de377d99472d2259ef75a804f3c564fa5785f2430a14c1805a2
7
- data.tar.gz: 7616c2dd4e24bf46714a64d48690d81989fa8ed41d99972f7c0aa2164607c8e72bf7fcd57b20963eed38d56420e889cd3421135d79df11d35464f2b2b1637005
6
+ metadata.gz: 94c57a46910a986ed39c997ed9680a8a232e6b38d892cc6780c03ef5a01c30f7f70ab3db3fa4cfbdb792b9e575191ef90ac8f6a380c7bd7cf8b74098e55acd1a
7
+ data.tar.gz: 394f30c7fc69e0e0474b75778440ac56a2e7847ab50c0f374e84c5893ded282e379bdc731b00dcedf2c4808fc918dcbfc4682f4b71ef3818d57c9daafe8f11e0
data/.yardopts CHANGED
@@ -1,7 +1,6 @@
1
1
  --markup markdown
2
2
  --title "Musa-DSL API"
3
- --readme README.md
3
+ --readme README.yard.md
4
4
  --no-private
5
5
  --embed-mixins
6
6
  lib/**/*.rb
7
-
data/README.md CHANGED
@@ -23,7 +23,7 @@ Musa-DSL is a programming language DSL (Domain-Specific Language) based on Ruby
23
23
  - **Transport & Timing** - Multiple clock sources (internal, MIDI, external) with microsecond precision
24
24
  - **Audio Engine Independent** - Works with any MIDI-capable, OSC-capable or any other output hardware or software system
25
25
  - **Series-Based Composition** - Flexible sequence generators for pitches, rhythms, dynamics, and any musical parameter
26
- - **Generative Tools** - Markov chains, combinatorial variations (Variatio), rule-based production systems (Rules), formal grammars (GenerativeGrammar), and genetic algorithms (Darwin)
26
+ - **Generative Tools** - Markov chains, combinatorial variations (Variatio), formal grammars (GenerativeGrammar), and genetic algorithms (Darwin)
27
27
  - **Matrix Operations** - Mathematical transformations for musical structures
28
28
  - **Scale System** - Comprehensive support for scales, tuning systems, and chord structures
29
29
  - **Neumalang Notation** - Intuitive text-based and customizable musical (or sound) notation
@@ -39,7 +39,7 @@ Musa-DSL is a programming language DSL (Domain-Specific Language) based on Ruby
39
39
  - [Non-commercial use](https://www.jetbrains.com/non-commercial/) — for learning, hobbies, open-source, content creation
40
40
  - [Students](https://www.jetbrains.com/academy/student-pack/) and [Teachers/Researchers](https://www.jetbrains.com/academy/teacher-pack/) — with institutional email
41
41
 
42
- VSCode with the Ruby LSP extension also works well, though Ruby autocomplete and hover documentation are less complete.
42
+ [VSCode](https://code.visualstudio.com/) with the Ruby LSP extension also works well, though Ruby autocomplete and hover documentation are less complete.
43
43
 
44
44
  ### Framework Installation
45
45
 
@@ -58,24 +58,19 @@ gem install musa-dsl
58
58
  **Requirements:**
59
59
  - Ruby ~> 3.4
60
60
 
61
- ## Quick Start
61
+ ## Examples
62
62
 
63
- A complete working example with multiple interacting voice lines, demonstrating sequencer DSL, timing control, and shared state.
63
+ Two complete, runnable examples included here. Pedagogical learning is covered separately in the [musadsl-demo](https://github.com/javier-sy/musadsl-demo) repository.
64
64
 
65
- **📖 [Complete Quick Start Guide](docs/getting-started/quick-start.md)**
66
-
67
- ## Tutorial
68
-
69
- Detailed tutorial showing the Neuma notation system for composing melodies with grade-based notation.
70
-
71
- **📖 [Complete Tutorial](docs/getting-started/tutorial.md)**
65
+ - **[Sequencer DSL with interacting voices](docs/examples/sequencer-dsl-voices.md)** — multiple voice lines coordinated through shared state, demonstrating the sequencer DSL and timing primitives.
66
+ - **[Neuma notation](docs/examples/neuma-notation.md)** — composing melodies with grade-based Neuma notation and the parser.
72
67
 
73
68
  ## Demo Projects
74
69
 
75
70
  A collection of 22+ working demo projects covering the full spectrum of Musa DSL capabilities:
76
71
 
77
72
  - **Basic concepts**: Setup, series, neumas, canon
78
- - **Generative tools**: Markov chains, Variatio, Darwin, Grammar, Rules, Matrix
73
+ - **Generative tools**: Markov chains, Variatio, Darwin, Grammar, Matrix
79
74
  - **DAW integration**: MIDI sync, live coding, clock modes
80
75
  - **External protocols**: OSC with SuperCollider and Max/MSP
81
76
  - **Advanced patterns**: Event architecture, parameter automation, multi-phase compositions
@@ -84,12 +79,10 @@ Each demo is a complete, runnable project with documentation explaining the conc
84
79
 
85
80
  **📦 [musadsl-demo Repository](https://github.com/javier-sy/musadsl-demo)**
86
81
 
87
- ## System Architecture
82
+ ## MusaDSL Ecosystem
88
83
 
89
84
  MusaDSL is a comprehensive ecosystem consisting of a core framework (musa-dsl) and associated projects for communication, development, and integration.
90
85
 
91
- ### MusaDSL Ecosystem
92
-
93
86
  **Core Framework:**
94
87
  - [**musa-dsl**](https://github.com/javier-sy/musa-dsl) - Main DSL framework for algorithmic composition and musical thinking
95
88
 
@@ -99,163 +92,119 @@ MusaDSL is a comprehensive ecosystem consisting of a core framework (musa-dsl) a
99
92
  - [**midi-communications**](https://github.com/javier-sy/midi-communications) - Cross-platform MIDI I/O abstraction layer
100
93
  - [**midi-communications-macos**](https://github.com/javier-sy/midi-communications-macos) - macOS-specific MIDI native implementation
101
94
 
102
- ### musa-dsl Internal Architecture
103
-
104
- The musa-dsl framework is organized in modular layers:
105
-
106
- #### 1. Foundation Layer
107
- - **core-ext** - Ruby core extensions (refinements for enhanced syntax)
108
- - **logger** - Structured logging system with severity levels
109
-
110
- #### 2. Temporal & Scheduling Layer
111
- - **sequencer** - Event scheduling engine with microsecond precision
112
- - Tick-based (quantized) and tickless (continuous) timing modes
113
- - Series playback with automatic duration management
114
- - Support for polyrhythms and polytemporal structures
115
- - **transport** - High-level playback control with clock synchronization
116
- - BPM management and tempo changes
117
- - Start/stop/pause/continue controls
118
- - Multiple clock source support (internal, MIDI, external)
119
-
120
- #### 3. Notation & Parsing Layer
121
- - **neumas** - Text-based musical notation system
122
- - **neumalang** - Parser and interpreter for neuma notation with DSL support
123
-
124
- #### 4. Generation & Transformation Layer
125
- - **series** - Lazy sequence generators with functional operations
126
- - Map, filter, transpose, repeat, and combination operations
127
- - Infinite and finite series support
128
- - **generative** - Algorithmic composition tools
129
- - **Markov chains**: Probabilistic sequence generation
130
- - **Variatio**: Cartesian product parameter variations
131
- - **Rules**: L-system-like production systems with growth/pruning
132
- - **GenerativeGrammar**: Formal grammar-based generation
133
- - **Darwin**: Genetic algorithms for evolutionary composition
134
- - **matrix** - Matrix operations for musical gestures
135
- - Matrix-to-P (point sequence) conversion
136
- - Gesture condensation and transformation
137
-
138
- #### 5. Output & Communication Layer
139
- - **transcription** - Musical event transformation system
140
- - Ornament expansion (trills, mordents, turns)
141
- - GDV to MIDI/MusicXML conversion
142
- - Dynamic articulation rendering
143
- - **musicxml** - MusicXML score generation
144
- - Multi-part score creation
145
- - Notation directives (dynamics, tempo, articulations)
146
- - Standard MusicXML 3.0 output
147
- - **midi** - MIDI voice management
148
- - Polyphonic voice allocation
149
- - Channel management
150
- - Note-on/note-off scheduling
151
-
152
- #### 6. Musical Knowledge Layer
153
- - **music** - Scales, tuning systems, intervals, and chord structures
154
- - Equal temperament and just intonation support
155
- - Modal scales (major, minor, chromatic, etc.)
156
- - Chord definitions and harmonic analysis
157
- - **datasets** - Musical data structures (GDV, PDV, Score)
158
- - GDV (Grade-Duration-Velocity): Scale-relative representation
159
- - PDV (Pitch-Duration-Velocity): Absolute pitch representation
160
- - Score: Timeline-based multi-track composition structure
161
-
162
- #### 7. Development & Interaction Layer
163
- - **repl** - Interactive Read-Eval-Print Loop for live composition
164
-
165
- ## Core Subsystems
166
-
167
- ### MIDI - Voice Management & Recording
168
-
169
- Polyphonic voice management for MIDI output with automatic note tracking, and MIDI input recording with precise timestamping.
95
+ ## MusaDSL Architecture
170
96
 
171
- **📖 [Complete Documentation](docs/subsystems/midi.md)**
97
+ The musa-dsl framework is organized in modular layers. Each component has its own detailed documentation.
172
98
 
173
- ### Sequencer - Temporal Engine
99
+ ### 1. Foundation Layer
100
+ - [**core-ext**](docs/subsystems/core-extensions.md) - Ruby refinements and metaprogramming utilities: Arrayfy, Hashify, ExplodeRanges, DeepCopy, DynamicProxy, AttributeBuilder.
101
+ - **logger** - Structured logging system with severity levels.
174
102
 
175
- Event scheduling engine with musical time (bars/beats), precise tick-based timing, and DSL for temporal composition.
103
+ ### 2. Temporal & Scheduling Layer
104
+ - [**sequencer**](docs/subsystems/sequencer.md) - Event scheduling engine with musical time (bars/beats), microsecond-precise tick-based timing, and a DSL for temporal composition. Tick-based (quantized) and tickless (continuous) modes; series playback with automatic duration management; polyrhythms and polytemporal structures.
105
+ - [**transport**](docs/subsystems/transport.md) - Comprehensive timing infrastructure connecting clock sources to the sequencer. Supports multiple clock types (TimerClock, InputMidiClock, ExternalTickClock, DummyClock), BPM management, tempo changes, and the start/stop/pause/continue playback lifecycle.
176
106
 
177
- **📖 [Complete Documentation](docs/subsystems/sequencer.md)**
107
+ ### 3. Notation & Parsing Layer
108
+ - [**neumas + neumalang**](docs/subsystems/neumas.md) - Compact text-based musical notation system with parser and interpreter for converting notation to structured musical data, with DSL support.
178
109
 
179
- ### Transport - Timing & Clocks
110
+ ### 4. Generation & Transformation Layer
111
+ - [**series**](docs/subsystems/series.md) - Lazy functional sequence generators with map/filter operations, numeric generators, buffering, quantization, and timed merging. Transpose, repeat, and combination operations; infinite and finite series support.
112
+ - [**generative**](docs/subsystems/generative.md) - Algorithmic composition tools: Markov chains (probabilistic sequence generation), Variatio (Cartesian product parameter variations), GenerativeGrammar (formal grammar-based generation), and Darwin (genetic algorithms for evolutionary composition).
113
+ - [**matrix**](docs/subsystems/matrix.md) - Matrix operations for musical gestures: matrix-to-P (point sequence) conversion for sequencer playback, gesture condensation and transformation. Treats sonic gestures as geometric objects.
180
114
 
181
- Comprehensive timing infrastructure connecting clock sources to the sequencer. Supports multiple clock types (TimerClock, InputMidiClock, ExternalTickClock, DummyClock) and manages playback lifecycle with precise timing control.
115
+ ### 5. Output & Communication Layer
116
+ - [**transcription**](docs/subsystems/transcription.md) - Musical event transformation system with ornament expansion (trills, mordents, turns), GDV to MIDI/MusicXML conversion, and dynamic articulation rendering. Expansion for MIDI or preservation as notation symbols for MusicXML.
117
+ - [**musicxml**](docs/subsystems/musicxml-builder.md) - MusicXML score generation. Hierarchical structure, multiple voices, multi-part scores, articulations, dynamics, tempo, and notation directives. Standard MusicXML 3.0 output.
118
+ - [**midi**](docs/subsystems/midi.md) - MIDI voice management with polyphonic voice allocation, channel management, note-on/note-off scheduling, automatic note tracking, and MIDI input recording with precise timestamping.
182
119
 
183
- **📖 [Complete Transport Documentation](docs/subsystems/transport.md)**
120
+ ### 6. Musical Knowledge Layer
121
+ - [**music**](docs/subsystems/music.md) - Scales, tuning systems, intervals, and chord structures. Equal temperament and just intonation support; modal scales (major, minor, chromatic, etc.); chord definitions, harmonic analysis, and chord navigation.
122
+ - [**datasets**](docs/subsystems/datasets.md) - Type-safe musical event representations: GDV (Grade-Duration-Velocity, scale-relative), PDV (Pitch-Duration-Velocity, absolute), PS, P, V. Conversions, validation, Score container (timeline-based multi-track composition), and advanced queries.
184
123
 
124
+ ### 7. Development & Interaction Layer
125
+ - [**repl**](docs/subsystems/repl.md) - Interactive Read-Eval-Print Loop for live composition. TCP-based server for real-time code evaluation and error handling. Consumed by external REPL clients (editor extensions, custom evaluators).
185
126
 
186
- ### Series - Sequence Generators
127
+ ## Where to start
187
128
 
188
- Lazy functional sequence generators with map/filter operations, numeric generators, buffering, quantization, and timed merging.
129
+ The layers above are the order the framework is BUILT in, bottom-up by
130
+ dependency. It is not the order to read it in. These are:
189
131
 
190
- **📖 [Complete Documentation](docs/subsystems/series.md)**
132
+ **New to MusaDSL?** Start with one of the [examples](#examples) and the
133
+ architecture above, then read in this order — which cuts across the layers on
134
+ purpose, because output is the fastest way to hear that something works:
191
135
 
192
- ### Neumas & Neumalang - Musical Notation
136
+ 1. [midi](docs/subsystems/midi.md) — getting a sound out
137
+ 2. [sequencer](docs/subsystems/sequencer.md) — putting it in time
138
+ 3. [series](docs/subsystems/series.md) — generating the material
139
+ 4. [datasets](docs/subsystems/datasets.md) — what an event is made of
193
140
 
194
- Compact text-based musical notation system with parser for converting notation to structured musical data.
141
+ **Want to compose?**
195
142
 
196
- **📖 [Complete Documentation](docs/subsystems/neumas.md)**
143
+ 1. [neumas](docs/subsystems/neumas.md) — the notation
144
+ 2. [music](docs/subsystems/music.md) — scales and chords
145
+ 3. [generative](docs/subsystems/generative.md) — Markov, Variatio, grammars, Darwin
146
+ 4. [musicxml-builder](docs/subsystems/musicxml-builder.md) — if the piece has to be read on paper
147
+ 5. The [22 demo projects](https://github.com/javier-sy/musadsl-demo), which are
148
+ complete pieces rather than snippets
197
149
 
198
- ### Datasets - Sonic Data Structures
150
+ **Live coding?**
199
151
 
200
- Type-safe musical event representations (GDV, PDV, PS, P, V) with conversions, validation, Score container, and advanced queries.
152
+ 1. [repl](docs/subsystems/repl.md) — the server your editor talks to
153
+ 2. A MusaLCE client (VSCode, Bitwig, Live)
154
+ 3. [sequencer](docs/subsystems/sequencer.md) — its DSL is what you type live
155
+ 4. [transport](docs/subsystems/transport.md) — syncing to a DAW's clock
201
156
 
202
- **📖 [Complete Documentation](docs/subsystems/datasets.md)**
157
+ **Extending the DSL?** These two are the foundation the framework is written on,
158
+ and they are the last thing to read rather than the first:
203
159
 
204
- ### Matrix - Sonic Gesture Conversion
160
+ 1. [core-extensions](docs/subsystems/core-extensions.md) — the refinements and
161
+ metaprogramming everything else assumes
162
+ 2. [datasets](docs/subsystems/datasets.md) — read as an extension point: how a
163
+ Hash becomes a musical event, and how to add your own
205
164
 
206
- Convert matrix representations to point sequences for sequencer playback, treating sonic gestures as geometric objects.
165
+ **And one that is not a stage of any of them.**
166
+ [idioms](docs/idioms.md) is for the moment of writing, whichever path brought you
167
+ there: it is organised by the SHAPE of the problem, and each entry names a reflex
168
+ — something a competent programmer writes before asking what MusaDSL calls it.
169
+ The reflex always works, which is the problem: it produces code that runs, sounds
170
+ right, passes every test, and is foreign to the framework. Read it from the
171
+ symptom, when you are about to make the mistake rather than after.
207
172
 
208
- **📖 [Complete Documentation](docs/subsystems/matrix.md)**
173
+ ## Documentation
209
174
 
210
- ### Transcription - MIDI & MusicXML Output
175
+ The subsystem guides linked above are the conceptual documentation: when each
176
+ one is the answer, how to think about it, and the traps. Every Ruby block in
177
+ them is executed by `tools/doc-examples.rb`, and every output they declare is
178
+ compared with what the code actually returns -- so a page that has drifted fails
179
+ the suite rather than misleading a reader.
211
180
 
212
- Convert between representations with ornament expansion for MIDI or preservation as notation symbols for MusicXML.
181
+ The API reference is generated from the inline YARD documentation, whose
182
+ `@example` blocks are held to the same standard:
213
183
 
214
- **📖 [Complete Documentation](docs/subsystems/transcription.md)**
215
-
216
- ### Music - Scales & Chords
217
-
218
- Comprehensive scale and chord systems with equal temperament, custom tunings, chord navigation, and extensible definitions.
219
-
220
- **📖 [Complete Documentation](docs/subsystems/music.md)**
221
-
222
- ### Generative - Algorithmic Composition
223
-
224
- Algorithmic composition tools: Markov chains, Variatio, Rules (L-systems), GenerativeGrammar, and Darwin (genetic algorithms).
225
-
226
- **📖 [Complete Documentation](docs/subsystems/generative.md)**
227
-
228
- ### MusicXML Builder - Music Notation Export
229
-
230
- Comprehensive MusicXML score generation with hierarchical structure, multiple voices, articulations, and dynamics.
231
-
232
- **📖 [Complete Documentation](docs/subsystems/musicxml-builder.md)**
233
-
234
- ### REPL - Live Coding Infrastructure
235
-
236
- TCP-based server for live coding — real-time code evaluation and error handling. Consumed by external REPL clients (editor extensions, custom evaluators).
237
-
238
- **📖 [Complete Documentation](docs/subsystems/repl.md)**
184
+ ```bash
185
+ bundle exec yard doc
186
+ bundle exec yard server
187
+ ```
239
188
 
240
- ### Core Extensions - Advanced Metaprogramming
189
+ Then open http://localhost:8808.
241
190
 
242
- Ruby refinements and metaprogramming utilities: Arrayfy, Hashify, ExplodeRanges, DeepCopy, DynamicProxy, AttributeBuilder, Logger.
191
+ ## Contributing
243
192
 
244
- **📖 [Complete Documentation](docs/subsystems/core-extensions.md)**
193
+ Contributions are welcome. Fork the repository, create a feature branch, make
194
+ your changes with tests, and open a pull request.
245
195
 
246
- ## More from the MusaDSL ecosystem
196
+ **Repository:** https://github.com/javier-sy/musa-dsl
247
197
 
248
- - [MusaDSL](https://musadsl.yeste.studio) — Ruby framework for algorithmic sound and musical composition.
249
- - [MusaLCE](https://musalce.yeste.studio) — live coding environment for Ableton Live and Bitwig Studio.
250
- - [Nota](https://nota.yeste.studio) — Claude Code plugin for AI-assisted MusaDSL composition.
251
- - **Pulso** — Stream Deck plugin for MusaLCE Surface controls *(upcoming)*.
252
- - **VST3 plugins** — collection of audio plugins for mixing and mastering *(upcoming)*.
198
+ ## Examples & Works
253
199
 
254
- For the full map — descriptions, how they relate, which one to pick for what — see [musa-ecosystem.yeste.studio](https://musa-ecosystem.yeste.studio).
200
+ Listen to compositions created with Musa-DSL: [yeste.studio](https://yeste.studio)
255
201
 
256
202
  ## Author
257
203
 
258
- * [Javier Sánchez Yeste](https://github.com/javier-sy)
204
+ * [Javier Sánchez Yeste](https://github.com/javier-sy) -- javier (at) yeste.studio
205
+
206
+ Special thanks to [JetBrains](https://www.jetbrains.com/?from=Musa-DSL) for
207
+ providing an Open Source project license for RubyMine during several years.
259
208
 
260
209
  ## License
261
210
 
data/README.yard.md ADDED
@@ -0,0 +1,37 @@
1
+ # Musa-DSL — API reference
2
+
3
+ A Ruby framework and DSL for algorithmic sound and musical thinking and
4
+ composition. It builds complex temporal structures independently of the audio
5
+ rendering engine: sequencing and transport, lazy series, a text notation
6
+ (neumalang), scales and chords, generative tools, and transcription to MIDI and
7
+ MusicXML.
8
+
9
+ **This page is the API reference** — classes, methods, signatures, and the
10
+ `@example` blocks attached to them. Every one of those examples is executed and
11
+ its declared output compared against what the code actually returns, so what you
12
+ read here has been run.
13
+
14
+ ## The conceptual documentation is not here
15
+
16
+ Knowing a signature is not knowing when to reach for it. The guides that answer
17
+ *when is this the answer, and when is it not* — one per subsystem, plus a
18
+ catalogue of idioms organised by the shape of the problem — live in the
19
+ repository, where their cross-references work:
20
+
21
+ **https://github.com/javier-sy/musa-dsl**
22
+
23
+ They also travel inside the gem itself, under `docs/`, so they are readable
24
+ offline from the installed copy and always match the version you have.
25
+
26
+ ## Installing
27
+
28
+ ```ruby
29
+ gem 'musa-dsl'
30
+ ```
31
+
32
+ Requires Ruby ~> 3.4.
33
+
34
+ ---
35
+
36
+ Copyright (c) 2016-2026 [Javier Sánchez Yeste](https://yeste.studio),
37
+ licensed under LGPL-3.0-or-later.
@@ -1,6 +1,6 @@
1
- # Tutorial: Not So Quick Start
1
+ # Neuma notation
2
2
 
3
- Here's a more detailed example showing the Neuma notation system:
3
+ A more detailed example showing the Neuma notation system:
4
4
 
5
5
  ```ruby
6
6
  require 'musa-dsl'
@@ -20,7 +20,10 @@ decoder = Decoders::NeumaDecoder.new(
20
20
 
21
21
  # Define a melody using neuma notation with duration and velocity
22
22
  # Format: (grade duration velocity)
23
- # Durations: 1/4 = quarter, 1/2 = half, 1 = whole
23
+ # Durations are multiples of base_duration, which here is 1r -- a bar. So the
24
+ # numbers below are fractions of a bar: 1/4 of a bar, 1/2 of a bar, a whole
25
+ # bar. In 4/4 those are a quarter, a half and a whole note; in another meter
26
+ # they are not, because a bar and a whole note are only the same in 4/4.
24
27
  # Velocities: pp, p, mp, mf, f, ff
25
28
  melody = "(0 1/4 p) (+2 1/4 mp) (+2 1/4 mf) (-1 1/2 f) " \
26
29
  "(0 1/4 mf) (+4 1/4 mp) (+5 1/2 f) (+7 1/4 ff) " \
@@ -1,6 +1,6 @@
1
- # Quick Start
1
+ # Sequencer DSL with interacting voices
2
2
 
3
- Here's a complete example showcasing the sequencer DSL with multiple melodic lines that interact with each other:
3
+ A complete example showcasing the sequencer DSL with multiple melodic lines that interact with each other:
4
4
 
5
5
  ```ruby
6
6
  require 'musa-dsl'