Class GameListener
In: lib/bangkok/gamelistener.rb
Parent: Object

The pieces and board call methods on an instance of GameListener, which turns those events into MIDI events.

Methods

Constants

PIECE_NAMES = { :P => "Pawn", :R => "Rook", :N => "Night", :B => "Bishop", :Q => "Queen", :K => "King"
RANK_TO_NOTE = {}   Build notes to play for ranks
PIECE_MIDI_INFO = {}

Attributes

seq  [R] 

Public Class methods

Used by config files to set the program change value for a piece.

Used by config files to set the program change value for a piece.

Public Instance methods

==========================================================

End of listener interface

==========================================================

++

Translates a (possibly fractional) file into an integer CC_PAN value.

Generate two notes, one at the current start time that is only a 32nd note long. The next follows immediately, and is for the to square. Its length is the remaining time.

Generates a single pan event. move_to calls this multiple times, passing in new delta and value values.

Generates a single portamento event.

Generates a single volume event. move_to calls this multiple times, passing in new delta and value values.

Returns a value between range_min and range_max inclusive that is proportional to value’s place between value_min and value_max. The returned value may be floating point. If range_min and range_max or value_min and value_max are out of order, they are swapped.

Move piece from one space to another. Generate two notes and sets CC_PORTAMENTO_TIME so there is a glide from the first note to the second. Also output multiple volume and pan values, moving smoothly from the original to the new value.

Translates a (possibly fractional) rank into an integer CC_VOLUME value.

==========================================================

Listener interface

==========================================================

++

[Validate]