Package jazzparser :: Package formalisms :: Package music_halfspan :: Package semantics :: Class LexicalCoordinate
[hide private]
[frames] | no frames]

Class LexicalCoordinate

source code

                           object --+        
                                    |        
base.semantics.lambdacalc.LogicalForm --+    
                                        |    
       base.semantics.lambdacalc.Terminal --+
                                            |
                               object --+   |
                                        |   |
         base.semantics.temporal.Temporal --+
                                            |
                                           LexicalCoordinate

When a logical form is read in from the lexicon, coordinates must be specified relative to the root of the chord. Only when the sign is used as the interpretation of a chord will this root be known. In the meantime, we store a coordinate (0,0) <= (cx,cy) <= (4,3) that specifies the position of the point relative to the (equal temperament) position (x,y) of the chord root. Once this is known, an EnharmonicCoordinate will be produced at ((x+cx)%4, (y+cy)%3).

Instance Methods [hide private]
 
__init__(self, coord=(0, 0), time=None, duration=None, *args, **kwargs)
Builds a basic logical form object.
source code
 
__str__(self)
str(x)
source code
 
format_result(self) source code
 
get_start_time(self) source code
 
harmonic_str(self)
Same as __str__.
source code
 
__eq__(self, other)
This should be overridden by subclasses.
source code
 
set_time(self, time)
Should be overridden by subclasses.
source code
 
resolve(self, coord=(0, 0))
Produces the actual EnharmonicCoordinate, given the 2D position of the chord root.
source code
 
copy(self)
This should be overridden by subclasses.
source code

Inherited from base.semantics.lambdacalc.Terminal: alpha_convert, alpha_equivalent, beta_reduce, get_bound_variables, get_children, get_variables, replace_immediate_constituent, substitute

Inherited from base.semantics.lambdacalc.LogicalForm: __ne__, __repr__, get_ancestor_bound_variables, get_instances, get_unbound_variables, replace_in_parent

Inherited from base.semantics.temporal.Temporal: get_literal_time_list, get_path_times, get_time_list, set_all_times, simultaneous

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  timed_object = True
Properties [hide private]

Inherited from base.semantics.temporal.Temporal: duration, time

Inherited from object: __class__

Method Details [hide private]

__init__(self, coord=(0, 0), time=None, duration=None, *args, **kwargs)
(Constructor)

source code 

Builds a basic logical form object.

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

harmonic_str(self)

source code 

Same as __str__. Only here for compatibility with EnharmonicCoordinate.

__eq__(self, other)
(Equality operator)

source code 

This should be overridden by subclasses.

Overrides: base.semantics.lambdacalc.LogicalForm.__eq__
(inherited documentation)

set_time(self, time)

source code 

Should be overridden by subclasses.

Sets the start time of this logical form. This is different to just setting the time property: using set_time() may pass the time property down to its children if that is appropriate for the semantic type.

It is also distinct from set_all_times(), which recursively sets the time on all children.

This must be provided by all subclasses.

Overrides: base.semantics.temporal.Temporal.set_time
(inherited documentation)

copy(self)

source code 

This should be overridden by subclasses.

Overrides: base.semantics.lambdacalc.LogicalForm.copy
(inherited documentation)