Class: HeadMusic::Time::TempoEvent
- Inherits:
-
Object
- Object
- HeadMusic::Time::TempoEvent
- Defined in:
- lib/head_music/time/tempo_event.rb
Overview
Represents a tempo change at a specific musical position
TempoEvent marks a point in a musical timeline where the tempo changes. This is essential for converting between clock time and musical position, as different tempos affect how long each beat takes in real time.
Instance Attribute Summary collapse
-
#position ⇒ MusicalPosition
The position where this tempo change occurs.
-
#tempo ⇒ HeadMusic::Rudiment::Tempo
The tempo.
Instance Method Summary collapse
-
#initialize(position, beat_value, beats_per_minute) ⇒ TempoEvent
constructor
Create a new tempo change event.
Constructor Details
#initialize(position, beat_value, beats_per_minute) ⇒ TempoEvent
Create a new tempo change event
34 35 36 37 |
# File 'lib/head_music/time/tempo_event.rb', line 34 def initialize(position, beat_value, beats_per_minute) @position = position @tempo = HeadMusic::Rudiment::Tempo.new(beat_value, beats_per_minute) end |
Instance Attribute Details
#position ⇒ MusicalPosition
Returns the position where this tempo change occurs.
24 25 26 |
# File 'lib/head_music/time/tempo_event.rb', line 24 def position @position end |
#tempo ⇒ HeadMusic::Rudiment::Tempo
Returns the tempo.
27 28 29 |
# File 'lib/head_music/time/tempo_event.rb', line 27 def tempo @tempo end |