Class: Musa::MusicXML::Builder::Internal::PitchedNote Private
- Defined in:
- lib/musa-dsl/musicxml/builder/pitched-note.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Pitched note with specific step, octave, and optional alteration.
PitchedNote represents notes with defined pitches (as opposed to rests or unpitched percussion). It extends Note with pitch information: step (C-G), octave (scientific pitch notation), and optional chromatic alteration.
Pitch Components
Step
The diatonic pitch class: 'C', 'D', 'E', 'F', 'G', 'A', 'B'
Octave
Scientific pitch notation (middle C = C4):
- Octave 0: C0 to B0 (subcontra octave)
- Octave 4: C4 to B4 (one-line octave, middle C)
- Octave 8: C8 to B8 (five-line octave)
Alter
Chromatic alteration in semitones:
- -2: Double flat
- -1: Flat
- 0: Natural (can be omitted)
- +1: Sharp
- +2: Double sharp
Accidentals
The alter parameter changes the sounding pitch, while the accidental
parameter controls visual display:
- alter: Affects playback (actual pitch)
- accidental: Visual symbol (sharp, flat, natural, etc.)
Usually both are specified together, but you can have:
- alter without accidental (implied by key signature)
- accidental without alter (cautionary accidental)
Usage
Created via Measure#add_pitch or Measure#pitch:
measure.pitch 'C', octave: 5, duration: 4, type: 'quarter'
measure.add_pitch step: 'F', alter: 1, octave: 4, duration: 2, type: 'eighth'
Instance Method Summary collapse
-
#alter ⇒ Object
private
Alter builder/setter.
-
#initialize(positional_step = nil, step: nil, alter: nil, octave:, pizzicato: 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) ⇒ PitchedNote
constructor
private
Creates a pitched note.
-
#octave ⇒ Object
private
Octave builder/setter.
-
#step ⇒ Object
private
Step builder/setter.
Constructor Details
#initialize(positional_step = nil, step: nil, alter: nil, octave:, pizzicato: 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) ⇒ PitchedNote
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a pitched note.
For detailed parameter documentation, see Note#initialize
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/musa-dsl/musicxml/builder/pitched-note.rb', line 101 def initialize(positional_step = nil, step: nil, alter: nil, octave:, pizzicato: 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) @step = step || positional_step @alter = alter @octave = octave super end |
Instance Method Details
#alter(value) ⇒ Object #alter=(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Alter builder/setter.
156 |
# File 'lib/musa-dsl/musicxml/builder/pitched-note.rb', line 156 attr_simple_builder :alter |
#octave(value) ⇒ Object #octave=(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Octave builder/setter.
165 |
# File 'lib/musa-dsl/musicxml/builder/pitched-note.rb', line 165 attr_simple_builder :octave |