examples/bwv846_prelude.rb in alda-rb-0.2.0 vs examples/bwv846_prelude.rb in alda-rb-0.2.1
- old
+ new
@@ -13,10 +13,10 @@
class Alda::Sequence
def absolute pitch, duration
/(?<letter>[a-g][-+_]*)(?<octave>\d*)/ =~ pitch
octave = @@last_octave ||= '4' if octave.empty?
result = Alda::Note.new "o#{@@last_octave = octave} #{letter}", duration
- @events.push result
+ @events.push result.tap { _1.parent = self }
result
end
end
Alda::Score.new do