Class: Musa::MusicXML::Builder::Internal::Rest
- Defined in:
- lib/musa-dsl/musicxml/builder/rest.rb
Overview
Rest (silence) with specified duration or full measure.
Rest represents musical silence. It extends Note with rest-specific features, particularly the measure rest attribute for whole-measure silences.
Types of Rests
Regular Rests
Rests with explicit duration and type (whole, half, quarter, eighth, etc.):
Rest.new(duration: 4, type: 'half')
Rest.new(duration: 1, type: 'sixteenth', dots: 1)
Measure Rests
Full-measure rests that automatically fill the entire measure regardless of time signature:
Rest.new(duration: 8, type: 'whole', measure: true)
The measure: true attribute tells notation software to center the rest
and adjust its appearance based on the time signature.
Dotted Rests
Like notes, rests can have augmentation dots:
Rest.new(duration: 3, type: 'quarter', dots: 1) # Dotted quarter
Rest.new(duration: 7, type: 'half', dots: 2) # Double-dotted half
Multi-Voice Rests
In polyphonic music, rests can be assigned to specific voices:
Rest.new(duration: 2, type: 'quarter', voice: 2)
Usage
Created via Measure#add_rest or Measure#rest:
measure.rest duration: 4, type: 'half'
measure.add_rest duration: 8, type: 'whole', measure: true
Instance Method Summary collapse
-
#initialize(pizzicato: nil, measure: nil, grace: nil, cue: nil, chord: nil, duration: nil, tie_start: nil, tie_stop: nil, voice: nil, type: nil, dots: nil, accidental: nil, time_modification: nil, stem: nil, notehead: nil, staff: nil, accidental_mark: nil, arpeggiate: nil, tied: nil, tuplet: nil, dynamics: nil, fermata: nil, glissando: nil, non_arpeggiate: nil, slide: nil, slur: nil, accent: nil, breath_mark: nil, caesura: nil, detached_legato: nil, doit: nil, falloff: nil, other_articulation: nil, plop: nil, scoop: nil, spiccato: nil, staccatissimo: nil, staccato: nil, stress: nil, strong_accent: nil, tenuto: nil, unstress: nil, delayed_inverted_turn: nil, delayed_turn: nil, inverted_mordent: nil, inverted_turn: nil, mordent: nil, schleifer: nil, shake: nil, tremolo: nil, trill_mark: nil, turn: nil, vertical_turn: nil, wavy_line: nil, other_ornament: nil, ornament_accidental_mark: nil, arrow: nil, bend: nil, double_tongue: nil, down_bow: nil, fingering: nil, fingernails: nil, fret: nil, hammer_on: nil, handbell: nil, harmonic: nil, heel: nil, hole: nil, open_string: nil, other_technical: nil, pluck: nil, pull_off: nil, snap_pizzicato: nil, stopped: nil, string: nil, tap: nil, thumb_position: nil, toe: nil, triple_tongue: nil, up_bow: nil, &block) ⇒ Rest
constructor
Creates a rest.
-
#measure ⇒ Object
Measure rest builder/setter.
Constructor Details
#initialize(pizzicato: nil, measure: nil, grace: nil, cue: nil, chord: nil, duration: nil, tie_start: nil, tie_stop: nil, voice: nil, type: nil, dots: nil, accidental: nil, time_modification: nil, stem: nil, notehead: nil, staff: nil, accidental_mark: nil, arpeggiate: nil, tied: nil, tuplet: nil, dynamics: nil, fermata: nil, glissando: nil, non_arpeggiate: nil, slide: nil, slur: nil, accent: nil, breath_mark: nil, caesura: nil, detached_legato: nil, doit: nil, falloff: nil, other_articulation: nil, plop: nil, scoop: nil, spiccato: nil, staccatissimo: nil, staccato: nil, stress: nil, strong_accent: nil, tenuto: nil, unstress: nil, delayed_inverted_turn: nil, delayed_turn: nil, inverted_mordent: nil, inverted_turn: nil, mordent: nil, schleifer: nil, shake: nil, tremolo: nil, trill_mark: nil, turn: nil, vertical_turn: nil, wavy_line: nil, other_ornament: nil, ornament_accidental_mark: nil, arrow: nil, bend: nil, double_tongue: nil, down_bow: nil, fingering: nil, fingernails: nil, fret: nil, hammer_on: nil, handbell: nil, harmonic: nil, heel: nil, hole: nil, open_string: nil, other_technical: nil, pluck: nil, pull_off: nil, snap_pizzicato: nil, stopped: nil, string: nil, tap: nil, thumb_position: nil, toe: nil, triple_tongue: nil, up_bow: nil, &block) ⇒ Rest
Creates a rest.
For detailed parameter documentation, see Note#initialize
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/musa-dsl/musicxml/builder/rest.rb', line 84 def initialize(pizzicato: nil, measure: nil, grace: nil, cue: nil, chord: nil, duration: nil, tie_start: nil, tie_stop: nil, voice: nil, type: nil, dots: nil, accidental: nil, time_modification: nil, stem: nil, notehead: nil, staff: nil, accidental_mark: nil, arpeggiate: nil, tied: nil, tuplet: nil, dynamics: nil, fermata: nil, glissando: nil, non_arpeggiate: nil, slide: nil, slur: nil, accent: nil, breath_mark: nil, caesura: nil, detached_legato: nil, doit: nil, falloff: nil, other_articulation: nil, plop: nil, scoop: nil, spiccato: nil, staccatissimo: nil, staccato: nil, stress: nil, strong_accent: nil, tenuto: nil, unstress: nil, delayed_inverted_turn: nil, delayed_turn: nil, inverted_mordent: nil, inverted_turn: nil, mordent: nil, schleifer: nil, shake: nil, tremolo: nil, trill_mark: nil, turn: nil, vertical_turn: nil, wavy_line: nil, other_ornament: nil, ornament_accidental_mark: nil, arrow: nil, bend: nil, double_tongue: nil, down_bow: nil, fingering: nil, fingernails: nil, fret: nil, hammer_on: nil, handbell: nil, harmonic: nil, heel: nil, hole: nil, open_string: nil, other_technical: nil, pluck: nil, pull_off: nil, snap_pizzicato: nil, stopped: nil, string: nil, tap: nil, thumb_position: nil, toe: nil, triple_tongue: nil, up_bow: nil, &block) @measure = measure super end |