musa-dsl 0.43.1 → 0.49.1

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.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -2
  3. data/README.md +99 -138
  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/guides/project-structure.md +273 -0
  8. data/docs/idioms.md +332 -0
  9. data/docs/subsystems/core-extensions.md +147 -129
  10. data/docs/subsystems/datasets.md +131 -39
  11. data/docs/subsystems/generative.md +58 -167
  12. data/docs/subsystems/matrix.md +41 -9
  13. data/docs/subsystems/midi.md +76 -4
  14. data/docs/subsystems/music.md +105 -26
  15. data/docs/subsystems/musicxml-builder.md +91 -30
  16. data/docs/subsystems/neumas.md +159 -37
  17. data/docs/subsystems/repl.md +42 -32
  18. data/docs/subsystems/sequencer.md +293 -110
  19. data/docs/subsystems/series.md +128 -25
  20. data/docs/subsystems/transcription.md +25 -3
  21. data/docs/subsystems/transport.md +96 -19
  22. data/docs/vocabulary.md +62 -0
  23. data/lib/musa-dsl/core-ext/arrayfy.rb +5 -1
  24. data/lib/musa-dsl/core-ext/attribute-builder.rb +7 -4
  25. data/lib/musa-dsl/core-ext/deep-copy.rb +81 -24
  26. data/lib/musa-dsl/core-ext/dynamic-proxy.rb +4 -4
  27. data/lib/musa-dsl/core-ext/hashify.rb +9 -2
  28. data/lib/musa-dsl/core-ext/inspect-nice.rb +1 -1
  29. data/lib/musa-dsl/core-ext/smart-proc-binder.rb +26 -10
  30. data/lib/musa-dsl/core-ext/with.rb +25 -12
  31. data/lib/musa-dsl/datasets/dataset.rb +17 -9
  32. data/lib/musa-dsl/datasets/delta-d.rb +11 -11
  33. data/lib/musa-dsl/datasets/e.rb +72 -21
  34. data/lib/musa-dsl/datasets/gdv.rb +119 -87
  35. data/lib/musa-dsl/datasets/gdvd.rb +62 -26
  36. data/lib/musa-dsl/datasets/helper.rb +40 -10
  37. data/lib/musa-dsl/datasets/p.rb +60 -24
  38. data/lib/musa-dsl/datasets/pdv.rb +90 -19
  39. data/lib/musa-dsl/datasets/ps.rb +10 -5
  40. data/lib/musa-dsl/datasets/score/queriable.rb +55 -20
  41. data/lib/musa-dsl/datasets/score/render.rb +22 -5
  42. data/lib/musa-dsl/datasets/score/to-mxml/process-pdv.rb +287 -263
  43. data/lib/musa-dsl/datasets/score/to-mxml/process-ps.rb +139 -128
  44. data/lib/musa-dsl/datasets/score/to-mxml/process-time.rb +342 -324
  45. data/lib/musa-dsl/datasets/score/to-mxml/to-mxml.rb +61 -10
  46. data/lib/musa-dsl/datasets/score.rb +99 -30
  47. data/lib/musa-dsl/generative/darwin.rb +35 -28
  48. data/lib/musa-dsl/generative/generative-grammar.rb +49 -17
  49. data/lib/musa-dsl/generative/markov.rb +49 -9
  50. data/lib/musa-dsl/generative/variatio.rb +26 -6
  51. data/lib/musa-dsl/generative.rb +0 -1
  52. data/lib/musa-dsl/logger/logger.rb +42 -16
  53. data/lib/musa-dsl/matrix/matrix.rb +49 -20
  54. data/lib/musa-dsl/midi/midi-recorder.rb +31 -12
  55. data/lib/musa-dsl/midi/midi-voices.rb +204 -20
  56. data/lib/musa-dsl/music/chord-definition.rb +63 -25
  57. data/lib/musa-dsl/music/chords.rb +107 -30
  58. data/lib/musa-dsl/music/scale_kinds/chromatic_scale_kind.rb +6 -6
  59. data/lib/musa-dsl/music/scale_kinds/major_scale_kind.rb +9 -6
  60. data/lib/musa-dsl/music/scale_kinds/minor_harmonic_scale_kind.rb +10 -5
  61. data/lib/musa-dsl/music/scale_kinds/minor_natural_scale_kind.rb +9 -6
  62. data/lib/musa-dsl/music/scale_systems/equally_tempered_12_tone_scale_system.rb +3 -3
  63. data/lib/musa-dsl/music/scale_systems/twelve_semitones_scale_system.rb +2 -2
  64. data/lib/musa-dsl/music/scales.rb +265 -88
  65. data/lib/musa-dsl/musicxml/builder/attributes.rb +134 -55
  66. data/lib/musa-dsl/musicxml/builder/backup-forward.rb +26 -0
  67. data/lib/musa-dsl/musicxml/builder/direction.rb +41 -21
  68. data/lib/musa-dsl/musicxml/builder/helper.rb +7 -4
  69. data/lib/musa-dsl/musicxml/builder/measure.rb +31 -3
  70. data/lib/musa-dsl/musicxml/builder/note-complexities.rb +14 -7
  71. data/lib/musa-dsl/musicxml/builder/part-group.rb +11 -1
  72. data/lib/musa-dsl/musicxml/builder/part.rb +14 -0
  73. data/lib/musa-dsl/musicxml/builder/pitched-note.rb +11 -3
  74. data/lib/musa-dsl/musicxml/builder/rest.rb +6 -3
  75. data/lib/musa-dsl/musicxml/builder/score-partwise.rb +22 -1
  76. data/lib/musa-dsl/musicxml/builder/typed-text.rb +8 -6
  77. data/lib/musa-dsl/musicxml/builder/unpitched-note.rb +4 -2
  78. data/lib/musa-dsl/neumalang/neumalang.rb +43 -16
  79. data/lib/musa-dsl/neumas/array-to-neumas.rb +36 -18
  80. data/lib/musa-dsl/neumas/neuma-decoder.rb +3 -3
  81. data/lib/musa-dsl/neumas/neuma-gdv-decoder.rb +16 -2
  82. data/lib/musa-dsl/neumas/neuma-gdvd-decoder.rb +19 -14
  83. data/lib/musa-dsl/neumas/neumas.rb +25 -17
  84. data/lib/musa-dsl/neumas/string-to-neumas.rb +89 -18
  85. data/lib/musa-dsl/repl/repl.rb +100 -91
  86. data/lib/musa-dsl/sequencer/base-sequencer-implementation-every.rb +22 -4
  87. data/lib/musa-dsl/sequencer/base-sequencer-implementation-move.rb +4 -0
  88. data/lib/musa-dsl/sequencer/base-sequencer-implementation-play-helper.rb +62 -35
  89. data/lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb +8 -1
  90. data/lib/musa-dsl/sequencer/base-sequencer-implementation-play.rb +95 -18
  91. data/lib/musa-dsl/sequencer/base-sequencer-implementation.rb +39 -7
  92. data/lib/musa-dsl/sequencer/base-sequencer-tick-based.rb +50 -14
  93. data/lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb +84 -24
  94. data/lib/musa-dsl/sequencer/base-sequencer.rb +159 -39
  95. data/lib/musa-dsl/sequencer/sequencer-dsl.rb +39 -7
  96. data/lib/musa-dsl/series/array-to-serie.rb +15 -5
  97. data/lib/musa-dsl/series/base-series.rb +97 -14
  98. data/lib/musa-dsl/series/buffer-serie.rb +6 -0
  99. data/lib/musa-dsl/series/main-serie-constructors.rb +233 -69
  100. data/lib/musa-dsl/series/main-serie-operations.rb +163 -52
  101. data/lib/musa-dsl/series/proxy-serie.rb +157 -13
  102. data/lib/musa-dsl/series/quantizer-serie.rb +44 -4
  103. data/lib/musa-dsl/series/queue-serie.rb +33 -8
  104. data/lib/musa-dsl/series/series-composer.rb +94 -40
  105. data/lib/musa-dsl/series/timed-serie.rb +1 -1
  106. data/lib/musa-dsl/transcription/from-gdv-to-midi.rb +117 -12
  107. data/lib/musa-dsl/transcription/from-gdv-to-musicxml.rb +7 -0
  108. data/lib/musa-dsl/transcription/from-gdv.rb +1 -1
  109. data/lib/musa-dsl/transcription/transcription.rb +23 -11
  110. data/lib/musa-dsl/transport/clock.rb +8 -3
  111. data/lib/musa-dsl/transport/dummy-clock.rb +46 -9
  112. data/lib/musa-dsl/transport/external-tick-clock.rb +30 -23
  113. data/lib/musa-dsl/transport/input-midi-clock.rb +22 -15
  114. data/lib/musa-dsl/transport/timer-clock.rb +40 -6
  115. data/lib/musa-dsl/transport/timer.rb +6 -4
  116. data/lib/musa-dsl/transport/transport.rb +80 -36
  117. data/lib/musa-dsl/version.rb +1 -1
  118. data/lib/musa-dsl.rb +9 -6
  119. data/tools/doc-examples.rb +744 -0
  120. data/tools/vocabulary.rb +239 -0
  121. metadata +9 -6
  122. data/docs/README.md +0 -84
  123. data/docs/api-reference.md +0 -86
  124. 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: b8f19ea8b2adc69b0337938f0db645b11ec6b021781b163f9d9d49bcc95470aa
4
+ data.tar.gz: 1fd764ad354f2eba388fb2c74e2689919d4729dd875dfc27f75f4aff7bb1a261
5
5
  SHA512:
6
- metadata.gz: 61b3eb793d334844822636e2d8597c86dee2f353170d215328bf6dfc1be4aa24fdbe96c830584de377d99472d2259ef75a804f3c564fa5785f2430a14c1805a2
7
- data.tar.gz: 7616c2dd4e24bf46714a64d48690d81989fa8ed41d99972f7c0aa2164607c8e72bf7fcd57b20963eed38d56420e889cd3421135d79df11d35464f2b2b1637005
6
+ metadata.gz: f7d6453e9842589676863769ecc0c4da051d2d1df76e53e5f65ed301465aa8a3eacb80706f8adb0cc4307bd12a8b889309276916e9e1192299cd3ace3cb9db08
7
+ data.tar.gz: a5dd8a6f58085d18c4b572613fe688554bc21553fbf21b730dc118b2edabc92ca09736260655039908a1b42ed60fd477cb56e4fb6f43a0874184c4573d1c46e4
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,131 @@ 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
95
+ ## MusaDSL Architecture
168
96
 
169
- Polyphonic voice management for MIDI output with automatic note tracking, and MIDI input recording with precise timestamping.
97
+ The musa-dsl framework is organized in modular layers. Each component has its own detailed documentation.
170
98
 
171
- **📖 [Complete Documentation](docs/subsystems/midi.md)**
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.
172
102
 
173
- ### Sequencer - Temporal Engine
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.
174
106
 
175
- Event scheduling engine with musical time (bars/beats), precise tick-based timing, and DSL for temporal composition.
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.
176
109
 
177
- **📖 [Complete Documentation](docs/subsystems/sequencer.md)**
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.
178
114
 
179
- ### Transport - Timing & Clocks
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.
180
119
 
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.
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.
182
123
 
183
- **📖 [Complete Transport Documentation](docs/subsystems/transport.md)**
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).
184
126
 
127
+ ## Where to start
185
128
 
186
- ### Series - Sequence Generators
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:
187
131
 
188
- Lazy functional sequence generators with map/filter operations, numeric generators, buffering, quantization, and timed merging.
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:
189
135
 
190
- **📖 [Complete Documentation](docs/subsystems/series.md)**
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
191
140
 
192
- ### Neumas & Neumalang - Musical Notation
141
+ **Want to compose?**
193
142
 
194
- Compact text-based musical notation system with parser for converting notation to structured musical data.
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
195
149
 
196
- **📖 [Complete Documentation](docs/subsystems/neumas.md)**
150
+ **Live coding?**
197
151
 
198
- ### Datasets - Sonic Data Structures
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
199
156
 
200
- Type-safe musical event representations (GDV, PDV, PS, P, V) with conversions, validation, Score container, and advanced queries.
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:
201
159
 
202
- **📖 [Complete Documentation](docs/subsystems/datasets.md)**
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
203
164
 
204
- ### Matrix - Sonic Gesture Conversion
165
+ **Writing a whole piece rather than a snippet?**
166
+ [project structure](docs/guides/project-structure.md) is how a musa-dsl project is
167
+ laid out — the split between infrastructure and score, reaching one from the
168
+ other, stopping cleanly, and shaping form as events rather than as absolute
169
+ positions. Conventions, not API: none of it is enforced, and all of it follows
170
+ from something that is.
205
171
 
206
- Convert matrix representations to point sequences for sequencer playback, treating sonic gestures as geometric objects.
172
+ **Looking for a name you half remember?** [vocabulary](docs/vocabulary.md) is
173
+ every name the guides above teach, on one page, by subsystem. It answers *what is
174
+ there* — the one question you cannot look up — and it is generated from the
175
+ published API and the guides themselves, so it cannot drift from either.
207
176
 
208
- **📖 [Complete Documentation](docs/subsystems/matrix.md)**
177
+ **And one that is not a stage of any of them.**
178
+ [idioms](docs/idioms.md) is for the moment of writing, whichever path brought you
179
+ there: it is organised by the SHAPE of the problem, and each entry names a reflex
180
+ — something a competent programmer writes before asking what MusaDSL calls it.
181
+ The reflex always works, which is the problem: it produces code that runs, sounds
182
+ right, passes every test, and is foreign to the framework. Read it from the
183
+ symptom, when you are about to make the mistake rather than after.
209
184
 
210
- ### Transcription - MIDI & MusicXML Output
185
+ ## Documentation
211
186
 
212
- Convert between representations with ornament expansion for MIDI or preservation as notation symbols for MusicXML.
187
+ The subsystem guides linked above are the conceptual documentation: when each
188
+ one is the answer, how to think about it, and the traps. Every Ruby block in
189
+ them is executed by `tools/doc-examples.rb`, and every output they declare is
190
+ compared with what the code actually returns -- so a page that has drifted fails
191
+ the suite rather than misleading a reader.
213
192
 
214
- **📖 [Complete Documentation](docs/subsystems/transcription.md)**
193
+ The API reference is generated from the inline YARD documentation, whose
194
+ `@example` blocks are held to the same standard:
215
195
 
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)**
196
+ ```bash
197
+ bundle exec yard doc
198
+ bundle exec yard server
199
+ ```
239
200
 
240
- ### Core Extensions - Advanced Metaprogramming
201
+ Then open http://localhost:8808.
241
202
 
242
- Ruby refinements and metaprogramming utilities: Arrayfy, Hashify, ExplodeRanges, DeepCopy, DynamicProxy, AttributeBuilder, Logger.
203
+ ## Contributing
243
204
 
244
- **📖 [Complete Documentation](docs/subsystems/core-extensions.md)**
205
+ Contributions are welcome. Fork the repository, create a feature branch, make
206
+ your changes with tests, and open a pull request.
245
207
 
246
- ## More from the MusaDSL ecosystem
208
+ **Repository:** https://github.com/javier-sy/musa-dsl
247
209
 
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)*.
210
+ ## Examples & Works
253
211
 
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).
212
+ Listen to compositions created with Musa-DSL: [yeste.studio](https://yeste.studio)
255
213
 
256
214
  ## Author
257
215
 
258
- * [Javier Sánchez Yeste](https://github.com/javier-sy)
216
+ * [Javier Sánchez Yeste](https://github.com/javier-sy) -- javier (at) yeste.studio
217
+
218
+ Special thanks to [JetBrains](https://www.jetbrains.com/?from=Musa-DSL) for
219
+ providing an Open Source project license for RubyMine during several years.
259
220
 
260
221
  ## License
261
222
 
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'