class PM::Filter
Filters are blocks of code executed by a Connection
to modify incoming MIDI bytes. Since we want to save them to files, we store the text representation as well.
Attributes
code_chunk[RW]
Public Class Methods
new(code_chunk)
click to toggle source
# File lib/patchmaster/filter.rb, line 10 def initialize(code_chunk) @code_chunk = code_chunk end
Public Instance Methods
call(conn, bytes)
click to toggle source
# File lib/patchmaster/filter.rb, line 14 def call(conn, bytes) @code_chunk.run(conn, bytes) end
to_s()
click to toggle source
# File lib/patchmaster/filter.rb, line 18 def to_s @code_chunk.text || '# no block text found' end