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.
-
#octave ⇒ Object
private
Octave builder/setter.
-
#step ⇒ Object
private
Step builder/setter.
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.
217 |
# File 'lib/musa-dsl/musicxml/builder/pitched-note.rb', line 217 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.
226 |
# File 'lib/musa-dsl/musicxml/builder/pitched-note.rb', line 226 attr_simple_builder :octave |