Ejemplo n.º 1
0
 def __call__(self, key: str, idx: int, val: int):
     '''sets value of PGS integer key at idx
     raises IndexError if idx is invalid
     instead of original KSP, key has to be string'''
     key = PgsKeyConverter(key)
     idx = get_runtime_val(idx)
     val = get_runtime_val(val)
     PGS().set_key_val(key.val, idx, val)
     return super().__call__(key, idx, val)
Ejemplo n.º 2
0
    def _get_key(self, group, slot, generic):
        group = get_runtime_val(group)
        slot = get_runtime_val(slot)
        generic = get_runtime_val(generic)
        if group > -1:
            if generic > -1:
                raise AttributeError(
                    'with group index generic has to be -1')

        key = f'{group}{slot}{generic}'
        return key
Ejemplo n.º 3
0
 def __call__(self, key: str, val: str):
     '''sets value of PGS string key at idx
     raises IndexError if idx is invalid
     instead of original KSP, key has to be string'''
     key = PgsKeyConverter(key)
     val = get_runtime_val(val)
     PGS().set_str_key_val(key.val, val)
     return super().__call__(key, val)
Ejemplo n.º 4
0
 def __call__(self, voice_type: bTmProVar, value: int):
     '''retunrs the voice limit for the Time Machine Pro mode of the
     source module
     <voice-type>
     the voice type, can be one one of the following:
     $NI_VL_TMPRO_STANDARD {Standard Mode}
     $NI_VL_TMRPO_HQ {High Quality Mode}'''
     val_rt = get_runtime_val(value)
     voice_type.set_value(val_rt)
     return super().__call__(voice_type, value)
Ejemplo n.º 5
0
 def calculate(self, note_nr, value):
     note_nr = get_runtime_val(note_nr)
     keys[note_nr].type = value
     return kNone()
Ejemplo n.º 6
0
 def __call__(self, mode: int):
     '''sets the trigger state of the specified key on KONTAKT's
     keyboard either to pressed/on (1) or released/off (0)'''
     mode_r = get_runtime_val(mode)
     Key.pressed_support = mode_r
     return super().__call__(mode)
Ejemplo n.º 7
0
 def calculate(self, note_nr, value):
     note_nr = get_runtime_val(note_nr)
     value = get_runtime_val(value)
     keys[note_nr].pressed = bool(value)
     return kNone()
Ejemplo n.º 8
0
 def calculate(self, note_nr):
     note_nr = get_runtime_val(note_nr)
     return keys[note_nr].type
Ejemplo n.º 9
0
 def calculate(self, note_nr, name):
     note_nr = get_runtime_val(note_nr)
     name = get_runtime_val(name)
     keys[note_nr].name = name
     return kNone()
Ejemplo n.º 10
0
 def calculate(self, value, min_val, max_val):
     value = get_runtime_val(value)
     min_val = get_runtime_val(min_val)
     max_val = get_runtime_val(max_val)
     return value >= min_val and value <= max_val
Ejemplo n.º 11
0
 def calculate(self, key):
     key = get_runtime_val(key)
     return PGS().get_str_key_val(key)
Ejemplo n.º 12
0
 def calculate(self, key, idx):
     key = get_runtime_val(key)
     idx = get_runtime_val(idx)
     return PGS().get_key_val(key, idx)