# Path: consort/tools/HashCachingObject.py
# class HashCachingObject(abctools.AbjadValueObject):
# 
#     ### CLASS VARIABLES ###
# 
#     __slots__ = (
#         '_format',
#         '_hash',
#         )
# 
#     ### INITIALIZER ###
# 
#     def __init__(self):
#         self._format = None
#         self._hash = None
# 
#     ### SPECIAL METHODS ###
# 
#     #@profile
#     def __eq__(self, expr):
#         if isinstance(expr, type(self)):
#             if format(self) == format(expr):
#                 return True
#         return False
# 
#     #@profile
#     def __format__(self, format_specification=''):
#         if self._format is None:
#             agent = systemtools.StorageFormatAgent(self)
#             self._format = agent.get_storage_format()
#         return self._format
# 
#     #@profile
#     def __hash__(self):
#         if self._hash is None:
#             self._hash = hash((type(self), format(self)))
#         return self._hash


import abc
import abjad
import collections
        import consort
        import consort
        import consort
        import consort
        import consort
        import consort
        import consort
        import consort
from abjad.tools import instrumenttools
from abjad.tools import indicatortools
from abjad.tools import pitchtools
from consort.tools.HashCachingObject import HashCachingObject
            pitch_range = instrument.pitch_range
        return pitch_range

    @staticmethod
    def _get_previous_pitch(
        music_specifier,
        previous_pitch_by_music_specifier,
        voice,
        ):
        key = (voice, music_specifier)
        if key not in previous_pitch_by_music_specifier:
            previous_pitch_by_music_specifier[key] = None
        previous_pitch = previous_pitch_by_music_specifier[key]
        return previous_pitch

    @staticmethod
    def _get_pitch_seed(
        attack_point_signature,
        music_specifier,
        pitch_application_rate,
        pitch_seeds_by_music_specifier,
        pitch_seeds_by_voice,
        voice,
        ):
        if music_specifier not in pitch_seeds_by_music_specifier:
            seed = (music_specifier.seed or 0) - 1
            pitch_seeds_by_music_specifier[music_specifier] = seed
            pitch_seeds_by_voice[voice] = seed
        if pitch_application_rate == 'phrase':
            if attack_point_signature.is_first_of_phrase:

# Path: consort/tools/HashCachingObject.py
# class HashCachingObject(abctools.AbjadValueObject):
# 
#     ### CLASS VARIABLES ###
# 
#     __slots__ = (
#         '_format',
#         '_hash',
#         )
# 
#     ### INITIALIZER ###
# 
#     def __init__(self):
#         self._format = None
#         self._hash = None
# 
#     ### SPECIAL METHODS ###
# 
#     #@profile
#     def __eq__(self, expr):
#         if isinstance(expr, type(self)):
#             if format(self) == format(expr):
#                 return True
#         return False
# 
#     #@profile
#     def __format__(self, format_specification=''):
#         if self._format is None:
#             agent = systemtools.StorageFormatAgent(self)
#             self._format = agent.get_storage_format()
#         return self._format
# 
#     #@profile
#     def __hash__(self):
#         if self._hash is None:
#             self._hash = hash((type(self), format(self)))
#         return self._hash


# Path: consort/tools/PitchHandler.py
import abc
import abjad
import collections
        import consort
        import consort
        import consort
        import consort
        import consort
        import consort
        import consort
        import consort
from abjad.tools import instrumenttools
from abjad.tools import indicatortools
from abjad.tools import pitchtools
from consort.tools.HashCachingObject import HashCachingObject

            pitch_range = instrument.pitch_range
        return pitch_range

    @staticmethod
    def _get_previous_pitch(
        music_specifier,
        previous_pitch_by_music_specifier,
        voice,
        ):
        key = (voice, music_specifier)
        if key not in previous_pitch_by_music_specifier:
            previous_pitch_by_music_specifier[key] = None
        previous_pitch = previous_pitch_by_music_specifier[key]
        return previous_pitch

    @staticmethod
    def _get_pitch_seed(
        attack_point_signature,
        music_specifier,
        pitch_application_rate,
        pitch_seeds_by_music_specifier,
        pitch_seeds_by_voice,
        voice,
        ):
        if music_specifier not in pitch_seeds_by_music_specifier:
            seed = (music_specifier.seed or 0) - 1
            pitch_seeds_by_music_specifier[music_specifier] = seed
            pitch_seeds_by_voice[voice] = seed
        if pitch_application_rate == 'phrase':
            if attack_point_signature.is_first_of_phrase:

                pitch_seeds_by_music_specifier[music_specifier] += 1