Example #1
0
 def _selectLevelMonophonicParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'event' : ['e'],
         'set' : ['s'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #2
0
 def _typeFormatParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'stringQuote' : ['sq',],
         'string'          : ['str', 's'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #3
0
 def _typeFormatParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'stringQuote' : ['sq',],
         'string'          : ['str', 's'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError('bad control value: enter %s.' % selStr)
     return usrStr
Example #4
0
 def _selectLevelEventCountParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'texture' : ['t', 'text', 'texture'],
         'segment' : ['s', 'seg', 'segment'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #5
0
 def _selectLevelMonophonicParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'event': ['e'],
         'set': ['s'],
     }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #6
0
 def _selectDensityPartitionParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'duration' : ['d', 'dur'],
         'set' : ['s'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #7
0
 def _selectRetrogradeParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'off' : ['off', '0'],
         'timeInverse' : ['ti', 'tinvers'],
         'eventInverse' : ['ei', 'retro'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #8
0
 def _selectRetrogradeParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'off': ['off', '0'],
         'timeInverse': ['ti', 'tinvers'],
         'eventInverse': ['ei', 'retro'],
     }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #9
0
 def _interpolationMethodControlParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'linear' : ['l'],
         'halfCosine' : ['h', 'c', 'hc'],
         'power' : ['p', 'e', 'exp'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #10
0
 def _sieveFormatParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'integer' : ['i', 'int'],
         'width' : ['w', 'wid'],
         'binary' : ['b', 'bin'],
         'unit' : ['u', 'uni'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr        
Example #11
0
 def _sieveFormatParser(self, usrStr):
     "decode control choice strings"
     ref = {
         'integer': ['i', 'int'],
         'width': ['w', 'wid'],
         'binary': ['b', 'bin'],
         'unit': ['u', 'uni'],
     }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #12
0
 def _selectLevelFrameParser(self, usrStr):
     """
     >>> a = Parameter([])
     >>> a._selectLevelFrameParser('f')
     'frame'
     """
     ref = {
         'event' : ['e', '1'],
         'frame' : ['f', '0'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, "bad frame level control. enter %s." % selStr
     return usrStr # may be None
Example #13
0
 def _selectLevelFrameParser(self, usrStr):
     """
     >>> a = Parameter([])
     >>> a._selectLevelFrameParser('f')
     'frame'
     """
     ref = {
         'event': ['e', '1'],
         'frame': ['f', '0'],
     }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, "bad frame level control. enter %s." % selStr
     return usrStr  # may be None
Example #14
0
    def _articulationParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._articulationParser('a')
        'attack'
        """
        ref = {
            'attack' : ['a'],
            'sustain' : ['s'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
        return usrStr
Example #15
0
    def _onOffParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._onOffParser(1)
        'on'
        """
        ref = {
            'on' : ['1'],
            'off' : ['0'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
        return usrStr
Example #16
0
 def _thresholdMatchParser(self, usrStr):
     """
     >>> a = Parameter([])
     >>> a._thresholdMatchParser('u')
     'upper'
     """
     ref = {
         'lower' : ['l'],
         'upper' : ['u'],
         'match' : ['m'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #17
0
    def _loopControlParser(self, usrStr):
        """determine if a value referes to loop (1) or single (0)

        >>> a = Parameter([])
        >>> a._loopControlParser(0)
        'single'
        """
        ref = {
            'loop' : ['l', '1'],
            'single' : ['s', '0'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, "loop control is either %s." % selStr
        return usrStr # may be None
Example #18
0
 def _thresholdMatchParser(self, usrStr):
     """
     >>> a = Parameter([])
     >>> a._thresholdMatchParser('u')
     'upper'
     """
     ref = {
         'lower': ['l'],
         'upper': ['u'],
         'match': ['m'],
     }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #19
0
    def _articulationParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._articulationParser('a')
        'attack'
        """
        ref = {
            'attack': ['a'],
            'sustain': ['s'],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
        return usrStr
Example #20
0
    def _scaleSwitchParser(self, usrStr):
        """determine if a value refers to absolute or proportional values         

        >>> a = Parameter([])
        >>> a._scaleSwitchParser('p')
        'proportional'
        """
        ref = {
            'absolute': ['a', '1'],
            'proportional': ['p', '0'],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, "bad step control. enter %s." % selStr
        return usrStr  # may be None
Example #21
0
    def _onOffParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._onOffParser(1)
        'on'
        """
        ref = {
            'on': ['1'],
            'off': ['0'],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
        return usrStr
Example #22
0
    def _loopControlParser(self, usrStr):
        """determine if a value referes to loop (1) or single (0)

        >>> a = Parameter([])
        >>> a._loopControlParser(0)
        'single'
        """
        ref = {
            'loop': ['l', '1'],
            'single': ['s', '0'],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, "loop control is either %s." % selStr
        return usrStr  # may be None
Example #23
0
    def _selectTimeRefParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._selectTimeRefParser('tt')
        'textureTime'
        """
        ref = {
            'textureTime': ['tt'],
            'cloneTime': ['ct'],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
        return usrStr
Example #24
0
    def _scaleSwitchParser(self, usrStr):
        """determine if a value refers to absolute or proportional values         

        >>> a = Parameter([])
        >>> a._scaleSwitchParser('p')
        'proportional'
        """
        ref = {
            'absolute' : ['a', '1'],
            'proportional' : ['p', '0'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, "bad step control. enter %s." % selStr
        return usrStr # may be None
Example #25
0
    def _selectTimeRefParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._selectTimeRefParser('tt')
        'textureTime'
        """
        ref = {
            'textureTime' : ['tt'],
            'cloneTime' : ['ct'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
        return usrStr
Example #26
0
 def _anchorParser(self, usrStr):
     """
     >>> a = Parameter([])
     >>> a._anchorParser('a')
     'average'
     """
     ref = {
         'lower' : ['l'],
         'upper' : ['u'],
         'average' : ['a'],
         'median' : ['m'],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #27
0
 def _anchorParser(self, usrStr):
     """
     >>> a = Parameter([])
     >>> a._anchorParser('a')
     'average'
     """
     ref = {
         'lower': ['l'],
         'upper': ['u'],
         'average': ['a'],
         'median': ['m'],
     }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #28
0
    def _boundaryParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._boundaryParser('w')
        'wrap'
        """
        ref = {
            'limit': ['l'],
            'wrap': ['w'],
            'reflect': ['r'],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, "bad boundary method. enter %s." % selStr
        return usrStr  # may be None
Example #29
0
 def _valueSelectBiParser(self, usrStr):
     """xy selection
     >>> a = Parameter([])
     >>> a._valueSelectBiParser('xy')
     'xy'
     """
     ref = { # automatically uses keys as case insensitive values
         'x' : [],
         'y' : [],
         'xy' : [],
         'yx' : [],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #30
0
    def _stepControlParser(self, usrStr):
        """determine if a value refers to step (event) control (1) or
        real-time control (0)

        >>> a = Parameter([])
        >>> a._stepControlParser('e')
        'event'
        """
        ref = {
            'event': ['e', '1'],
            'time': ['t', '0'],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, "bad step control. enter %s." % selStr
        return usrStr  # may be None
Example #31
0
    def _selectLevelPolyphonicParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._selectLevelPolyphonicParser('e')
        'event'    
        """
        ref = {
            'event' : ['e'],
            'set' : ['s'],
            'voice' : ['v'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError('bad control value: enter %s.' % selStr)
        return usrStr
Example #32
0
    def _stepControlParser(self, usrStr):
        """determine if a value refers to step (event) control (1) or
        real-time control (0)

        >>> a = Parameter([])
        >>> a._stepControlParser('e')
        'event'
        """
        ref = {
            'event' : ['e', '1'],
            'time' : ['t', '0'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, "bad step control. enter %s." % selStr
        return usrStr # may be None
Example #33
0
    def _boundaryParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._boundaryParser('w')
        'wrap'
        """
        ref = {
            'limit' : [ 'l'],
            'wrap' : ['w'],
            'reflect' : ['r'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)      
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, "bad boundary method. enter %s." % selStr         
        return usrStr # may be None
Example #34
0
 def _valueSelectBiParser(self, usrStr):
     """xy selection
     >>> a = Parameter([])
     >>> a._valueSelectBiParser('xy')
     'xy'
     """
     ref = { # automatically uses keys as case insensitive values
         'x' : [],
         'y' : [],
         'xy' : [],
         'yx' : [],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #35
0
def libraryParser(usrStr):
    """decode feedback models

    >>> libraryParser('t')
    'thermostat'
    >>> libraryParser('cc')
    'climateControl'
    """
    ref = {
        'climateControl': ['cc', 'climage'],
        'thermostat': ['t', 'temp'],
    }
    usrStr = drawer.selectionParse(usrStr, ref)
    if usrStr == None:
        selStr = drawer.selectionParseKeyLabel(ref)
        raise FeedbackError('bad user string name: %s.' % selStr)
    return usrStr
Example #36
0
def libraryParser(usrStr):
    """decode feedback models

    >>> libraryParser('t')
    'thermostat'
    >>> libraryParser('cc')
    'climateControl'
    """
    ref = {
        'climateControl' : ['cc', 'climage'],
        'thermostat' : ['t', 'temp'],
            }
    usrStr = drawer.selectionParse(usrStr, ref)
    if usrStr == None:
        selStr = drawer.selectionParseKeyLabel(ref)
        raise FeedbackError('bad user string name: %s.' % selStr)
    return usrStr
Example #37
0
    def _comparisonParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._comparisonParser('lt')
        'lessThan'    
        """
        ref = {
            'equal': ['e', '='],
            'greaterThan': ['gt', 'g', 'greater', '>'],
            'greaterThanOrEqual': ['gtoe', '>='],
            'lessThan': ['lt', 'l', 'less', '<'],
            'lessThanOrEqual': ['ltoe', '<='],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
        return usrStr
Example #38
0
    def _directionParser(self, usrStr):
        """decode direction strings; this used to have values preceded
        by 'linear; keep for backwards compat

        >>> a = Parameter([])
        >>> a._directionParser('ud')
        'upDown'
        """
        ref = {
            'upDown' : ['ud', 'lud', 'linearupdown', '0'],
            'downUp' : ['du', 'ldu', 'lineardownup', '1'],
            'up'        : ['u', 'lu', 'linearup', '2'],
            'down'  : ['d', 'ld', 'lineardown', '3'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad direction name: enter %s.' % selStr
        return usrStr
Example #39
0
    def _comparisonParser(self, usrStr):
        """decode control choice strings

        >>> a = Parameter([])
        >>> a._comparisonParser('lt')
        'lessThan'    
        """
        ref = {
            'equal' : ['e', '='],
            'greaterThan' : ['gt', 'g', 'greater', '>'],
            'greaterThanOrEqual' : ['gtoe', '>='],
            'lessThan' : ['lt', 'l', 'less', '<'],
            'lessThanOrEqual' : ['ltoe', '<='],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
        return usrStr        
Example #40
0
    def _directionParser(self, usrStr):
        """decode direction strings; this used to have values preceded
        by 'linear; keep for backwards compat

        >>> a = Parameter([])
        >>> a._directionParser('ud')
        'upDown'
        """
        ref = {
            'upDown': ['ud', 'lud', 'linearupdown', '0'],
            'downUp': ['du', 'ldu', 'lineardownup', '1'],
            'up': ['u', 'lu', 'linearup', '2'],
            'down': ['d', 'ld', 'lineardown', '3'],
        }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad direction name: enter %s.' % selStr
        return usrStr
Example #41
0
    def _selectorParser(self, usrStr):
        """decode control choice strings; exception on error

        >>> a = Parameter([])
        >>> a._selectorParser('rp')
        'randomPermutate'
        """
        ref = {
            'randomChoice' : [ 'rc', '0'],
            'randomWalk' : ['rw'],
            'randomPermutate' : ['rp'],
            'orderedCyclic' : ['oc', '1'],
            'orderedCyclicRetrograde' : ['ocr',],
            'orderedOscillate' : ['oo'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError('bad selectionString: enter %s.' % selStr)
        return usrStr
Example #42
0
    def _selectorParser(self, usrStr):
        """decode control choice strings; exception on error

        >>> a = Parameter([])
        >>> a._selectorParser('rp')
        'randomPermutate'
        """
        ref = {
            'randomChoice' : [ 'rc', '0'],
            'randomWalk' : ['rw'],
            'randomPermutate' : ['rp'],
            'orderedCyclic' : ['oc', '1'],
            'orderedCyclicRetrograde' : ['ocr',],
            'orderedOscillate' : ['oo'],
                }
        usrStr = drawer.selectionParse(usrStr, ref)
        if usrStr == None:
            selStr = drawer.selectionParseKeyLabel(ref)
            raise error.ParameterObjectSyntaxError, 'bad selectionString: enter %s.' % selStr
        return usrStr
Example #43
0
 def _valueSelectTriParser(self, usrStr):
     'xyz selection'
     ref = { # automatically uses keys as case insensitive values
         'x' : [],
         'y' : [],
         'z' : [],
         'xy' : [],
         'xz' : [],
         'yx' : [],
         'yz' : [],
         'zx' : [],
         'zy' : [],
         'xyz' : [],
         'xzy' : [],
         'yxz' : [],
         'yzx' : [],
         'zxy' : [],
         'zyx' : [],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr
Example #44
0
 def _valueSelectTriParser(self, usrStr):
     'xyz selection'
     ref = { # automatically uses keys as case insensitive values
         'x' : [],
         'y' : [],
         'z' : [],
         'xy' : [],
         'xz' : [],
         'yx' : [],
         'yz' : [],
         'zx' : [],
         'zy' : [],
         'xyz' : [],
         'xzy' : [],
         'yxz' : [],
         'yzx' : [],
         'zxy' : [],
         'zyx' : [],
             }
     usrStr = drawer.selectionParse(usrStr, ref)
     if usrStr == None:
         selStr = drawer.selectionParseKeyLabel(ref)
         raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr
     return usrStr