Class: SMF::VirtualTrack
Instance Method Summary collapse
-
#initialize ⇒ VirtualTrack
constructor
A new instance of VirtualTrack.
- #to_real ⇒ Object
Methods inherited from Track
#&, #*, #+, #-, #<<, #==, #>>, #concat!, #divert, #each, #eql?, #hash, #nevts, #nitems, #replace, #sort, #sort!, #sort_by, #to_virtual, #|
Constructor Details
#initialize ⇒ VirtualTrack
Returns a new instance of VirtualTrack.
88 89 90 |
# File 'lib/smf/toy/virtual.rb', line 88 def initialize() super() end |
Instance Method Details
#to_real ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/smf/toy/virtual.rb', line 92 def to_real r = Track.new each do |ev| case ev when VirtualNote r << NoteOn.new(ev.offset, ev.ch, ev.note, ev.vel) r << NoteOff.new(ev.offset + ev.length, ev.ch, ev.note, ev.offvel) else r << ev end end r end |