musa-dsl 0.30.2 → 0.40.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.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.version +6 -0
- data/.yardopts +7 -0
- data/README.md +227 -6
- data/docs/README.md +83 -0
- data/docs/api-reference.md +86 -0
- data/docs/getting-started/quick-start.md +93 -0
- data/docs/getting-started/tutorial.md +58 -0
- data/docs/subsystems/core-extensions.md +316 -0
- data/docs/subsystems/datasets.md +465 -0
- data/docs/subsystems/generative.md +290 -0
- data/docs/subsystems/matrix.md +63 -0
- data/docs/subsystems/midi.md +123 -0
- data/docs/subsystems/music.md +233 -0
- data/docs/subsystems/musicxml-builder.md +264 -0
- data/docs/subsystems/neumas.md +71 -0
- data/docs/subsystems/repl.md +135 -0
- data/docs/subsystems/sequencer.md +98 -0
- data/docs/subsystems/series.md +302 -0
- data/docs/subsystems/transcription.md +152 -0
- data/docs/subsystems/transport.md +177 -0
- data/lib/musa-dsl/core-ext/array-explode-ranges.rb +68 -0
- data/lib/musa-dsl/core-ext/arrayfy.rb +110 -0
- data/lib/musa-dsl/core-ext/attribute-builder.rb +91 -30
- data/lib/musa-dsl/core-ext/deep-copy.rb +125 -2
- data/lib/musa-dsl/core-ext/dynamic-proxy.rb +78 -0
- data/lib/musa-dsl/core-ext/extension.rb +53 -0
- data/lib/musa-dsl/core-ext/hashify.rb +162 -1
- data/lib/musa-dsl/core-ext/inspect-nice.rb +154 -0
- data/lib/musa-dsl/core-ext/smart-proc-binder.rb +117 -0
- data/lib/musa-dsl/core-ext/with.rb +114 -0
- data/lib/musa-dsl/datasets/dataset.rb +109 -0
- data/lib/musa-dsl/datasets/delta-d.rb +78 -0
- data/lib/musa-dsl/datasets/e.rb +186 -2
- data/lib/musa-dsl/datasets/gdv.rb +279 -2
- data/lib/musa-dsl/datasets/gdvd.rb +201 -0
- data/lib/musa-dsl/datasets/helper.rb +75 -0
- data/lib/musa-dsl/datasets/p.rb +177 -2
- data/lib/musa-dsl/datasets/packed-v.rb +91 -0
- data/lib/musa-dsl/datasets/pdv.rb +136 -1
- data/lib/musa-dsl/datasets/ps.rb +134 -4
- data/lib/musa-dsl/datasets/score/queriable.rb +143 -1
- data/lib/musa-dsl/datasets/score/render.rb +105 -1
- data/lib/musa-dsl/datasets/score/to-mxml/process-pdv.rb +138 -1
- data/lib/musa-dsl/datasets/score/to-mxml/process-ps.rb +111 -0
- data/lib/musa-dsl/datasets/score/to-mxml/process-time.rb +200 -1
- data/lib/musa-dsl/datasets/score/to-mxml/to-mxml.rb +145 -1
- data/lib/musa-dsl/datasets/score.rb +279 -0
- data/lib/musa-dsl/datasets/v.rb +88 -0
- data/lib/musa-dsl/generative/darwin.rb +180 -1
- data/lib/musa-dsl/generative/generative-grammar.rb +359 -0
- data/lib/musa-dsl/generative/markov.rb +133 -3
- data/lib/musa-dsl/generative/rules.rb +258 -4
- data/lib/musa-dsl/generative/variatio.rb +217 -2
- data/lib/musa-dsl/logger/logger.rb +267 -2
- data/lib/musa-dsl/matrix/matrix.rb +256 -10
- data/lib/musa-dsl/midi/midi-recorder.rb +108 -1
- data/lib/musa-dsl/midi/midi-voices.rb +265 -4
- data/lib/musa-dsl/music/chord-definition.rb +233 -1
- data/lib/musa-dsl/music/chord-definitions.rb +33 -6
- data/lib/musa-dsl/music/chords.rb +308 -2
- data/lib/musa-dsl/music/equally-tempered-12-tone-scale-system.rb +315 -0
- data/lib/musa-dsl/music/scales.rb +957 -40
- data/lib/musa-dsl/musicxml/builder/attributes.rb +483 -3
- data/lib/musa-dsl/musicxml/builder/backup-forward.rb +166 -1
- data/lib/musa-dsl/musicxml/builder/direction.rb +243 -0
- data/lib/musa-dsl/musicxml/builder/helper.rb +240 -0
- data/lib/musa-dsl/musicxml/builder/measure.rb +284 -0
- data/lib/musa-dsl/musicxml/builder/note-complexities.rb +324 -8
- data/lib/musa-dsl/musicxml/builder/note.rb +285 -0
- data/lib/musa-dsl/musicxml/builder/part-group.rb +108 -1
- data/lib/musa-dsl/musicxml/builder/part.rb +139 -0
- data/lib/musa-dsl/musicxml/builder/pitched-note.rb +124 -0
- data/lib/musa-dsl/musicxml/builder/rest.rb +93 -0
- data/lib/musa-dsl/musicxml/builder/score-partwise.rb +276 -0
- data/lib/musa-dsl/musicxml/builder/typed-text.rb +62 -1
- data/lib/musa-dsl/musicxml/builder/unpitched-note.rb +83 -0
- data/lib/musa-dsl/neumalang/neumalang.rb +675 -0
- data/lib/musa-dsl/neumas/array-to-neumas.rb +149 -0
- data/lib/musa-dsl/neumas/neuma-decoder.rb +253 -0
- data/lib/musa-dsl/neumas/neuma-gdv-decoder.rb +142 -2
- data/lib/musa-dsl/neumas/neuma-gdvd-decoder.rb +82 -0
- data/lib/musa-dsl/neumas/neumas.rb +67 -0
- data/lib/musa-dsl/neumas/string-to-neumas.rb +233 -1
- data/lib/musa-dsl/repl/repl.rb +550 -0
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-every.rb +118 -2
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-move.rb +149 -2
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-play-helper.rb +296 -0
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb +88 -2
- data/lib/musa-dsl/sequencer/base-sequencer-implementation-play.rb +161 -0
- data/lib/musa-dsl/sequencer/base-sequencer-implementation.rb +263 -0
- data/lib/musa-dsl/sequencer/base-sequencer-tick-based.rb +173 -1
- data/lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb +177 -0
- data/lib/musa-dsl/sequencer/base-sequencer.rb +710 -10
- data/lib/musa-dsl/sequencer/sequencer-dsl.rb +210 -0
- data/lib/musa-dsl/sequencer/timeslots.rb +79 -0
- data/lib/musa-dsl/series/array-to-serie.rb +37 -1
- data/lib/musa-dsl/series/base-series.rb +843 -5
- data/lib/musa-dsl/series/buffer-serie.rb +48 -0
- data/lib/musa-dsl/series/hash-or-array-serie-splitter.rb +41 -0
- data/lib/musa-dsl/series/main-serie-constructors.rb +398 -2
- data/lib/musa-dsl/series/main-serie-operations.rb +538 -16
- data/lib/musa-dsl/series/proxy-serie.rb +67 -0
- data/lib/musa-dsl/series/quantizer-serie.rb +45 -7
- data/lib/musa-dsl/series/queue-serie.rb +65 -0
- data/lib/musa-dsl/series/series-composer.rb +701 -0
- data/lib/musa-dsl/series/timed-serie.rb +473 -28
- data/lib/musa-dsl/transcription/from-gdv-to-midi.rb +404 -1
- data/lib/musa-dsl/transcription/from-gdv-to-musicxml.rb +118 -0
- data/lib/musa-dsl/transcription/from-gdv.rb +84 -1
- data/lib/musa-dsl/transcription/transcription.rb +265 -0
- data/lib/musa-dsl/transport/clock.rb +125 -0
- data/lib/musa-dsl/transport/dummy-clock.rb +89 -2
- data/lib/musa-dsl/transport/external-tick-clock.rb +91 -0
- data/lib/musa-dsl/transport/input-midi-clock.rb +133 -1
- data/lib/musa-dsl/transport/timer-clock.rb +183 -1
- data/lib/musa-dsl/transport/timer.rb +83 -0
- data/lib/musa-dsl/transport/transport.rb +318 -0
- data/lib/musa-dsl/version.rb +1 -1
- data/lib/musa-dsl.rb +132 -25
- data/musa-dsl.gemspec +12 -10
- metadata +87 -8
|
@@ -4,7 +4,83 @@ module Musa
|
|
|
4
4
|
module MusicXML
|
|
5
5
|
module Builder
|
|
6
6
|
module Internal
|
|
7
|
+
# Unpitched note for percussion and rhythm-only notation.
|
|
8
|
+
#
|
|
9
|
+
# UnpitchedNote represents notes without specific pitch, primarily used
|
|
10
|
+
# for percussion instruments in drum notation. It extends {Note} with
|
|
11
|
+
# simplified pitch handling—no step, alter, or octave needed.
|
|
12
|
+
#
|
|
13
|
+
# ## Use Cases
|
|
14
|
+
#
|
|
15
|
+
# ### Percussion Notation
|
|
16
|
+
# Drum kits, percussion ensembles, and rhythm sections use unpitched notes
|
|
17
|
+
# where vertical position on the staff indicates the instrument (not pitch):
|
|
18
|
+
#
|
|
19
|
+
# - Snare drum
|
|
20
|
+
# - Bass drum
|
|
21
|
+
# - Hi-hat
|
|
22
|
+
# - Cymbals
|
|
23
|
+
# - Toms
|
|
24
|
+
# - Auxiliary percussion
|
|
25
|
+
#
|
|
26
|
+
# ### Rhythm-Only Notation
|
|
27
|
+
# Teaching materials and rhythm exercises where pitch is irrelevant.
|
|
28
|
+
#
|
|
29
|
+
# ### Tablature
|
|
30
|
+
# Some tablature systems use unpitched notes with fret/string indications.
|
|
31
|
+
#
|
|
32
|
+
# ## Staff Position
|
|
33
|
+
#
|
|
34
|
+
# Unlike pitched notes, staff line position doesn't represent pitch but rather
|
|
35
|
+
# identifies the percussion instrument. This mapping is defined by the clef
|
|
36
|
+
# (typically percussion clef) and is instrument-specific.
|
|
37
|
+
#
|
|
38
|
+
# ## Combining with Technical Markings
|
|
39
|
+
#
|
|
40
|
+
# Unpitched notes support all standard notations (dynamics, articulations, etc.)
|
|
41
|
+
# but often use percussion-specific technicals like sticking patterns.
|
|
42
|
+
#
|
|
43
|
+
# ## Usage
|
|
44
|
+
#
|
|
45
|
+
# Created via Measure#add_unpitched or Measure#unpitched:
|
|
46
|
+
#
|
|
47
|
+
# measure.unpitched duration: 2, type: 'quarter'
|
|
48
|
+
# measure.add_unpitched duration: 1, type: 'eighth', accent: true
|
|
49
|
+
#
|
|
50
|
+
# @example Basic unpitched quarter note
|
|
51
|
+
# UnpitchedNote.new(duration: 2, type: 'quarter')
|
|
52
|
+
#
|
|
53
|
+
# @example Snare drum hit with accent
|
|
54
|
+
# UnpitchedNote.new(duration: 2, type: 'quarter', accent: true)
|
|
55
|
+
#
|
|
56
|
+
# @example Hi-hat with staccato
|
|
57
|
+
# UnpitchedNote.new(duration: 1, type: 'eighth', staccato: true)
|
|
58
|
+
#
|
|
59
|
+
# @example Bass drum with forte dynamic
|
|
60
|
+
# UnpitchedNote.new(duration: 4, type: 'half', dynamics: 'f')
|
|
61
|
+
#
|
|
62
|
+
# @example Cymbal crash with fermata
|
|
63
|
+
# UnpitchedNote.new(duration: 8, type: 'whole', fermata: true)
|
|
64
|
+
#
|
|
65
|
+
# @see Note Base class with all notation attributes
|
|
66
|
+
# @see PitchedNote Pitched notes
|
|
67
|
+
# @see Rest Rests
|
|
68
|
+
# @see Measure Container for adding notes
|
|
7
69
|
class UnpitchedNote < Note
|
|
70
|
+
# Creates an unpitched note.
|
|
71
|
+
#
|
|
72
|
+
# @param (see Note#initialize) All Note parameters are supported
|
|
73
|
+
#
|
|
74
|
+
# @example Percussion quarter note
|
|
75
|
+
# UnpitchedNote.new(duration: 2, type: 'quarter')
|
|
76
|
+
#
|
|
77
|
+
# @example Eighth note with accent
|
|
78
|
+
# UnpitchedNote.new(duration: 1, type: 'eighth', accent: true)
|
|
79
|
+
#
|
|
80
|
+
# @example Dotted half with forte
|
|
81
|
+
# UnpitchedNote.new(duration: 6, type: 'half', dots: 1, dynamics: 'f')
|
|
82
|
+
#
|
|
83
|
+
# For detailed parameter documentation, see {Note#initialize}
|
|
8
84
|
def initialize( pizzicato: nil, # true
|
|
9
85
|
grace: nil, # true
|
|
10
86
|
cue: nil, # true
|
|
@@ -101,6 +177,13 @@ module Musa
|
|
|
101
177
|
|
|
102
178
|
private
|
|
103
179
|
|
|
180
|
+
# Outputs the unpitched XML element.
|
|
181
|
+
#
|
|
182
|
+
# @param io [IO] output stream
|
|
183
|
+
# @param indent [Integer] indentation level
|
|
184
|
+
# @return [void]
|
|
185
|
+
#
|
|
186
|
+
# @api private
|
|
104
187
|
def specific_to_xml(io, indent:)
|
|
105
188
|
tabs = "\t" * indent
|
|
106
189
|
io.puts "#{tabs}<unpitched />"
|