Package jazzparser :: Package formalisms :: Package base :: Package semantics :: Module temporal :: Class Temporal
[hide private]
[frames] | no frames]

Class Temporal

source code

object --+
         |
        Temporal
Known Subclasses:

Adds temporal information to a logical form. Logical form classes that want to store temporal information should inherit from the approriate base logical form class and this.

Note that you must inherit from the logical form class as well: just subclassing this may result in horrible things happening. You should also call Temporal's init when initializing subclasses.

Instance Methods [hide private]
 
__init__(self, duration=None, time=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_literal_time_list(self)
Return a list of the time values of only predicates and tonal denotations.
source code
 
get_time_list(self)
Returns a list of the time values of the constituents of the logical form, including non-literal elements if they have times (e.g.
source code
 
get_path_times(self)
Returns a list of times at which each point on the path occurs, only if the semantics represents a list of points, or something that could be converted into one trivially.
source code
 
set_all_times(self, time)
Recursively sets the time property on this and all children that can accept a time value.
source code
 
__get_duration(self) source code
 
__set_duration(self, dur) source code
 
__get_time(self) source code
 
__set_time(self, time) source code
 
set_time(self, time)
Should be overridden by subclasses.
source code
 
simultaneous(self, other)
Checks recursively that two logical forms, assumed equal, have the same timings.
source code

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

Class Variables [hide private]
  timed_object = False
Properties [hide private]
  duration
The duration of this phrase.
  time
The onset time of this phrase.

Inherited from object: __class__

Method Details [hide private]

__init__(self, duration=None, time=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

get_literal_time_list(self)

source code 

Return a list of the time values of only predicates and tonal denotations. The list is strictly in the sequential order of the harmonic movements.

May be overridden by subclasses.

Note: this used to be an abstract method, which subclasses were required to override. Since it is not used much (or at all) in recent formalisms, it is no longer abstract and will default to returning an empty list if not overridden.

get_time_list(self)

source code 

Returns a list of the time values of the constituents of the logical form, including non-literal elements if they have times (e.g. variables).

get_path_times(self)

source code 

Returns a list of times at which each point on the path occurs, only if the semantics represents a list of points, or something that could be converted into one trivially.

Raises:
  • TemporalError - if the LF does not represent a tonal space path.

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.

simultaneous(self, other)

source code 

Checks recursively that two logical forms, assumed equal, have the same timings. Note that it is important that this is only called when self == other, or else bad things might happen.


Property Details [hide private]

duration

The duration of this phrase. Always None for types with timed_object=False.

Get Method:
__get_duration(self)
Set Method:
__set_duration(self, dur)

time

The onset time of this phrase. Always None for types with timed_object=False.

Get Method:
__get_time(self)
Set Method:
__set_time(self, time)